Skip to content

Build binaries for release #84

Build binaries for release

Build binaries for release #84

Workflow file for this run

name: Build binaries for release
on:
release:
types: [created]
permissions:
contents: write
packages: write
jobs:
releases-matrix:
name: Release Go binaries
runs-on: ubuntu-latest
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/checkout@v4
- 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