Skip to content

Commit

Permalink
Add GitHub Actions workflow for creating binaries for releases (thoms…
Browse files Browse the repository at this point in the history
…eddon#184) (thomseddon#199)

* Add GitHub Actions workflow for creating binaries for releases
* Add sentence about binary files to README
* Cleanup + nicer way querying GitHub API
  • Loading branch information
em0lar / Leo authored Feb 1, 2021
1 parent 6c6f75e commit 4ffb659
Show file tree
Hide file tree
Showing 2 changed files with 59 additions and 0 deletions.
57 changes: 57 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
name: Release

on:
release:
types: [published]

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

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

- name: Get artifact details
uses: octokit/[email protected]
id: get_release_details
with:
route: get /repos/${{ github.repository }}/releases/tags/${{ env.TAG }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Upload AMD64 release asset
uses: actions/upload-release-asset@v1
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
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
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,8 @@ You can also use the latest incremental releases found on [docker hub](https://h

ARM releases are also available on docker hub, just append `-arm` or `-arm64` to your desired released (e.g. `2-arm` or `2.1-arm64`).

We also build binary files for usage without docker starting with releases after 2.2.0 You can find these as assets of the specific GitHub release.

#### Upgrade Guide

v2 was released in June 2019, whilst this is fully backwards compatible, a number of configuration options were modified, please see the [upgrade guide](https://github.com/thomseddon/traefik-forward-auth/wiki/v2-Upgrade-Guide) to prevent warnings on startup and ensure you are using the current configuration.
Expand Down

0 comments on commit 4ffb659

Please sign in to comment.