Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: thomseddon/traefik-forward-auth
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: master
Choose a base ref
...
head repository: RobertDeRose/traefik-forward-auth
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: feature/better-builds
Choose a head ref
  • 1 commit
  • 1 file changed
  • 1 contributor

Commits on Dec 26, 2024

  1. Add more binaries and release them all

    This also corrects the fact that the current workflow overwrites the arm64 build
    RobertDeRose committed Dec 26, 2024

    Verified

    This commit was signed with the committer’s verified signature.
    renovate-bot Mend Renovate
    Copy the full SHA
    448714a View commit details
Showing with 30 additions and 41 deletions.
  1. +30 −41 .github/workflows/release.yml
71 changes: 30 additions & 41 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -1,57 +1,46 @@
name: Release

on:
release:
types: [published]
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@v2

- name: Set up Go 1.x
uses: actions/setup-go@v2
with:
go-version: ^1.13
id: go

- name: Build AMD64
run: CGO_ENABLED=0 GOOS=linux GOARCH=amd64 GO111MODULE=on go build -a -installsuffix nocgo -v -o traefik-forward-auth_amd64 ./cmd

- name: Build ARM
run: CGO_ENABLED=0 GOOS=linux GOARCH=arm GO111MODULE=on go build -a -installsuffix nocgo -v -o traefik-forward-auth_arm ./cmd
uses: actions/checkout@v4

- name: Get tag name
run: echo "TAG=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV

- name: Get artifact details
uses: octokit/request-action@v2.x
id: get_release_details
- name: Setup Go
uses: actions/setup-go@v5
with:
route: get /repos/${{ github.repository }}/releases/tags/${{ env.TAG }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
go-version-file: go.mod

- name: Upload AMD64 release asset
uses: actions/upload-release-asset@v1
- name: Build Binaries
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ fromJson(steps.get_release_details.outputs.data).upload_url }}
asset_path: traefik-forward-auth_amd64
asset_name: traefik-forward-auth_amd64
asset_content_type: application/octet-stream

- name: Upload ARM release asset
uses: actions/upload-release-asset@v1
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:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ fromJson(steps.get_release_details.outputs.data).upload_url }}
asset_path: traefik-forward-auth_arm
asset_name: traefik-forward-auth_arm
asset_content_type: application/octet-stream
GH_TOKEN: ${{ github.token }}
run: |
gh release upload ${GITHUB_REF_NAME} *.tar.xz