Skip to content

Commit 4a82cd0

Browse files
committed
ci: update cargo-dist version
1 parent 24045bc commit 4a82cd0

File tree

3 files changed

+50
-47
lines changed

3 files changed

+50
-47
lines changed

.github/workflows/release.yml

Lines changed: 25 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
1-
# This file was autogenerated by cargo-dist: https://opensource.axo.dev/cargo-dist/
1+
# This file was autogenerated by dist: https://opensource.axo.dev/cargo-dist/
22
#
33
# Copyright 2022-2024, axodotdev
44
# SPDX-License-Identifier: MIT or Apache-2.0
55
#
66
# CI that:
77
#
88
# * checks for a Git Tag that looks like a release
9-
# * builds artifacts with cargo-dist (archives, installers, hashes)
9+
# * builds artifacts with dist (archives, installers, hashes)
1010
# * uploads those artifacts to temporary workflow zip
1111
# * on success, uploads the artifacts to a GitHub Release
1212
#
@@ -24,10 +24,10 @@ permissions:
2424
# must be a Cargo-style SemVer Version (must have at least major.minor.patch).
2525
#
2626
# If PACKAGE_NAME is specified, then the announcement will be for that
27-
# package (erroring out if it doesn't have the given version or isn't cargo-dist-able).
27+
# package (erroring out if it doesn't have the given version or isn't dist-able).
2828
#
2929
# If PACKAGE_NAME isn't specified, then the announcement will be for all
30-
# (cargo-dist-able) packages in the workspace with that version (this mode is
30+
# (dist-able) packages in the workspace with that version (this mode is
3131
# intended for workspaces with only one dist-able package, or with all dist-able
3232
# packages versioned/released in lockstep).
3333
#
@@ -39,12 +39,13 @@ permissions:
3939
# If there's a prerelease-style suffix to the version, then the release(s)
4040
# will be marked as a prerelease.
4141
on:
42+
pull_request:
4243
push:
4344
tags:
4445
- '**[0-9]+.[0-9]+.[0-9]+*'
4546

4647
jobs:
47-
# Run 'cargo dist plan' (or host) to determine what tasks we need to do
48+
# Run 'dist plan' (or host) to determine what tasks we need to do
4849
plan:
4950
runs-on: "ubuntu-20.04"
5051
outputs:
@@ -58,25 +59,25 @@ jobs:
5859
- uses: actions/checkout@v4
5960
with:
6061
submodules: recursive
61-
- name: Install cargo-dist
62+
- name: Install dist
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
65-
run: "curl --proto '=https' --tlsv1.2 -LsSf https://github.com/axodotdev/cargo-dist/releases/download/v0.22.1/cargo-dist-installer.sh | sh"
66-
- name: Cache cargo-dist
66+
run: "curl --proto '=https' --tlsv1.2 -LsSf https://github.com/axodotdev/cargo-dist/releases/download/v0.25.1/cargo-dist-installer.sh | sh"
67+
- name: Cache dist
6768
uses: actions/upload-artifact@v4
6869
with:
6970
name: cargo-dist-cache
70-
path: ~/.cargo/bin/cargo-dist
71+
path: ~/.cargo/bin/dist
7172
# sure would be cool if github gave us proper conditionals...
7273
# so here's a doubly-nested ternary-via-truthiness to try to provide the best possible
7374
# functionality based on whether this is a pull_request, and whether it's from a fork.
7475
# (PRs run on the *source* but secrets are usually on the *target* -- that's *good*
7576
# but also really annoying to build CI around when it needs secrets to work right.)
7677
- id: plan
7778
run: |
78-
cargo dist ${{ (!github.event.pull_request && format('host --steps=create --tag={0}', github.ref_name)) || 'plan' }} --output-format=json > plan-dist-manifest.json
79-
echo "cargo dist ran successfully"
79+
dist ${{ (!github.event.pull_request && format('host --steps=create --tag={0}', github.ref_name)) || 'plan' }} --output-format=json > plan-dist-manifest.json
80+
echo "dist ran successfully"
8081
cat plan-dist-manifest.json
8182
echo "manifest=$(jq -c "." plan-dist-manifest.json)" >> "$GITHUB_OUTPUT"
8283
- name: "Upload dist-manifest.json"
@@ -94,12 +95,12 @@ jobs:
9495
if: ${{ fromJson(needs.plan.outputs.val).ci.github.artifacts_matrix.include != null && (needs.plan.outputs.publishing == 'true' || fromJson(needs.plan.outputs.val).ci.github.pr_run_mode == 'upload') }}
9596
strategy:
9697
fail-fast: false
97-
# Target platforms/runners are computed by cargo-dist in create-release.
98+
# Target platforms/runners are computed by dist in create-release.
9899
# Each member of the matrix has the following arguments:
99100
#
100101
# - runner: the github runner
101-
# - dist-args: cli flags to pass to cargo dist
102-
# - install-dist: expression to run to install cargo-dist on the runner
102+
# - dist-args: cli flags to pass to dist
103+
# - install-dist: expression to run to install dist on the runner
103104
#
104105
# Typically there will be:
105106
# - 1 "global" task that builds universal installers
@@ -116,7 +117,7 @@ jobs:
116117
- uses: actions/checkout@v4
117118
with:
118119
submodules: recursive
119-
- name: Install cargo-dist
120+
- name: Install dist
120121
run: ${{ matrix.install_dist }}
121122
# Get the dist-manifest
122123
- name: Fetch local artifacts
@@ -131,8 +132,8 @@ jobs:
131132
- name: Build artifacts
132133
run: |
133134
# Actually do builds and make zips and whatnot
134-
cargo dist build ${{ needs.plan.outputs.tag-flag }} --print=linkage --output-format=json ${{ matrix.dist_args }} > dist-manifest.json
135-
echo "cargo dist ran successfully"
135+
dist build ${{ needs.plan.outputs.tag-flag }} --print=linkage --output-format=json ${{ matrix.dist_args }} > dist-manifest.json
136+
echo "dist ran successfully"
136137
- id: cargo-dist
137138
name: Post-build
138139
# We force bash here just because github makes it really hard to get values up
@@ -167,12 +168,12 @@ jobs:
167168
- uses: actions/checkout@v4
168169
with:
169170
submodules: recursive
170-
- name: Install cached cargo-dist
171+
- name: Install cached dist
171172
uses: actions/download-artifact@v4
172173
with:
173174
name: cargo-dist-cache
174175
path: ~/.cargo/bin/
175-
- run: chmod +x ~/.cargo/bin/cargo-dist
176+
- run: chmod +x ~/.cargo/bin/dist
176177
# Get all the local artifacts for the global tasks to use (for e.g. checksums)
177178
- name: Fetch local artifacts
178179
uses: actions/download-artifact@v4
@@ -183,8 +184,8 @@ jobs:
183184
- id: cargo-dist
184185
shell: bash
185186
run: |
186-
cargo dist build ${{ needs.plan.outputs.tag-flag }} --output-format=json "--artifacts=global" > dist-manifest.json
187-
echo "cargo dist ran successfully"
187+
dist build ${{ needs.plan.outputs.tag-flag }} --output-format=json "--artifacts=global" > dist-manifest.json
188+
echo "dist ran successfully"
188189
189190
# Parse out what we just built and upload it to scratch storage
190191
echo "paths<<EOF" >> "$GITHUB_OUTPUT"
@@ -216,12 +217,12 @@ jobs:
216217
- uses: actions/checkout@v4
217218
with:
218219
submodules: recursive
219-
- name: Install cached cargo-dist
220+
- name: Install cached dist
220221
uses: actions/download-artifact@v4
221222
with:
222223
name: cargo-dist-cache
223224
path: ~/.cargo/bin/
224-
- run: chmod +x ~/.cargo/bin/cargo-dist
225+
- run: chmod +x ~/.cargo/bin/dist
225226
# Fetch artifacts from scratch-storage
226227
- name: Fetch artifacts
227228
uses: actions/download-artifact@v4
@@ -232,7 +233,7 @@ jobs:
232233
- id: host
233234
shell: bash
234235
run: |
235-
cargo dist host ${{ needs.plan.outputs.tag-flag }} --steps=upload --steps=release --output-format=json > dist-manifest.json
236+
dist host ${{ needs.plan.outputs.tag-flag }} --steps=upload --steps=release --output-format=json > dist-manifest.json
236237
echo "artifacts uploaded and released successfully"
237238
cat dist-manifest.json
238239
echo "manifest=$(jq -c "." dist-manifest.json)" >> "$GITHUB_OUTPUT"

