Skip to content

release-binary

release-binary #172

name: release-binary
on:
schedule:
- cron: '43 11 * * *'
push:
# Publish semver tags as releases.
tags: [ 'v*.*.*' ]
pull_request:
branches: [ "main" ]
permissions:
contents: write
jobs:
goreleaser:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Set up Go
uses: actions/setup-go@v4
with:
go-version: '1.20'
- name: Build GoReleaser snapshot
uses: goreleaser/goreleaser-action@v4
if: contains(fromJSON('["pull_request", "schedule"]'), github.event_name) # only check if release is possible
with:
version: latest
args: release --clean --snapshot
- name: Run GoReleaser
uses: goreleaser/goreleaser-action@v4
if: github.event_name == 'push' # tag was pushed
with:
version: latest
args: release --clean
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}