Release #91
This file contains hidden or 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: "Release" | |
| on: | |
| workflow_dispatch: | |
| inputs: | |
| version: | |
| description: tag the latest commit on main with the given version (prefixed with v) | |
| required: true | |
| bypassQualityGate: | |
| description: bypass the quality gate check | |
| required: false | |
| default: false | |
| type: boolean | |
| permissions: | |
| contents: read | |
| jobs: | |
| quality-gate: | |
| environment: release | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd #v6.0.2 | |
| with: | |
| persist-credentials: false | |
| - name: Check if tag already exists | |
| # note: this will fail if the tag already exists | |
| env: | |
| VERSION: ${{ github.event.inputs.version }} | |
| run: | | |
| [[ "$VERSION" == v* ]] || (echo "version '$VERSION' does not have a 'v' prefix" && exit 1) | |
| git tag $VERSION | |
| - name: Check static analysis results | |
| uses: fountainhead/action-wait-for-check@5a908a24814494009c4bb27c242ea38c93c593be #v1.2.0 | |
| id: static-analysis | |
| if: ${{ github.event.inputs.bypassQualityGate != 'true' }} | |
| with: | |
| token: ${{ secrets.GITHUB_TOKEN }} | |
| # This check name is defined as the github action job name (in .github/workflows/validations.yaml) | |
| checkName: "Static analysis" | |
| ref: ${{ github.event.pull_request.head.sha || github.sha }} | |
| - name: Check unit test results (go) | |
| uses: fountainhead/action-wait-for-check@5a908a24814494009c4bb27c242ea38c93c593be #v1.2.0 | |
| id: unit-go | |
| if: ${{ github.event.inputs.bypassQualityGate != 'true' }} | |
| with: | |
| token: ${{ secrets.GITHUB_TOKEN }} | |
| # This check name is defined as the github action job name (in .github/workflows/validations.yaml) | |
| checkName: "Unit tests (Go)" | |
| ref: ${{ github.event.pull_request.head.sha || github.sha }} | |
| - name: Check unit test results (python) | |
| uses: fountainhead/action-wait-for-check@5a908a24814494009c4bb27c242ea38c93c593be #v1.2.0 | |
| id: unit-python | |
| if: ${{ github.event.inputs.bypassQualityGate != 'true' }} | |
| with: | |
| token: ${{ secrets.GITHUB_TOKEN }} | |
| # This check name is defined as the github action job name (in .github/workflows/validations.yaml) | |
| checkName: "Unit tests (Python)" | |
| ref: ${{ github.event.pull_request.head.sha || github.sha }} | |
| - name: Check cli test results (go-linux) | |
| uses: fountainhead/action-wait-for-check@5a908a24814494009c4bb27c242ea38c93c593be #v1.2.0 | |
| id: cli-go-linux | |
| if: ${{ github.event.inputs.bypassQualityGate != 'true' }} | |
| with: | |
| token: ${{ secrets.GITHUB_TOKEN }} | |
| # This check name is defined as the github action job name (in .github/workflows/validations.yaml) | |
| checkName: "CLI tests (Go-Linux)" | |
| ref: ${{ github.event.pull_request.head.sha || github.sha }} | |
| - name: Check cli test results (python) | |
| uses: fountainhead/action-wait-for-check@5a908a24814494009c4bb27c242ea38c93c593be #v1.2.0 | |
| id: cli-python | |
| if: ${{ github.event.inputs.bypassQualityGate != 'true' }} | |
| with: | |
| token: ${{ secrets.GITHUB_TOKEN }} | |
| # This check name is defined as the github action job name (in .github/workflows/validations.yaml) | |
| checkName: "CLI tests (Python)" | |
| ref: ${{ github.event.pull_request.head.sha || github.sha }} | |
| - name: Check acceptance test results | |
| uses: fountainhead/action-wait-for-check@5a908a24814494009c4bb27c242ea38c93c593be #v1.2.0 | |
| id: acceptance | |
| if: ${{ github.event.inputs.bypassQualityGate != 'true' }} | |
| with: | |
| token: ${{ secrets.GITHUB_TOKEN }} | |
| # This check name is defined as the github action job name (in .github/workflows/validations.yaml) | |
| checkName: "DB acceptance tests" | |
| ref: ${{ github.event.pull_request.head.sha || github.sha }} | |
| - name: Quality gate | |
| if: (steps.static-analysis.outputs.conclusion != 'success' || steps.unit-go.outputs.conclusion != 'success' || steps.cli-go-linux.outputs.conclusion != 'success' || steps.unit-python.outputs.conclusion != 'success' || steps.cli-python.outputs.conclusion != 'success' || steps.acceptance.outputs.conclusion != 'success') && github.event.inputs.bypassQualityGate != 'true' | |
| env: | |
| STATIC_ANALYSIS_STATUS: ${{ steps.static-analysis.outputs.conclusion }} | |
| GO_UNIT_STATUS: ${{ steps.unit-go.outputs.conclusion }} | |
| PYTHON_UNIT_STATUS: ${{ steps.unit-python.outputs.conclusion }} | |
| GO_CLI_LINUX_STATUS: ${{ steps.cli-go-linux.outputs.conclusion }} | |
| PYTHON_CLI_STATUS: ${{ steps.cli-python.outputs.conclusion }} | |
| ACCEPTANCE_STATUS: ${{ steps.acceptance.outputs.conclusion }} | |
| run: | | |
| echo "Static Analysis Status: $STATIC_ANALYSIS_STATUS" | |
| echo "Go Unit Test Status: $GO_UNIT_STATUS" | |
| echo "Python Unit Test Status: $PYTHON_UNIT_STATUS" | |
| echo "Go CLI Test (Linux) Status: $GO_CLI_LINUX_STATUS" | |
| echo "Python CLI Test Status: $PYTHON_CLI_STATUS" | |
| echo "DB Acceptance Test Status: $ACCEPTANCE_STATUS" | |
| false | |
| release: | |
| needs: | |
| - quality-gate | |
| if: always() && (needs.quality-gate.result == 'success' || needs.quality-gate.result == 'skipped') | |
| permissions: | |
| contents: write | |
| packages: write | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd #v6.0.2 | |
| with: | |
| # we need to persist credentials so that we can push the tag | |
| persist-credentials: true | |
| fetch-depth: 0 | |
| - name: Bootstrap environment | |
| uses: ./.github/actions/bootstrap | |
| with: | |
| # use the same cache we used for building snapshots | |
| build-cache-key-prefix: "snapshot" | |
| python: false | |
| - name: Tag release | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| VERSION: ${{ github.event.inputs.version }} | |
| run: | | |
| git tag $VERSION | |
| git push origin --tags | |
| - name: Build release artifacts | |
| run: make ci-release | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |