forked from thomseddon/traefik-forward-auth
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add GitHub Actions workflow for creating binaries for releases (thoms…
…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
Showing
2 changed files
with
59 additions
and
0 deletions.
There are no files selected for viewing
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
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 |
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