-
I have projects that use this pattern to follow semver processes; however, I am running into an issue when it comes to goreleaser GHAs erroring after the tag has been created: name: GoReleaser Deployment
on:
pull_request:
push:
tags:
- "*.*.*"
permissions:
contents: write
# packages: write
# issues: write
# id-token: write
jobs:
goreleaser:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Install Syft
uses: anchore/sbom-action/download-syft@v0.18.0
- name: Configure Git
run: |
git config user.name "$GITHUB_ACTOR"
git config user.email "$GITHUB_ACTOR@users.noreply.github.com"
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: stable
- name: Get Next Version
id: semver
uses: ietf-tools/semver-action@v1
with:
token: ${{ secrets.GITHUB_TOKEN }}
branch: main
noVersionBumpBehavior: current
noNewCommitBehavior: current
- name: Create Git Tag
run: |
TAG="${{ steps.semver.outputs.next }}"
echo "Creating tag $TAG"
git checkout main
git pull origin main --tags
# Ensure the latest commit is tagged
if git rev-parse "$TAG" >/dev/null 2>&1; then
echo "Tag $TAG already exists. Skipping."
else
git tag -a "$TAG" -m "Release $TAG"
git push origin "$TAG"
fi
- name: Run GoReleaser
uses: goreleaser/goreleaser-action@v6
with:
distribution: goreleaser
version: "~> v2"
args: release --clean --config .goreleaser.yaml
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- uses: actions/attest-build-provenance@v2
with:
subject-checksums: ./dist/checksums.txt
With the error: /opt/hostedtoolcache/goreleaser-action/2.6.1/x64/goreleaser release --clean --config .goreleaser.yaml
⨯ release failed after 0s error=open .goreleaser.yaml: no such file or directory
Error: The process '/opt/hostedtoolcache/goreleaser-action/2.6.1/x64/goreleaser' failed with exit code 1 I know the issue comes from tagging but am I misunderstanding how tagging is performed with goreleaser? Is goreleaser performing the tagging or is it on us to do the tagging? Would appreciate any help on this. |
Beta Was this translation helpful? Give feedback.
Answered by
romelBen
Feb 2, 2025
Replies: 1 comment
-
Disregard. I was able to resolve it. I just need to push my changes to my |
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
romelBen
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Disregard. I was able to resolve it. I just need to push my changes to my
main
branch. Thanks for this tool. It's awesome!