Release #4
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 | |
# Controls when the workflow will run | |
on: | |
release: | |
types: [published] | |
# Allows you to run this workflow manually from the Actions tab | |
workflow_dispatch: | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v2 | |
- name: Setup Go | |
uses: actions/setup-go@v2 | |
with: | |
go-version: ^1.17.1 | |
- name: Cache go module | |
uses: actions/cache@v2 | |
with: | |
path: | | |
~/.cache/go-build | |
~/go/pkg/mod | |
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }} | |
restore-keys: | | |
${{ runner.os }}-go- | |
- name: Build | |
if: startsWith(github.ref, 'refs/tags/') || github.ref == 'refs/heads/main' | |
env: | |
NAME: oci-help | |
BINDIR: build | |
run: | | |
make release -j$(nproc) | |
- name: Upload Release | |
uses: softprops/action-gh-release@v1 | |
if: startsWith(github.ref, 'refs/tags/') || github.ref == 'refs/heads/main' | |
with: | |
files: build/*.zip |