Skip to content

Merge pull request #4 from mondaycom/chore/release-v0.8.2 #9

Merge pull request #4 from mondaycom/chore/release-v0.8.2

Merge pull request #4 from mondaycom/chore/release-v0.8.2 #9

Workflow file for this run

name: Release
on:
push:
tags:
- 'v*'
permissions:
contents: write
jobs:
goreleaser:
name: Build and publish
# Every target cross-compiles from this one runner because the build needs no
# cgo. The previous matrix required a macOS runner for darwin, which is what
# made the Intel build queue indefinitely (no macos-13 runner) and left tags
# unpublished.
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v7
with:
# goreleaser derives the version and changelog from tags.
fetch-depth: 0
# Releases in this repository are immutable: once a tag publishes, its
# assets cannot be replaced and re-running the job cannot fix a mistake --
# goreleaser fails fast with "already exists and is immutable". flake.nix
# states its version literally, because Nix builds from a source tree with
# no .git, so it is the one thing that can silently disagree with the tag.
# Catch that here, before anything becomes permanent.
- name: Check flake version matches the tag
env:
TAG: ${{ github.ref_name }}
run: |
want="${TAG#v}"
got="$(sed -n 's/^ *version = "\(.*\)";$/\1/p' flake.nix)"
if [ "$want" != "$got" ]; then
echo "::error file=flake.nix::flake.nix says $got but the tag is $want. Bump flake.nix and re-tag."
exit 1
fi
echo "flake.nix and tag agree on $want"
- name: Set up Go
uses: actions/setup-go@v7
with:
go-version: "1.26"
- name: Release
uses: goreleaser/goreleaser-action@v7
with:
version: "~> v2"
args: release --clean
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# PAT with contents:write on mondaycom/homebrew-tap. The per-run
# GITHUB_TOKEN is scoped to this repository and cannot push the cask
# to another one.
HOMEBREW_TAP_TOKEN: ${{ secrets.HOMEBREW_TAP_TOKEN }}