Updating frontend #14
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Go Cross-Compilation Build | |
on: | |
push: | |
tags: | |
- "v*.*.*" # Only trigger on version tag pushes | |
workflow_dispatch: # Allows you to manually trigger the workflow | |
jobs: | |
build: | |
name: Build Go binaries for multiple platforms | |
runs-on: ubuntu-latest | |
permissions: | |
contents: write | |
strategy: | |
matrix: | |
goos: [linux, windows, darwin] | |
goarch: [amd64, arm64] | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
- name: Set up Go | |
uses: actions/setup-go@v5 | |
with: | |
go-version: '1.23' # Or the version of Go you're using | |
- name: Build for ${{ matrix.goos }}/${{ matrix.goarch }} | |
run: | | |
mkdir -p build/${{ matrix.goos }}_${{ matrix.goarch }} | |
go mod tidy | |
GOOS=${{ matrix.goos }} GOARCH=${{ matrix.goarch }} go build -ldflags "-s -w" -o build/${{ matrix.goos }}_${{ matrix.goarch }}/sn | |
env: | |
CGO_ENABLED: 0 # Disable CGO for portability across platforms | |
- name: Upload build artifacts | |
uses: actions/upload-artifact@v3 | |
with: | |
name: sn-${{ matrix.goos }}-${{ matrix.goarch }} | |
path: build/${{ matrix.goos }}_${{ matrix.goarch }}/sn | |
- name: Create GitHub Release | |
id: create_release | |
uses: softprops/action-gh-release@v1 | |
with: | |
tag_name: ${{ github.ref_name }} | |
name: Release ${{ github.ref_name }} | |
body: | | |
## Release Notes | |
This is the official release of version ${{ github.ref_name }}. | |
draft: false | |
prerelease: false | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Automatically provided by GitHub Actions | |
- name: Upload Release Assets | |
uses: actions/upload-release-asset@v1 | |
with: | |
upload_url: ${{ steps.create_release.outputs.upload_url }} | |
asset_path: build/${{ matrix.goos }}_${{ matrix.goarch }}/sn | |
asset_name: sn-${{ matrix.goos }}-${{ matrix.goarch }} | |
asset_content_type: application/octet-stream | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Automatically provided by GitHub Actions |