release #33
Workflow file for this run
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
name: release | |
on: | |
push: | |
tags: | |
- "v*" | |
jobs: | |
create-release: | |
name: Create Release | |
runs-on: "ubuntu-latest" | |
steps: | |
# Install golang | |
- uses: actions/setup-go@v2 | |
with: | |
go-version: '^1.16' | |
# Install external go modules before cloning | |
- run: go install github.com/laher/goxc@latest | |
# Checkout code | |
- uses: actions/checkout@v2 | |
# Install golang deps, using a cache | |
- uses: actions/cache@v2 | |
with: | |
path: ~/go/pkg/mod | |
key: ubuntu-latest-1.16-go-${{ hashFiles('**/go.sum') }} | |
restore-keys: | | |
ubuntu-latest-1.16-go- | |
# build binaries for all supported environments | |
- run: sudo apt update && sudo apt install -y make | |
- run: make build-all | |
# Create the binary checksums | |
- name: Get the version | |
id: get_version | |
run: echo ::set-output name=VERSION::${GITHUB_REF#refs/tags/v} | |
- name: Create checksums | |
run: | | |
readonly BUILD_DIR="build/${{ steps.get_version.outputs.VERSION }}" | |
find "$BUILD_DIR" -type f -exec sha256sum {} + | awk -v build_dir="$BUILD_DIR" '{sub("^"build_dir"/", ""); print $1, $2}' > SHA256SUMS | |
find "$BUILD_DIR" -type f -exec sha512sum {} + | awk -v build_dir="$BUILD_DIR" '{sub("^"build_dir"/", ""); print $1, $2}' > SHA512SUMS | |
# Create the release | |
- uses: "marvinpinto/action-automatic-releases@latest" | |
with: | |
repo_token: "${{ secrets.GITHUB_TOKEN }}" | |
prerelease: false | |
files: | | |
build/${{ steps.get_version.outputs.VERSION }}/* | |
SHA256SUMS | |
SHA512SUMS |