|
42 | 42 | pull_request: |
43 | 43 | push: |
44 | 44 | tags: |
45 | | - - "**[0-9]+.[0-9]+.[0-9]+*" |
| 45 | + - '**[0-9]+.[0-9]+.[0-9]+*' |
46 | 46 |
|
47 | 47 | jobs: |
48 | 48 | # Run 'dist plan' (or host) to determine what tasks we need to do |
@@ -211,86 +211,86 @@ jobs: |
211 | 211 | path: | |
212 | 212 | ${{ steps.cargo-dist.outputs.paths }} |
213 | 213 | ${{ env.BUILD_MANIFEST_NAME }} |
214 | | - # # Determines if we should publish/announce |
215 | | - # host: |
216 | | - # needs: |
217 | | - # - plan |
218 | | - # - build-local-artifacts |
219 | | - # - build-global-artifacts |
220 | | - # # Only run if we're "publishing", and only if local and global didn't fail (skipped is fine) |
221 | | - # if: ${{ always() && needs.plan.outputs.publishing == 'true' && (needs.build-global-artifacts.result == 'skipped' || needs.build-global-artifacts.result == 'success') && (needs.build-local-artifacts.result == 'skipped' || needs.build-local-artifacts.result == 'success') }} |
222 | | - # env: |
223 | | - # GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
224 | | - # runs-on: "ubuntu-22.04" |
225 | | - # outputs: |
226 | | - # val: ${{ steps.host.outputs.manifest }} |
227 | | - # steps: |
228 | | - # - uses: actions/checkout@v4 |
229 | | - # with: |
230 | | - # persist-credentials: false |
231 | | - # submodules: recursive |
232 | | - # - name: Install cached dist |
233 | | - # uses: actions/download-artifact@v4 |
234 | | - # with: |
235 | | - # name: cargo-dist-cache |
236 | | - # path: ~/.cargo/bin/ |
237 | | - # - run: chmod +x ~/.cargo/bin/dist |
238 | | - # # Fetch artifacts from scratch-storage |
239 | | - # - name: Fetch artifacts |
240 | | - # uses: actions/download-artifact@v4 |
241 | | - # with: |
242 | | - # pattern: artifacts-* |
243 | | - # path: target/distrib/ |
244 | | - # merge-multiple: true |
245 | | - # - id: host |
246 | | - # shell: bash |
247 | | - # run: | |
248 | | - # dist host ${{ needs.plan.outputs.tag-flag }} --steps=upload --steps=release --output-format=json > dist-manifest.json |
249 | | - # echo "artifacts uploaded and released successfully" |
250 | | - # cat dist-manifest.json |
251 | | - # echo "manifest=$(jq -c "." dist-manifest.json)" >> "$GITHUB_OUTPUT" |
252 | | - # - name: "Upload dist-manifest.json" |
253 | | - # uses: actions/upload-artifact@v4 |
254 | | - # with: |
255 | | - # # Overwrite the previous copy |
256 | | - # name: artifacts-dist-manifest |
257 | | - # path: dist-manifest.json |
258 | | - # # Create a GitHub Release while uploading all files to it |
259 | | - # - name: "Download GitHub Artifacts" |
260 | | - # uses: actions/download-artifact@v4 |
261 | | - # with: |
262 | | - # pattern: artifacts-* |
263 | | - # path: artifacts |
264 | | - # merge-multiple: true |
265 | | - # - name: Cleanup |
266 | | - # run: | |
267 | | - # # Remove the granular manifests |
268 | | - # rm -f artifacts/*-dist-manifest.json |
269 | | - # - name: Create GitHub Release |
270 | | - # env: |
271 | | - # PRERELEASE_FLAG: "${{ fromJson(steps.host.outputs.manifest).announcement_is_prerelease && '--prerelease' || '' }}" |
272 | | - # ANNOUNCEMENT_TITLE: "${{ fromJson(steps.host.outputs.manifest).announcement_title }}" |
273 | | - # ANNOUNCEMENT_BODY: "${{ fromJson(steps.host.outputs.manifest).announcement_github_body }}" |
274 | | - # RELEASE_COMMIT: "${{ github.sha }}" |
275 | | - # run: | |
276 | | - # # Write and read notes from a file to avoid quoting breaking things |
277 | | - # echo "$ANNOUNCEMENT_BODY" > $RUNNER_TEMP/notes.txt |
| 214 | + # Determines if we should publish/announce |
| 215 | + host: |
| 216 | + needs: |
| 217 | + - plan |
| 218 | + - build-local-artifacts |
| 219 | + - build-global-artifacts |
| 220 | + # Only run if we're "publishing", and only if local and global didn't fail (skipped is fine) |
| 221 | + if: ${{ always() && needs.plan.outputs.publishing == 'true' && (needs.build-global-artifacts.result == 'skipped' || needs.build-global-artifacts.result == 'success') && (needs.build-local-artifacts.result == 'skipped' || needs.build-local-artifacts.result == 'success') }} |
| 222 | + env: |
| 223 | + GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
| 224 | + runs-on: "ubuntu-22.04" |
| 225 | + outputs: |
| 226 | + val: ${{ steps.host.outputs.manifest }} |
| 227 | + steps: |
| 228 | + - uses: actions/checkout@v4 |
| 229 | + with: |
| 230 | + persist-credentials: false |
| 231 | + submodules: recursive |
| 232 | + - name: Install cached dist |
| 233 | + uses: actions/download-artifact@v4 |
| 234 | + with: |
| 235 | + name: cargo-dist-cache |
| 236 | + path: ~/.cargo/bin/ |
| 237 | + - run: chmod +x ~/.cargo/bin/dist |
| 238 | + # Fetch artifacts from scratch-storage |
| 239 | + - name: Fetch artifacts |
| 240 | + uses: actions/download-artifact@v4 |
| 241 | + with: |
| 242 | + pattern: artifacts-* |
| 243 | + path: target/distrib/ |
| 244 | + merge-multiple: true |
| 245 | + - id: host |
| 246 | + shell: bash |
| 247 | + run: | |
| 248 | + dist host ${{ needs.plan.outputs.tag-flag }} --steps=upload --steps=release --output-format=json > dist-manifest.json |
| 249 | + echo "artifacts uploaded and released successfully" |
| 250 | + cat dist-manifest.json |
| 251 | + echo "manifest=$(jq -c "." dist-manifest.json)" >> "$GITHUB_OUTPUT" |
| 252 | + - name: "Upload dist-manifest.json" |
| 253 | + uses: actions/upload-artifact@v4 |
| 254 | + with: |
| 255 | + # Overwrite the previous copy |
| 256 | + name: artifacts-dist-manifest |
| 257 | + path: dist-manifest.json |
| 258 | + # Create a GitHub Release while uploading all files to it |
| 259 | + - name: "Download GitHub Artifacts" |
| 260 | + uses: actions/download-artifact@v4 |
| 261 | + with: |
| 262 | + pattern: artifacts-* |
| 263 | + path: artifacts |
| 264 | + merge-multiple: true |
| 265 | + - name: Cleanup |
| 266 | + run: | |
| 267 | + # Remove the granular manifests |
| 268 | + rm -f artifacts/*-dist-manifest.json |
| 269 | + - name: Create GitHub Release |
| 270 | + env: |
| 271 | + PRERELEASE_FLAG: "${{ fromJson(steps.host.outputs.manifest).announcement_is_prerelease && '--prerelease' || '' }}" |
| 272 | + ANNOUNCEMENT_TITLE: "${{ fromJson(steps.host.outputs.manifest).announcement_title }}" |
| 273 | + ANNOUNCEMENT_BODY: "${{ fromJson(steps.host.outputs.manifest).announcement_github_body }}" |
| 274 | + RELEASE_COMMIT: "${{ github.sha }}" |
| 275 | + run: | |
| 276 | + # Write and read notes from a file to avoid quoting breaking things |
| 277 | + echo "$ANNOUNCEMENT_BODY" > $RUNNER_TEMP/notes.txt |
278 | 278 |
|
279 | | - # gh release create "${{ needs.plan.outputs.tag }}" --target "$RELEASE_COMMIT" $PRERELEASE_FLAG --title "$ANNOUNCEMENT_TITLE" --notes-file "$RUNNER_TEMP/notes.txt" artifacts/* |
| 279 | + gh release create "${{ needs.plan.outputs.tag }}" --target "$RELEASE_COMMIT" $PRERELEASE_FLAG --title "$ANNOUNCEMENT_TITLE" --notes-file "$RUNNER_TEMP/notes.txt" artifacts/* |
280 | 280 |
|
281 | | - # announce: |
282 | | - # needs: |
283 | | - # - plan |
284 | | - # - host |
285 | | - # # use "always() && ..." to allow us to wait for all publish jobs while |
286 | | - # # still allowing individual publish jobs to skip themselves (for prereleases). |
287 | | - # # "host" however must run to completion, no skipping allowed! |
288 | | - # if: ${{ always() && needs.host.result == 'success' }} |
289 | | - # runs-on: "ubuntu-22.04" |
290 | | - # env: |
291 | | - # GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
292 | | - # steps: |
293 | | - # - uses: actions/checkout@v4 |
294 | | - # with: |
295 | | - # persist-credentials: false |
296 | | - # submodules: recursive |
| 281 | + announce: |
| 282 | + needs: |
| 283 | + - plan |
| 284 | + - host |
| 285 | + # use "always() && ..." to allow us to wait for all publish jobs while |
| 286 | + # still allowing individual publish jobs to skip themselves (for prereleases). |
| 287 | + # "host" however must run to completion, no skipping allowed! |
| 288 | + if: ${{ always() && needs.host.result == 'success' }} |
| 289 | + runs-on: "ubuntu-22.04" |
| 290 | + env: |
| 291 | + GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
| 292 | + steps: |
| 293 | + - uses: actions/checkout@v4 |
| 294 | + with: |
| 295 | + persist-credentials: false |
| 296 | + submodules: recursive |
0 commit comments