Build binaries for release #93
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: Build binaries for release | |
on: | |
release: | |
types: [created] | |
permissions: | |
contents: write | |
packages: write | |
jobs: | |
releases-matrix: | |
name: Release Go binaries | |
runs-on: ubuntu-24.04 | |
strategy: | |
matrix: | |
goos: [darwin, freebsd, linux, netbsd, openbsd, windows] | |
goarch: ["386", amd64, arm, arm64] | |
exclude: | |
# ignore: OS darwin | |
- goarch: "386" | |
goos: darwin | |
- goarch: arm | |
goos: darwin | |
- goarch: "386" | |
goos: netbsd | |
- goarch: arm | |
goos: netbsd | |
include: | |
# Linux | |
- goarch: loong64 | |
goos: linux | |
- goarch: mips | |
goos: linux | |
- goarch: mips64 | |
goos: linux | |
- goarch: mips64le | |
goos: linux | |
- goarch: mipsle | |
goos: linux | |
- goarch: ppc64 | |
goos: linux | |
- goarch: ppc64le | |
goos: linux | |
- goarch: riscv64 | |
goos: linux | |
- goarch: s390x | |
goos: linux | |
steps: | |
- uses: actions/[email protected] | |
- name: "Update build.go" | |
run: | | |
echo "package main" > ./build.go && | |
echo "" >> ./build.go && | |
echo "import \"runtime\"" >> ./build.go && | |
echo "" >> ./build.go && | |
echo "const AppVersion = \"$(echo ${GITHUB_REF#refs/tags/} | cut -c 2-)\"" >> ./build.go && | |
echo "const BuildArch = runtime.GOARCH" >> ./build.go && | |
echo "const BuildOS = runtime.GOOS" >> ./build.go | |
echo "const BuildCompiler = \"${{ vars.GO_VERSION }}\"" >> ./build.go | |
- uses: wangyoucao577/go-release-action@v1 | |
with: | |
retry: 10 | |
overwrite: true | |
github_token: ${{ secrets.GH_PAT }} | |
goos: ${{ matrix.goos }} | |
goarch: ${{ matrix.goarch }} | |
goversion: ${{ vars.GO_VERSION }} | |
md5sum: false | |
sha256sum: true | |
project_path: "./" | |
binary_name: "gpm" | |
extra_files: LICENSE README.md CHANGELOG.md |