|
| 1 | +name: Prepare for a release |
| 2 | + |
| 3 | +on: |
| 4 | + push: |
| 5 | + tags: release-\d+.\d+.\d+ |
| 6 | + |
| 7 | +concurrency: prepare-for-a-release |
| 8 | + |
| 9 | +jobs: |
| 10 | + # all tasks that need to be done before we add an X.Y.Z tag |
| 11 | + # should be done as a step in the pre-tagging job. |
| 12 | + # think of it like this... if when you later checkout the tag for a release, |
| 13 | + # should the change be there? if yes, do it here. |
| 14 | + pre-tagging: |
| 15 | + name: Tasks run before tagging the release |
| 16 | + runs-on: ubuntu-latest |
| 17 | + steps: |
| 18 | + - name: Checkout main |
| 19 | + uses: actions/checkout@v2 |
| 20 | + with: |
| 21 | + ref: "main" |
| 22 | + token: ${{ secrets.RELEASE_TOKEN }} |
| 23 | + - name: Update CHANGELOG.md |
| 24 | + |
| 25 | + with: |
| 26 | + entrypoint: update-changelog-for-release |
| 27 | + env: |
| 28 | + GIT_USER_NAME: "Ponylang Main Bot" |
| 29 | + GIT_USER_EMAIL: "[email protected]" |
| 30 | + - name: Update VERSION |
| 31 | + |
| 32 | + with: |
| 33 | + entrypoint: update-version-in-VERSION |
| 34 | + env: |
| 35 | + GIT_USER_NAME: "Ponylang Main Bot" |
| 36 | + GIT_USER_EMAIL: "[email protected]" |
| 37 | + - name: Update version in README |
| 38 | + |
| 39 | + with: |
| 40 | + entrypoint: update-version-in-README |
| 41 | + env: |
| 42 | + GIT_USER_NAME: "Ponylang Main Bot" |
| 43 | + GIT_USER_EMAIL: "[email protected]" |
| 44 | + - name: Update corral.json |
| 45 | + |
| 46 | + with: |
| 47 | + entrypoint: update-version-in-corral-json |
| 48 | + env: |
| 49 | + GIT_USER_NAME: "Ponylang Main Bot" |
| 50 | + GIT_USER_EMAIL: "[email protected]" |
| 51 | + |
| 52 | + # tag for release |
| 53 | + # this will kick off the next stage of the release process |
| 54 | + # no additional steps should be added to this job |
| 55 | + tag-release: |
| 56 | + name: Tag the release |
| 57 | + needs: |
| 58 | + - pre-tagging |
| 59 | + runs-on: ubuntu-latest |
| 60 | + steps: |
| 61 | + - name: Checkout main |
| 62 | + uses: actions/checkout@v2 |
| 63 | + with: |
| 64 | + ref: "main" |
| 65 | + token: ${{ secrets.RELEASE_TOKEN }} |
| 66 | + - name: Trigger artefact creation |
| 67 | + |
| 68 | + with: |
| 69 | + entrypoint: trigger-artefact-creation |
| 70 | + env: |
| 71 | + GIT_USER_NAME: "Ponylang Main Bot" |
| 72 | + GIT_USER_EMAIL: "[email protected]" |
| 73 | + |
| 74 | + # all cleanup tags that should happen after tagging for release should happen |
| 75 | + # in the post-tagging job. examples of things you might do: |
| 76 | + # add a new unreleased section to a changelog |
| 77 | + # set a version back to "snapshot" |
| 78 | + # in general, post-tagging is for "going back to normal" from tasks that were |
| 79 | + # done during the pre-tagging job |
| 80 | + post-tagging: |
| 81 | + name: Tasks run after tagging the release |
| 82 | + needs: |
| 83 | + - tag-release |
| 84 | + runs-on: ubuntu-latest |
| 85 | + steps: |
| 86 | + - name: Checkout main |
| 87 | + uses: actions/checkout@v2 |
| 88 | + with: |
| 89 | + ref: "main" |
| 90 | + token: ${{ secrets.RELEASE_TOKEN }} |
| 91 | + - name: Add "unreleased" section to CHANGELOG.md |
| 92 | + |
| 93 | + with: |
| 94 | + entrypoint: add-unreleased-section-to-changelog |
| 95 | + env: |
| 96 | + GIT_USER_NAME: "Ponylang Main Bot" |
| 97 | + GIT_USER_EMAIL: "[email protected]" |
0 commit comments