mirror of
https://github.com/multica-ai/multica.git
synced 2026-07-25 20:15:37 +02:00
The release workflow previously triggered on 'v*', which matched a stray 'v0.2.5-dirty' tag pushed to the repository. GoReleaser ran again and overwrote the Homebrew formula with a 0.2.5-dirty version whose tarball URLs 404. Tighten the trigger to semver-shaped tags and add an explicit guard that fails the job if the tag name contains '-dirty' (which can come from 'git describe --tags --dirty'). Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
47 lines
1.0 KiB
YAML
47 lines
1.0 KiB
YAML
name: Release
|
|
|
|
on:
|
|
push:
|
|
tags:
|
|
- "v[0-9]+.[0-9]+.[0-9]+"
|
|
- "v[0-9]+.[0-9]+.[0-9]+-*"
|
|
|
|
permissions:
|
|
contents: write
|
|
|
|
jobs:
|
|
release:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@v4
|
|
with:
|
|
fetch-depth: 0
|
|
|
|
- name: Validate tag name
|
|
run: |
|
|
tag="${GITHUB_REF_NAME}"
|
|
echo "Triggered by tag: $tag"
|
|
if [[ "$tag" == *-dirty* ]]; then
|
|
echo "::error::Refusing to release from dirty tag '$tag'."
|
|
exit 1
|
|
fi
|
|
|
|
- name: Setup Go
|
|
uses: actions/setup-go@v5
|
|
with:
|
|
go-version-file: server/go.mod
|
|
cache-dependency-path: server/go.sum
|
|
|
|
- name: Run tests
|
|
run: cd server && go test ./...
|
|
|
|
- name: Run GoReleaser
|
|
uses: goreleaser/goreleaser-action@v6
|
|
with:
|
|
version: "~> v2"
|
|
args: release --clean
|
|
env:
|
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
HOMEBREW_TAP_GITHUB_TOKEN: ${{ secrets.HOMEBREW_TAP_GITHUB_TOKEN }}
|