···11+# This file was autogenerated by cargo-dist: https://opensource.axo.dev/cargo-dist/
22+#
13# Copyright 2022-2024, axodotdev
24# SPDX-License-Identifier: MIT or Apache-2.0
35#
···1214# title/body based on your changelogs.
13151416name: Release
1515-1617permissions:
1717- contents: write
1818+ "contents": "write"
18191920# This task will run whenever you push a git tag that looks like a version
2021# like "1.0.0", "v0.1.0-prerelease.1", "my-app/0.1.0", "releases/v1.0.0", etc.
···6263 # we specify bash to get pipefail; it guards against the `curl` command
6364 # failing. otherwise `sh` won't catch that `curl` returned non-0
6465 shell: bash
6565- run: "curl --proto '=https' --tlsv1.2 -LsSf https://github.com/axodotdev/cargo-dist/releases/download/v0.16.0/cargo-dist-installer.sh | sh"
6666+ run: "curl --proto '=https' --tlsv1.2 -LsSf https://github.com/axodotdev/cargo-dist/releases/download/v0.22.1/cargo-dist-installer.sh | sh"
6767+ - name: Cache cargo-dist
6868+ uses: actions/upload-artifact@v4
6969+ with:
7070+ name: cargo-dist-cache
7171+ path: ~/.cargo/bin/cargo-dist
6672 # sure would be cool if github gave us proper conditionals...
6773 # so here's a doubly-nested ternary-via-truthiness to try to provide the best possible
6874 # functionality based on whether this is a pull_request, and whether it's from a fork.
···111117 - uses: actions/checkout@v4
112118 with:
113119 submodules: recursive
114114- - uses: swatinem/rust-cache@v2
115115- with:
116116- key: ${{ join(matrix.targets, '-') }}
117117- cache-provider: ${{ matrix.cache_provider }}
118120 - name: Install cargo-dist
119121 run: ${{ matrix.install_dist }}
120122 # Get the dist-manifest
···166168 - uses: actions/checkout@v4
167169 with:
168170 submodules: recursive
169169- - name: Install cargo-dist
170170- shell: bash
171171- run: "curl --proto '=https' --tlsv1.2 -LsSf https://github.com/axodotdev/cargo-dist/releases/download/v0.16.0/cargo-dist-installer.sh | sh"
171171+ - name: Install cached cargo-dist
172172+ uses: actions/download-artifact@v4
173173+ with:
174174+ name: cargo-dist-cache
175175+ path: ~/.cargo/bin/
176176+ - run: chmod +x ~/.cargo/bin/cargo-dist
172177 # Get all the local artifacts for the global tasks to use (for e.g. checksums)
173178 - name: Fetch local artifacts
174179 uses: actions/download-artifact@v4
···212217 - uses: actions/checkout@v4
213218 with:
214219 submodules: recursive
215215- - name: Install cargo-dist
216216- run: "curl --proto '=https' --tlsv1.2 -LsSf https://github.com/axodotdev/cargo-dist/releases/download/v0.16.0/cargo-dist-installer.sh | sh"
220220+ - name: Install cached cargo-dist
221221+ uses: actions/download-artifact@v4
222222+ with:
223223+ name: cargo-dist-cache
224224+ path: ~/.cargo/bin/
225225+ - run: chmod +x ~/.cargo/bin/cargo-dist
217226 # Fetch artifacts from scratch-storage
218227 - name: Fetch artifacts
219228 uses: actions/download-artifact@v4
···221230 pattern: artifacts-*
222231 path: target/distrib/
223232 merge-multiple: true
224224- # This is a harmless no-op for GitHub Releases, hosting for that happens in "announce"
225233 - id: host
226234 shell: bash
227235 run: |
···235243 # Overwrite the previous copy
236244 name: artifacts-dist-manifest
237245 path: dist-manifest.json
238238-239239- # Create a GitHub Release while uploading all files to it
240240- announce:
241241- needs:
242242- - plan
243243- - host
244244- # use "always() && ..." to allow us to wait for all publish jobs while
245245- # still allowing individual publish jobs to skip themselves (for prereleases).
246246- # "host" however must run to completion, no skipping allowed!
247247- if: ${{ always() && needs.host.result == 'success' }}
248248- runs-on: "ubuntu-20.04"
249249- env:
250250- GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
251251- steps:
252252- - uses: actions/checkout@v4
253253- with:
254254- submodules: recursive
246246+ # Create a GitHub Release while uploading all files to it
255247 - name: "Download GitHub Artifacts"
256248 uses: actions/download-artifact@v4
257249 with:
···264256 rm -f artifacts/*-dist-manifest.json
265257 - name: Create GitHub Release
266258 env:
267267- PRERELEASE_FLAG: "${{ fromJson(needs.host.outputs.val).announcement_is_prerelease && '--prerelease' || '' }}"
268268- ANNOUNCEMENT_TITLE: "${{ fromJson(needs.host.outputs.val).announcement_title }}"
269269- ANNOUNCEMENT_BODY: "${{ fromJson(needs.host.outputs.val).announcement_github_body }}"
259259+ PRERELEASE_FLAG: "${{ fromJson(steps.host.outputs.manifest).announcement_is_prerelease && '--prerelease' || '' }}"
260260+ ANNOUNCEMENT_TITLE: "${{ fromJson(steps.host.outputs.manifest).announcement_title }}"
261261+ ANNOUNCEMENT_BODY: "${{ fromJson(steps.host.outputs.manifest).announcement_github_body }}"
262262+ RELEASE_COMMIT: "${{ github.sha }}"
270263 run: |
271264 # Write and read notes from a file to avoid quoting breaking things
272265 echo "$ANNOUNCEMENT_BODY" > $RUNNER_TEMP/notes.txt
273266274274- gh release create "${{ needs.plan.outputs.tag }}" --title "$ANNOUNCEMENT_TITLE" --notes-file "$RUNNER_TEMP/notes.txt" $PRERELEASE_FLAG
275275- gh release upload "${{ needs.plan.outputs.tag }}" artifacts/*
267267+ gh release create "${{ needs.plan.outputs.tag }}" --target "$RELEASE_COMMIT" $PRERELEASE_FLAG --title "$ANNOUNCEMENT_TITLE" --notes-file "$RUNNER_TEMP/notes.txt" artifacts/*
268268+269269+ announce:
270270+ needs:
271271+ - plan
272272+ - host
273273+ # use "always() && ..." to allow us to wait for all publish jobs while
274274+ # still allowing individual publish jobs to skip themselves (for prereleases).
275275+ # "host" however must run to completion, no skipping allowed!
276276+ if: ${{ always() && needs.host.result == 'success' }}
277277+ runs-on: "ubuntu-20.04"
278278+ env:
279279+ GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
280280+ steps:
281281+ - uses: actions/checkout@v4
282282+ with:
283283+ submodules: recursive
+7-3
Cargo.toml
···3636# Config for 'cargo dist'
3737[workspace.metadata.dist]
3838# The preferred cargo-dist version to use in CI (Cargo.toml SemVer syntax)
3939-cargo-dist-version = "0.28.0"
3939+cargo-dist-version = "0.22.1"
4040# CI backends to support
4141ci = "github"
4242# The installers to generate for each app
4343-installers = []
4343+installers = ["shell"]
4444# Target platforms to build apps for (Rust target-triple syntax)
4545targets = ["aarch64-apple-darwin", "x86_64-apple-darwin", "x86_64-unknown-linux-gnu", "x86_64-pc-windows-msvc"]
4646-# Publish jobs to run in CI
4646+# Which actions to run on pull requests
4747pr-run-mode = "plan"
4848+# Path that installers should place binaries in
4949+install-path = "CARGO_HOME"
5050+# Whether to install an updater program
5151+install-updater = false