-
Notifications
You must be signed in to change notification settings - Fork 65
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
WaybackBot
committed
Jul 4, 2020
1 parent
2e25473
commit 8381a62
Showing
1 changed file
with
88 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,88 @@ | ||
name: Release | ||
|
||
on: | ||
push: | ||
tags: | ||
- 'v*' # Push events to matching v*, i.e. v1.0, v20.15.10 | ||
|
||
jobs: | ||
setup: | ||
name: Initial build env | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Set up Go 1.x | ||
uses: actions/setup-go@v2 | ||
with: | ||
go-version: ^1.13 | ||
|
||
build: | ||
name: Checkout, build, archive, upload | ||
runs-on: ubuntu-latest | ||
needs: setup | ||
steps: | ||
- name: Check out code into the Go module directory | ||
uses: actions/checkout@v2 | ||
|
||
- name: List checked-out code | ||
run: ls -al | ||
|
||
- name: Build fat binary | ||
run: make all-arch | ||
|
||
- name: Archive binary | ||
run: make releases | ||
|
||
- name: Upload archived binary | ||
uses: actions/upload-artifact@v2 | ||
with: | ||
name: wayback | ||
path: build/package/wayback* | ||
|
||
checksum: | ||
name: Get archived packages checksum | ||
runs-on: ubuntu-latest | ||
needs: build | ||
outputs: | ||
digest: ${{ steps.digest.outputs.result }} | ||
steps: | ||
- name: Download math result from build job | ||
uses: actions/download-artifact@v2 | ||
with: | ||
name: wayback | ||
|
||
- name: Create all binary digest | ||
id: digest | ||
run: | | ||
echo ::set-output name=result::$(find ./wayback* -type f -exec sha256sum {} +) | ||
release: | ||
name: Create and upload release | ||
runs-on: ubuntu-latest | ||
needs: [build, checksum] | ||
steps: | ||
- name: Download math result from build and checksum jobs | ||
uses: actions/download-artifact@v2 | ||
with: | ||
name: wayback | ||
path: wayback # Put files to wayback directory | ||
|
||
- name: Create Release | ||
uses: actions/create-release@v1 | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # This token is provided by Actions, you do not need to create your own token | ||
with: | ||
tag_name: ${{ github.ref }} | ||
release_name: Release ${{ github.ref }} | ||
body: | | ||
**Digests in this release:** | ||
${{ needs.checksum.outputs.digest }} | ||
draft: false | ||
prerelease: true | ||
|
||
- name: Upload release assets | ||
uses: fnkr/github-action-ghr@v1 | ||
if: startsWith(github.ref, 'refs/tags/') | ||
env: | ||
GHR_PATH: wayback/ | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |