Add more binaries and release them all #5
Workflow file for this run
This file contains hidden or 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: Release | |
on: | |
push: | |
tags: | |
- v* | |
jobs: | |
build: | |
name: Build release binaries | |
runs-on: ubuntu-latest | |
steps: | |
- name: Check out code into the Go module directory | |
uses: actions/checkout@v4 | |
- name: Setup Go | |
uses: actions/setup-go@v5 | |
with: | |
go-version-file: go.mod | |
- name: Build Binaries | |
env: | |
CGO_ENABLED: 0 | |
GO111MODULE: on | |
run: | | |
platforms=(linux windows darwin) | |
architectures=(amd64 arm64 arm) | |
for platform in "${platforms[@]}"; do | |
for arch in "${architectures[@]}"; do | |
[[ ("${platform}" == "windows" || "${platform}" == "darwin") && "${arch}" == "arm" ]] && continue | |
echo "Building Traefik-Forward-Auth for ${platform}-${arch}" | |
GOOS="${platform}" GOARCH="${arch}" go build -a -installsuffix nocgo -o traefik-forward-auth ./cmd | |
tar cJvf "traefik-forward-auth_${platform}_${arch}.tar.xz" traefik-forward-auth | |
rm traefik-forward-auth | |
done | |
done | |
- name: Upload Assets | |
env: | |
GH_TOKEN: ${{ github.token }} | |
run: | | |
gh release upload ${GITHUB_REF_NAME} *.tar.xz |