|
49 | 49 | - name: Checkout repository |
50 | 50 | uses: actions/checkout@v4 |
51 | 51 | with: |
| 52 | + fetch-depth: 0 |
52 | 53 | token: ${{ secrets.RERUN_BOT_TOKEN }} |
53 | 54 |
|
54 | 55 | - name: Set up Python |
|
58 | 59 |
|
59 | 60 | - name: Install deps |
60 | 61 | run: | |
61 | | - python3 -m pip install -r ./scripts/ci/requirements.txt |
| 62 | + python3 -m pip install -r ./scripts/ci/requirements-crates.txt |
| 63 | +
|
| 64 | + # for `taplo fmt` done in `crates.py version --bump` |
| 65 | + - name: Install taplo-cli |
| 66 | + uses: taiki-e/install-action@v2 |
| 67 | + with: |
| 68 | + tool: taplo-cli |
62 | 69 |
|
63 | 70 | - name: Update crate versions |
64 | 71 | id: versioning |
@@ -112,6 +119,44 @@ jobs: |
112 | 119 | git push |
113 | 120 | echo "version_bump_commit_sha=$(git rev-parse HEAD)" >> "$GITHUB_OUTPUT" |
114 | 121 |
|
| 122 | + - name: Create pull request |
| 123 | + env: |
| 124 | + GH_TOKEN: ${{ secrets.RERUN_BOT_TOKEN }} |
| 125 | + run: | |
| 126 | + set +e |
| 127 | + pr=$(gh pr view --json headRefName 2>/dev/null || echo "{}") |
| 128 | + if echo "$pr" | jq '. | has("headRefName")' | grep -q 'true'; then |
| 129 | + echo "PR already exists" |
| 130 | + exit 0 |
| 131 | + fi |
| 132 | + set -e |
| 133 | +
|
| 134 | + echo "PR does not exist, creating…" |
| 135 | +
|
| 136 | + cat <<EOF > pr-body.txt |
| 137 | + ### Next steps |
| 138 | + - Test the release |
| 139 | + - If this is an `alpha` release, you can just merge the pull request. |
| 140 | + - Otherwise: |
| 141 | + - For any added commits, run the release workflow in `rc` mode again |
| 142 | + - After testing, run the release workflow in `release` mode |
| 143 | + - Once the final release workflow finishes, [create a GitHub release](https://github.com/rerun-io/rerun/releases/new) |
| 144 | +
|
| 145 | + - [ ] Tests |
| 146 | + - [ ] Windows |
| 147 | + - [ ] Linux |
| 148 | + - [ ] MacOS |
| 149 | + EOF |
| 150 | +
|
| 151 | + gh pr create \ |
| 152 | + --base main \ |
| 153 | + --head $(git branch --show-current) \ |
| 154 | + --title "Release ${{ (inputs.release-type == 'alpha' && steps.versioning.outputs.current) || steps.versioning.outputs.final }}" \ |
| 155 | + --label "⛴ release" \ |
| 156 | + --label "exclude from changelog" \ |
| 157 | + --fill \ |
| 158 | + --body-file pr-body.txt |
| 159 | +
|
115 | 160 | update-docs: |
116 | 161 | name: "Update Docs" |
117 | 162 | needs: [version] |
@@ -176,40 +221,92 @@ jobs: |
176 | 221 | git push --force origin ${{ github.ref_name }}:latest |
177 | 222 |
|
178 | 223 | post-release-version-bump: |
179 | | - name: "Post-release Version Bump" |
180 | | - if: inputs.release-type == 'final' |
| 224 | + name: "Post-Release Version Bump" |
| 225 | + if: inputs.release-type == 'alpha' || inputs.release-type == 'final' |
181 | 226 | needs: [version, update-docs, publish-crates, build-and-publish-wheels, build-and-publish-web] |
182 | 227 | runs-on: ubuntu-latest |
183 | 228 | steps: |
184 | 229 | - name: Checkout repository |
185 | 230 | uses: actions/checkout@v4 |
186 | 231 | with: |
187 | | - ref: main |
| 232 | + token: ${{ secrets.RERUN_BOT_TOKEN }} |
188 | 233 |
|
189 | 234 | - name: Install dependencies |
190 | 235 | run: | |
191 | | - python3 -m pip install -r scripts/ci/requirements.txt |
| 236 | + python3 -m pip install -r scripts/ci/requirements-crates.txt |
| 237 | +
|
| 238 | + # for `taplo fmt` done in `crates.py version --bump` |
| 239 | + - name: Install taplo-cli |
| 240 | + uses: taiki-e/install-action@v2 |
| 241 | + with: |
| 242 | + tool: taplo-cli |
192 | 243 |
|
193 | | - # After a release, we bump the minor version and append `+dev`. |
194 | 244 | - name: Update version |
195 | 245 | id: update-version |
196 | 246 | run: | |
197 | | - python3 scripts/ci/crates.py version --bump minor --dev |
198 | | - echo "version=$(python3 scripts/ci/crates.py get-version)" >> "$GITHUB_OUTPUT" |
| 247 | + if [ ${{ inputs.release-type }} = "final" ]; then |
| 248 | + # After a final release, we bump the minor version and append `+dev`. |
| 249 | + python3 scripts/ci/crates.py version --bump prerelease --dev --pre-id=alpha |
| 250 | + echo "version=$(python3 scripts/ci/crates.py get-version)" >> "$GITHUB_OUTPUT" |
| 251 | + else |
| 252 | + # After an alpha release, we bump the prerelease version and append `+dev`. |
| 253 | + python3 scripts/ci/crates.py version --bump minor |
| 254 | + python3 scripts/ci/crates.py version --bump prerelease --dev --pre-id=alpha |
| 255 | + echo "version=$(python3 scripts/ci/crates.py get-version)" >> "$GITHUB_OUTPUT" |
| 256 | + fi |
199 | 257 |
|
200 | | - - name: Create pull request |
201 | | - uses: peter-evans/create-pull-request@v5.0.2 |
| 258 | + - name: Commit new version |
| 259 | + run: | |
| 260 | + git config --global user.name "rerun-bot" |
| 261 | + git config --global user.email "bot@rerun.io" |
| 262 | + git commit -am "Bump versions to ${{ steps.update-version.outputs.version }}" |
| 263 | + git push |
| 264 | +
|
| 265 | + comment-artifact-links: |
| 266 | + name: "Link to artifacts" |
| 267 | + needs: [version, update-docs, publish-crates, build-and-publish-wheels, build-and-publish-web] |
| 268 | + runs-on: ubuntu-latest |
| 269 | + steps: |
| 270 | + - name: Checkout repository |
| 271 | + uses: actions/checkout@v4 |
202 | 272 | with: |
| 273 | + fetch-depth: 0 |
203 | 274 | token: ${{ secrets.RERUN_BOT_TOKEN }} |
204 | | - base: main |
205 | | - branch: "post-${{ github.ref_name }}" |
206 | | - commit-message: "bump versions to ${{ steps.update-version.outputs.version }}" |
207 | | - title: "Post-release ${{ needs.version.outputs.final }}" |
208 | | - labels: "⛴ release" |
209 | | - committer: "Rerun Bot <bot@rerun.io>" |
210 | | - author: "Rerun Bot <bot@rerun.io>" |
211 | | - body: | |
212 | | - ### What |
213 | | -
|
214 | | - - [x] Bump all crate versions to `${{ steps.update-version.outputs.version }}` |
| 275 | + |
| 276 | + - name: Create comment |
| 277 | + env: |
| 278 | + GH_TOKEN: ${{ secrets.RERUN_BOT_TOKEN }} |
| 279 | + run: | |
| 280 | + pr_number=$(gh pr view --json number | jq '.number') |
| 281 | +
|
| 282 | + if [ ${{ inputs.release-type }} = "final" ]; then |
| 283 | + web_app_link="https://app.rerun.io/version/${{ needs.version.outputs.final }}" |
| 284 | + rerun_io_docs_link="https://rerun.io/docs" |
| 285 | + py_docs_link="https://ref.rerun.io/docs/python/${{ needs.version.outputs.final }}" |
| 286 | + else |
| 287 | + web_app_link="https://app.rerun.io/commit/${{ needs.version.outputs.release-commit }}" |
| 288 | + rerun_io_docs_link="https://rerun.io/preview/${{ needs.version.outputs.release-commit }}/docs" |
| 289 | + py_docs_link="https://ref.rerun.io/docs/python/dev" |
| 290 | + fi |
| 291 | + wheels_link="https://pypi.org/project/rerun-sdk/${{ needs.version.outputs.current }}" |
| 292 | + crates_link="https://crates.io/crates/rerun/${{ needs.version.outputs.current }}" |
| 293 | + rs_docs_link="https://docs.rs/rerun/${{ needs.version.outputs.current }}" |
| 294 | +
|
| 295 | + pip_install="pip install rerun-sdk==${{ needs.version.outputs.current }}" |
| 296 | + cargo_install="cargo install rerun-cli@${{ needs.version.outputs.current }}" |
| 297 | +
|
| 298 | + cat <<EOF > comment-body.txt |
| 299 | + Version ${{ needs.version.outputs.current }} published sucessfully. |
| 300 | +
|
| 301 | + | artifact | install | |
| 302 | + | --------------------------- | -------------- | |
| 303 | + | [web app]($web_app_link) | | |
| 304 | + | [wheels]($wheels_link) | $pip_install | |
| 305 | + | [crates]($crates_link) | $cargo_install | |
| 306 | + | [docs]($rerun_io_docs_link) | | |
| 307 | + | [py docs]($py_docs_link) | | |
| 308 | + | [rs docs]($rs_docs_link) | | |
| 309 | + EOF |
| 310 | +
|
| 311 | + gh pr comment $pr_number --body-file comment-body.txt --edit-last |
215 | 312 |
|
0 commit comments