Skip to content

Commit

Permalink
ci(release): create tag for goreleaser (#135)
Browse files Browse the repository at this point in the history
Creating a release as a draft does not create the tag, which goreleaser
needs to work.

Update goreleaser config to v2

Release-As: 2.2.1
  • Loading branch information
mloberg authored Oct 25, 2024
1 parent e2abbc1 commit 66c4937
Show file tree
Hide file tree
Showing 4 changed files with 27 additions and 3 deletions.
4 changes: 1 addition & 3 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ updates:
schedule:
interval: monthly
commit-message:
include: scope
prefix: ci
groups:
actions:
Expand All @@ -17,9 +16,8 @@ updates:
schedule:
interval: monthly
commit-message:
include: scope
prefix: deps
prefix-development: chore
prefix-development: build(gomod)
groups:
terraform:
patterns:
Expand Down
25 changes: 25 additions & 0 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,31 @@ jobs:
with:
token: ${{ steps.token.outputs.token }}
skip-github-pull-request: "${{ contains(github.event.head_commit.message, 'chore: release') }}"
- if: steps.release.outputs.release_created
uses: actions/github-script@v7
with:
github-token: ${{ steps.token.outputs.token }}
script: |
const tag = '${{ steps.release.outputs.tag_name }}';
// Create annotated tag
const result = await github.rest.git.createTag({
...context.repo,
tag,
message: `Release ${tag}`,
type: 'commit',
object: context.sha,
});
const sha = result.data.sha;
// Create the ref
await github.rest.git.createRef({
...context.repo,
sha,
ref: `refs/tags/${tag}`,
});
core.setOutput('sha', sha);
outputs:
released: ${{ steps.release.outputs.release_created }}
publish:
Expand Down
File renamed without changes.
1 change: 1 addition & 0 deletions .goreleaser.yml → .goreleaser.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
version: 2
before:
hooks:
- go mod tidy
Expand Down

0 comments on commit 66c4937

Please sign in to comment.