Skip to content

Add goreleaser actions #3

Add goreleaser actions

Add goreleaser actions #3

Workflow file for this run

---
name: release
on:
pull_request:
push:
tags:
- 'v*'
jobs:
build:
runs-on: ubuntu-latest
permissions:
id-token: write
packages: write
contents: write
steps:
- uses: actions/setup-go@v4
with:
go-version: '1.21.1'
check-latest: true
- uses: sigstore/cosign-installer@v3
- uses: actions/checkout@v4
with:
fetch-depth: 1
- name: Build and publish release
uses: goreleaser/goreleaser-action@v5
if: contains(github.ref, 'refs/tags')
with:
args: release --clean
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Test release build
uses: goreleaser/goreleaser-action@v5
if: "!contains(github.ref, 'refs/tags')"
with:
args: release --clean --snapshot --skip sign
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- uses: actions/upload-artifact@v3
with:
name: artifacts
path: dist/*