Skip to content

Commit

Permalink
chore: Fix the goreleaser workflow (#182)
Browse files Browse the repository at this point in the history
## Motivation

Goreleaser is not interpreting the correct tag, here's a related issue:
goreleaser/goreleaser-action#255. The
workaround is to set an env var `GORELEASER_CURRENT_TAG`.
I also sneaked some minor changes to how acceptance tests are run so
that we can provide it with ref to run against.
  • Loading branch information
nieomylnieja committed Mar 1, 2024
1 parent 2595c15 commit e1cee24
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 2 deletions.
7 changes: 6 additions & 1 deletion .github/workflows/acc-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,11 @@ on:
description: Project name to create the tested objects in
required: false
type: string
ref:
description: Reference branch, tag or commit SHA to checkout
required: false
type: string
default: main
secrets:
clientSecret:
description: Client secret to use for authentication
Expand All @@ -31,7 +36,7 @@ jobs:
uses: actions/checkout@v4
with:
repository: nobl9/terraform-provider-nobl9
ref: main
ref: ${{ inputs.ref }}
- uses: actions/setup-go@v5
with:
go-version-file: go.mod
Expand Down
3 changes: 2 additions & 1 deletion .github/workflows/release-candidate.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,13 @@ name: Release candidate
on:
push:
tags:
- "v[0-9]+.[0-9]+.[0-9]+-rc[0-9]+"
- "v[0-9]+.[0-9]+.[0-9]+-"
jobs:
test:
uses: ./.github/workflows/acc-tests.yml
with:
clientId: "${{ vars.TERRAFORM_NOBL9_CLIENT_ID }}"
project: "${{ vars.TERRAFORM_NOBL9_PROJECT }}"
ref: "${{ github.ref_name }}"
secrets:
clientSecret: "${{ secrets.TERRAFORM_NOBL9_CLIENT_SECRET }}"
2 changes: 2 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ jobs:
with:
clientId: "${{ vars.TERRAFORM_NOBL9_CLIENT_ID }}"
project: "${{ vars.TERRAFORM_NOBL9_PROJECT }}"
ref: "${{ github.ref_name }}"
secrets:
clientSecret: "${{ secrets.TERRAFORM_NOBL9_CLIENT_SECRET }}"
goreleaser:
Expand Down Expand Up @@ -53,3 +54,4 @@ jobs:
env:
GPG_FINGERPRINT: ${{ steps.import_gpg.outputs.fingerprint }}
GITHUB_TOKEN: ${{ secrets.GH_TOKEN }}
GORELEASER_CURRENT_TAG: ${{ github.ref_name }}

0 comments on commit e1cee24

Please sign in to comment.