@@ -3,7 +3,9 @@ name: Release Process
33
44on :
55 push :
6- branches : [start-release]
6+ branches :
7+ - start-release
8+ - check-release
79
810env :
911 CARGO_TERM_COLOR : always
@@ -56,76 +58,90 @@ jobs:
5658 permissions :
5759 contents : write
5860
59- # merge-release:
60- # needs:
61- # - check-release-branch
62- # - run-deep-tests
63- # - build-archives
64- # runs-on: ubuntu-24.04
65- # permissions:
66- # contents: write
67- # steps:
68- # - name: Checkout
69- # uses: actions/checkout@v4
70- # with:
71- # filter: blob:none
72- # fetch-depth: 0
73- # - name: Import Signing Key
74- # run: gpg --batch --import <<< "$GPG_PRIVATE_KEY"
75- # env:
76- # GPG_PRIVATE_KEY: ${{ secrets.GPG_PRIVATE_KEY }}
77- # - name: Merge Release
78- # run: |
79- # set -x
80-
81- # release_branch="${{ needs.check-release-branch.outputs.release_branch }}"
82- # release_tag="${{ needs.check-release-branch.outputs.release_tag }}"
83- # gpg_key_id="${{ vars.GPG_KEY_ID }}"
84-
85- # git config --global user.name "github-actions[bot]"
86- # git config --global user.email "41898282+github-actions[bot]@users.noreply.github.com"
87-
88- # git tag -asu "$gpg_key_id" -m "$release_tag" "$release_tag"
89-
90- # git checkout main
91- # git merge --ff-only "$release_branch"
92-
93- # git push origin main "$release_tag" :"$release_branch"
94-
95- # create-github-release:
96- # needs:
97- # - check-release-branch
98- # - build-archives
99- # - merge-release
100- # runs-on: ubuntu-24.04
101- # permissions:
102- # contents: write
103- # steps:
104- # - name: Download Artifacts
105- # uses: actions/download-artifact@v4
106- # with:
107- # name: release
108- # - name: List Artifacts
109- # run: ls -lR
110- # - name: Create Release
111- # uses: softprops/action-gh-release@v2
112- # with:
113- # tag_name: ${{ needs.check-release-branch.outputs.release_tag }}
114- # files: |
115- # xt-*.tar.gz
116- # SHA256SUMS
117- # body: >-
118- # **[See the xt CHANGELOG][changelog] for release information.**
119-
120-
121- # Binary releases of xt are available for Linux and macOS as
122- # attachments to this GitHub Release. They are statically linked (on
123- # Linux), or link only to the platform's standard libraries (on macOS).
124- # Before using them, review the [Installation][install] section of the
125- # xt README. Your platform may support a more robust installation
126- # mechanism.
127-
128-
129- # [changelog]: https://github.com/ahamlinman/xt/blob/main/CHANGELOG.md
130-
131- # [install]: https://github.com/ahamlinman/xt?tab=readme-ov-file#installation
61+ merge-release :
62+ needs :
63+ - check-release-branch
64+ - run-deep-tests
65+ - build-archives
66+ runs-on : ubuntu-24.04
67+ permissions :
68+ contents : write
69+ env :
70+ RELEASE_BRANCH : ${{ needs.check-release-branch.outputs.release_branch }}
71+ RELEASE_TAG : ${{ needs.check-release-branch.outputs.release_tag }}
72+ GPG_KEY_ID : ${{ vars.GPG_KEY_ID }}
73+ steps :
74+ - name : Checkout
75+ uses : actions/checkout@v4
76+ with :
77+ filter : blob:none
78+ fetch-depth : 0
79+ - name : Import Signing Key
80+ run : gpg --batch --import <<< "$GPG_PRIVATE_KEY"
81+ env :
82+ GPG_PRIVATE_KEY : ${{ secrets.GPG_PRIVATE_KEY }}
83+ - name : Merge Release
84+ run : |
85+ set -x
86+
87+ git config --global user.name "github-actions[bot]"
88+ git config --global user.email "41898282+github-actions[bot]@users.noreply.github.com"
89+
90+ git tag -asu "$GPG_KEY_ID" -m "$RELEASE_TAG" "$RELEASE_TAG"
91+
92+ git checkout main
93+ git merge --ff-only "$RELEASE_BRANCH"
94+
95+ # So far, none of the intermediate state of the release should be exposed
96+ # outside of the GitHub workflow.
97+ #
98+ # THIS STEP IS THE POINT OF NO RETURN.
99+ # IT IS THE ATOMIC MOMENT AT WHICH THE RELEASE OCCURS AND CANNOT BE REVOKED.
100+ #
101+ # Any failures after this point MUST be possible to recover from manually.
102+ # For example, the GitHub release can be cut by hand using archives uploaded
103+ # to the workflow run, and the crate can be published from a local checkout
104+ # of the tag.
105+ - name : Push Release
106+ if : ${{ github.ref == 'refs/heads/start-release' }}
107+ run : |
108+ git push --atomic origin main "$RELEASE_TAG" :"$RELEASE_BRANCH"
109+
110+ create-github-release :
111+ if : ${{ github.ref == 'refs/heads/start-release' }}
112+ needs :
113+ - check-release-branch
114+ - build-archives
115+ - merge-release
116+ runs-on : ubuntu-24.04
117+ permissions :
118+ contents : write
119+ steps :
120+ - name : Download Artifacts
121+ uses : actions/download-artifact@v4
122+ with :
123+ name : release
124+ - name : List Artifacts
125+ run : ls -lR
126+ - name : Create Release
127+ uses : softprops/action-gh-release@v2
128+ with :
129+ tag_name : ${{ needs.check-release-branch.outputs.release_tag }}
130+ files : |
131+ xt-*.tar.gz
132+ SHA256SUMS
133+ body : >-
134+ **[See the xt CHANGELOG][changelog] for release information.**
135+
136+
137+ Binary releases of xt are available for Linux and macOS as
138+ attachments to this GitHub Release. They are statically linked (on
139+ Linux), or link only to the platform's standard libraries (on macOS).
140+ Before using them, review the [Installation][install] section of the
141+ xt README. Your platform may support a more robust installation
142+ mechanism.
143+
144+
145+ [changelog]: https://github.com/ahamlinman/xt/blob/main/CHANGELOG.md
146+
147+ [install]: https://github.com/ahamlinman/xt?tab=readme-ov-file#installation
0 commit comments