-
Notifications
You must be signed in to change notification settings - Fork 169
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: Improve the release process (#1380)
- Loading branch information
1 parent
a7c4fdc
commit 0ec0dfa
Showing
4 changed files
with
54 additions
and
33 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
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 |
---|---|---|
|
@@ -4,31 +4,55 @@ on: | |
tags: | ||
- 'v*' | ||
jobs: | ||
# Check that the last run of the acceptance tests was successful | ||
# We run the acceptance tests only if the last run of the sceduled workflow failed | ||
check-acceptance-tests-status: | ||
runs-on: ubuntu-latest | ||
outputs: | ||
acceptance_tests_status: ${{ steps.lastJobStatus.outputs.test }} | ||
steps: | ||
- name: Check last job status | ||
id: lastJobStatus | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
run: | | ||
LAST_JOB_STATUS=$(gh run list --workflow acceptance-tests.yml |grep -oh "completed.*" | grep -h "schedule.*" | head -1 | awk '{print $2}') | ||
echo "acceptanceTestsStatus=${LAST_JOB_STATUS}" >> $GITHUB_OUTPUT | ||
# We run the acceptance tests only if the last run of the sceduled workflow failed | ||
run-accettance-tests-workflow: | ||
needs: [ check-acceptance-tests-status ] | ||
if: ${{ needs.check-acceptance-tests-status.outputs.acceptance_tests_status != 'success'}} | ||
secrets: inherit | ||
permissions: | ||
contents: write | ||
pull-requests: read | ||
repository-projects: read | ||
uses: ./.github/workflows/acceptance-tests.yml | ||
with: | ||
parent-event-name: 'release' | ||
# Release the provider | ||
goreleaser: | ||
runs-on: ubuntu-latest | ||
needs: [ check-acceptance-tests-status, run-accettance-tests-workflow ] | ||
if: always() && !cancelled() && !failure() | ||
steps: | ||
- | ||
name: Checkout | ||
- name: Checkout | ||
uses: actions/checkout@v3 | ||
- | ||
name: Unshallow | ||
- name: Unshallow | ||
run: git fetch --prune --unshallow | ||
- | ||
name: Set up Go | ||
- name: Set up Go | ||
uses: actions/setup-go@v4 | ||
with: | ||
go-version-file: 'go.mod' | ||
- | ||
name: Import GPG key | ||
- name: Import GPG key | ||
id: import_gpg | ||
uses: paultyng/[email protected] | ||
env: | ||
GPG_PRIVATE_KEY: ${{ secrets.GPG_PRIVATE_KEY }} | ||
PASSPHRASE: ${{ secrets.PASSPHRASE }} | ||
- name: Set the user terminal | ||
run: export GPG_TTY=$(tty) | ||
- | ||
name: Run GoReleaser | ||
- name: Run GoReleaser | ||
uses: goreleaser/goreleaser-action@v4 | ||
with: | ||
version: latest | ||
|
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
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