mirror of
https://github.com/SoarinFerret/trmm-lam.git
synced 2026-05-03 23:36:54 +00:00
55 lines
1.4 KiB
YAML
55 lines
1.4 KiB
YAML
name: Build and Release
|
|
|
|
on:
|
|
# create a release when a tag is published
|
|
push:
|
|
tags:
|
|
- "*"
|
|
|
|
permissions:
|
|
contents: write
|
|
|
|
jobs:
|
|
build-and-release:
|
|
name: Build and Release Executables
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
# Checkout this repository
|
|
- name: Checkout Current Repo
|
|
uses: actions/checkout@v3
|
|
|
|
# Set up Go
|
|
- name: Set up Go
|
|
uses: actions/setup-go@v4
|
|
with:
|
|
go-version: "1.22.6" # Adjust this to your required Go version
|
|
|
|
# Build Linux executables
|
|
- name: Build Linux Executables
|
|
run: |
|
|
ARCHS='amd64 386 arm64 arm'
|
|
for arch in ${ARCHS}; do
|
|
env CGO_ENABLED=0 GOOS=linux GOARCH=${arch} go build -ldflags "-s -w" -o ./trmm-lam-${arch}
|
|
done
|
|
|
|
# Create a GitHub Release
|
|
- name: Create GitHub Release
|
|
id: create_release
|
|
uses: actions/create-release@v1
|
|
env:
|
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
with:
|
|
tag_name: ${{ github.ref_name }}
|
|
release_name: Release ${{ github.ref_name }}
|
|
draft: false
|
|
prerelease: false
|
|
|
|
# Upload assets to the release
|
|
- name: Upload Assets to Release with a wildcard
|
|
uses: csexton/release-asset-action@v3
|
|
with:
|
|
pattern: "trmm-lam-*"
|
|
github-token: ${{ secrets.GITHUB_TOKEN }}
|
|
release-url: ${{ steps.create_release.outputs.upload_url }}
|