Cargo.toml

Lines changed: 0 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -61,29 +61,6 @@ tempfile = "3"
6161
# unnecessary-cast = "allow"
6262
# useless-transmute = "allow"
6363

64-
# Config for 'cargo dist'
65-
[workspace.metadata.dist]
66-
# The preferred cargo-dist version to use in CI (Cargo.toml SemVer syntax)
67-
cargo-dist-version = "0.22.1"
68-
# CI backends to support
69-
ci = "github"
70-
# The installers to generate for each app
71-
installers = ["shell"]
72-
# Target platforms to build apps for (Rust target-triple syntax)
73-
targets = ["aarch64-apple-darwin", "x86_64-apple-darwin", "x86_64-unknown-linux-gnu"]
74-
# Whether to consider the binaries in a package for distribution (defaults true)
75-
dist = false
76-
# Which actions to run on pull requests
77-
pr-run-mode = "plan"
78-
# Whether to install an updater program
79-
install-updater = false
80-
# Path that installers should place binaries in
81-
install-path = "CARGO_HOME"
82-
83-
[workspace.metadata.dist.github-custom-runners]
84-
aarch64-apple-darwin = "macos-14"
85-
x86_64-apple-darwin = "macos-12"
86-
8764
# Config for 'cargo release'
8865
[workspace.metadata.release]
8966
shared-version = true # ensures published packages share the same version

dist-workspace.toml

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
[workspace]
2+
members = ["cargo:."]
3+
4+
# Config for 'dist'
5+
[dist]
6+
# The preferred dist version to use in CI (Cargo.toml SemVer syntax)
7+
cargo-dist-version = "0.25.1"
8+
# CI backends to support
9+
ci = "github"
10+
# The installers to generate for each app
11+
installers = ["shell"]
12+
# Target platforms to build apps for (Rust target-triple syntax)
13+
targets = ["aarch64-apple-darwin", "x86_64-apple-darwin", "x86_64-unknown-linux-gnu"]
14+
# Whether to consider the binaries in a package for distribution (defaults true)
15+
dist = false
16+
# Which actions to run on pull requests
17+
pr-run-mode = "plan"
18+
# Whether to install an updater program
19+
install-updater = false
20+
# Path that installers should place binaries in
21+
install-path = "CARGO_HOME"
22+
23+
[dist.github-custom-runners]
24+
aarch64-apple-darwin = "macos-14"
25+
x86_64-apple-darwin = "macos-12"

0 commit comments

Comments
 (0)