Release v1.15.1 #112
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
name: 'New Release' | |
run-name: 'Release ${{ inputs.version_number }}' | |
# Used for creating a new release. This workflow will run qa acceptance tests, create a new tag, and generate the release with GoReleaser. | |
on: | |
workflow_dispatch: | |
inputs: | |
version_number: | |
description: 'Version number (e.g., v1.0.0, v1.0.0-pre, v1.0.0-pre1)' | |
required: true | |
skip_tests: | |
description: 'Skip QA acceptance tests, define value to `true` to explicitly skip' | |
jobs: | |
validate-version-input: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Validation of version format | |
run: | | |
echo "${{ inputs.version_number }}" | grep -P '^v\d+\.\d+\.\d+(-pre[A-Za-z0-9-]*)?$' | |
# QA acceptance tests are skipped when explicit input parameter is used | |
run-qa-acceptance-tests: | |
needs: [ validate-version-input ] | |
if: needs.validate-version-input.result == 'success' && inputs.skip_tests != 'true' | |
secrets: inherit | |
uses: ./.github/workflows/acceptance-tests.yml | |
with: | |
atlas_cloud_env: "qa" | |
release: | |
runs-on: ubuntu-latest | |
needs: [ validate-version-input, run-qa-acceptance-tests ] | |
if: ${{ always() && needs.validate-version-input.result == 'success' && (needs.run-qa-acceptance-tests.result == 'skipped' || needs.run-qa-acceptance-tests.result == 'success') }} | |
steps: | |
- name: Checkout | |
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 | |
- name: Unshallow | |
run: git fetch --prune --unshallow | |
- name: Create release tag | |
uses: rickstaa/action-create-tag@a1c7777fcb2fee4f19b0f283ba888afa11678b72 # will fail if existing tag is present | |
with: | |
tag: ${{ inputs.version_number }} | |
- name: Set up Go | |
uses: actions/setup-go@0c52d547c9bc32b1aa3301fd7a9cb496313a4491 | |
with: | |
go-version-file: 'go.mod' | |
- name: Import GPG key | |
id: import_gpg | |
uses: crazy-max/ghaction-import-gpg@01dd5d3ca463c7f10f7f4f7b4f177225ac661ee4 | |
with: | |
gpg_private_key: ${{ secrets.GPG_PRIVATE_KEY }} | |
passphrase: ${{ secrets.PASSPHRASE }} | |
- name: Set the user terminal | |
run: export GPG_TTY=$(tty) | |
- name: Run GoReleaser | |
uses: goreleaser/goreleaser-action@7ec5c2b0c6cdda6e8bbb49444bc797dd33d74dd8 | |
with: | |
version: latest | |
args: release --rm-dist | |
env: | |
GPG_FINGERPRINT: ${{ steps.import_gpg.outputs.fingerprint }} | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |