-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
58 additions
and
30 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -10,6 +10,7 @@ on: | |
push: | ||
branches: | ||
- 'main' | ||
- 'LH-70847-fix-release-trigger' | ||
tags: | ||
- 'v*' | ||
env: | ||
|
@@ -95,7 +96,7 @@ jobs: | |
name: Terraform Provider Acceptance Tests | ||
needs: unit-test | ||
runs-on: ubuntu-latest | ||
if: github.ref == 'refs/heads/main' | ||
# if: github.ref == 'refs/heads/main' | ||
defaults: | ||
run: | ||
working-directory: provider | ||
|
@@ -129,9 +130,10 @@ jobs: | |
ASA_RESOURCE_SDC_PASSWORD: ${{ secrets.ASA_RESOURCE_SDC_PASSWORD }} | ||
run: go test -v -cover ./... | ||
timeout-minutes: 10 | ||
trigger-release: | ||
tag-release-version: | ||
name: "Tag Release Version" | ||
needs: [acceptance-test, unit-test] | ||
if: github.ref == 'refs/heads/main' | ||
# if: github.ref == 'refs/heads/main' | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout repository code | ||
|
@@ -140,31 +142,9 @@ jobs: | |
uses: mathieudutour/[email protected] | ||
with: | ||
github_token: ${{ secrets.GITHUB_TOKEN }} | ||
# we cannot trigger workflow using above's tagging, so we need to do it manually | ||
release: | ||
if: github.ref_type == 'tag' | ||
runs-on: ubuntu-latest | ||
needs: [unit-test] | ||
steps: | ||
- uses: actions/checkout@3df4ab11eba7bda6032a0b82a6bb43b11571feac # v4.0.0 | ||
with: | ||
# Allow goreleaser to access older tag information. | ||
fetch-depth: 0 | ||
- uses: actions/setup-go@93397bea11091df50f3d7e59dc26a7711a8bcfbe # v4.1.0 | ||
with: | ||
go-version: '1.20' | ||
cache: true | ||
- name: Import GPG key | ||
uses: crazy-max/ghaction-import-gpg@82a020f1f7f605c65dd2449b392a52c3fcfef7ef # v6.0.0 | ||
id: import_gpg | ||
with: | ||
gpg_private_key: ${{ secrets.GPG_PRIVATE_KEY }} | ||
passphrase: ${{ secrets.PASSPHRASE }} | ||
- name: Run GoReleaser | ||
uses: goreleaser/goreleaser-action@7ec5c2b0c6cdda6e8bbb49444bc797dd33d74dd8 # v5.0.0 | ||
with: | ||
args: release --clean | ||
workdir: provider | ||
env: | ||
# GitHub sets the GITHUB_TOKEN secret automatically. | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
GPG_FINGERPRINT: ${{ steps.import_gpg.outputs.fingerprint }} | ||
name: "Release" | ||
needs: [tag-release-version] | ||
uses: ./.github/workflows/module-release.yml | ||
secrets: inherit |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
on: | ||
push: | ||
tags: | ||
- 'v**' | ||
|
||
jobs: | ||
release: | ||
name: "Release" | ||
uses: ./.github/workflows/module-release.yml | ||
secrets: inherit |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
name: Release | ||
on: | ||
workflow_call: | ||
|
||
env: | ||
AWS_REGION: "us-west-2" | ||
|
||
permissions: | ||
contents: write | ||
|
||
jobs: | ||
release: | ||
name: "Release" | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@3df4ab11eba7bda6032a0b82a6bb43b11571feac # v4.0.0 | ||
with: | ||
# Allow goreleaser to access older tag information. | ||
fetch-depth: 0 | ||
- uses: actions/setup-go@93397bea11091df50f3d7e59dc26a7711a8bcfbe # v4.1.0 | ||
with: | ||
go-version: '1.20' | ||
cache: true | ||
- name: Import GPG key | ||
uses: crazy-max/ghaction-import-gpg@82a020f1f7f605c65dd2449b392a52c3fcfef7ef # v6.0.0 | ||
id: import_gpg | ||
with: | ||
gpg_private_key: ${{ secrets.GPG_PRIVATE_KEY }} | ||
passphrase: ${{ secrets.PASSPHRASE }} | ||
- name: Run GoReleaser | ||
uses: goreleaser/goreleaser-action@7ec5c2b0c6cdda6e8bbb49444bc797dd33d74dd8 # v5.0.0 | ||
with: | ||
args: release --clean | ||
workdir: provider | ||
env: | ||
# GitHub sets the GITHUB_TOKEN secret automatically. | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
GPG_FINGERPRINT: ${{ steps.import_gpg.outputs.fingerprint }} |