|
| 1 | +name: Release Promotion |
| 2 | + |
| 3 | +on: |
| 4 | + workflow_dispatch: |
| 5 | + inputs: |
| 6 | + commit_sha: |
| 7 | + description: 'SHA of the commit to release' |
| 8 | + type: string |
| 9 | + required: true |
| 10 | + version: |
| 11 | + description: 'Version to promote' |
| 12 | + required: true |
| 13 | + type: string |
| 14 | + |
| 15 | +jobs: |
| 16 | + crate_draft_release_notes: |
| 17 | + name: Create draft Release Notes |
| 18 | + runs-on: ubuntu-latest |
| 19 | + permissions: |
| 20 | + contents: read |
| 21 | + steps: |
| 22 | + - name: Check out repository |
| 23 | + uses: actions/checkout@v4 |
| 24 | + with: |
| 25 | + fetch-depth: '0' |
| 26 | + - name: Setup host |
| 27 | + uses: ./.github/actions/setup-ubuntu-host |
| 28 | + with: |
| 29 | + python-version: '${{ vars.PYTHON_VERSION }}' |
| 30 | + # Probably we should just download the Release Notes from the staging registry (together with other artifacts) |
| 31 | + - name: Generate Release Notes |
| 32 | + id: generate_release_notes |
| 33 | + run: python -m scripts.release.release_notes -s $INITIAL_COMMIT_SHA -v $INITIAL_VERSION -o release_notes_final.md |
| 34 | + env: |
| 35 | + INITIAL_COMMIT_SHA: ${{ vars.RELEASE_INITIAL_COMMIT_SHA }} |
| 36 | + INITIAL_VERSION: ${{ vars.RELEASE_INITIAL_VERSION }} |
| 37 | + # Add all other assets to the release notes |
| 38 | + # Put all of this in single script |
| 39 | + - name: Generate draft release |
| 40 | + run: | |
| 41 | + gh release create $VERSION --target $COMMIT_SHA --draft --prerelease --latest --notes-file release_notes_final.md --title "Release of MCK $VERSION" --fail-on-no-commits |
| 42 | + env: |
| 43 | + VERSION: ${{ github.event.inputs.version }} |
| 44 | + COMMIT_SHA: ${{ github.event.inputs.commit_sha }} |
| 45 | + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
| 46 | + |
| 47 | + approve_release: |
| 48 | + name: Approve Release |
| 49 | + environment: production |
| 50 | + runs-on: ubuntu-latest |
| 51 | + steps: |
| 52 | + - name: Create git tag |
| 53 | + run: | |
| 54 | + git tag -a $VERSION -m "Release of MCK $VERSION" |
| 55 | + git push origin $VERSION |
| 56 | + env: |
| 57 | + VERSION: ${{ github.event.inputs.version }} |
| 58 | + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
| 59 | + |
| 60 | + publish_release_notess: |
| 61 | + name: Publish Release Notes |
| 62 | + environment: production |
| 63 | + runs-on: ubuntu-latest |
| 64 | + steps: |
| 65 | + - name: Publish Release Notes |
| 66 | + run: | |
| 67 | + gh release edit $VERSION --draft=false --verify-tag |
| 68 | + env: |
| 69 | + VERSION: ${{ github.event.inputs.version }} |
| 70 | + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
0 commit comments