miller/.github/workflows/release.yml
Step Security Bot 77b504e0c4
[StepSecurity] ci: Harden GitHub Actions (#1107)
Signed-off-by: StepSecurity Bot <bot@stepsecurity.io>
2022-10-20 11:44:39 -04:00

49 lines
1.3 KiB
YAML

name: Release
on:
push:
tags:
- v*
workflow_dispatch:
env:
GO_VERSION: 1.17.6
jobs:
release:
name: Release
strategy:
matrix:
platform: [ubuntu-latest]
runs-on: ${{ matrix.platform }}
steps:
- name: Set up Go
uses: actions/setup-go@c4a742cab115ed795e34d4513e2cf7d472deb55f
with:
go-version: ${{ env.GO_VERSION }}
id: go
- name: Check out code into the Go module directory
uses: actions/checkout@93ea575cb5d8a053eaa0ac8fa3b40d7e05a33cc8
with:
fetch-depth: 0
# https://github.com/marketplace/actions/cache
- name: Cache Go modules
uses: actions/cache@1c73980b09e7aea7201f325a7aa3ad00beddcdda
with:
path: |
~/.cache/go-build
~/go/pkg/mod
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.os }}-go-
# https://goreleaser.com/ci/actions/
- name: Run GoReleaser
uses: goreleaser/goreleaser-action@b508e2e3ef3b19d4e4146d4f8fb3ba9db644a757
#if: startsWith(github.ref, 'refs/tags/v')
with:
version: latest
args: release -f .goreleaser.yml --rm-dist
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}