Skip to content

Commit 191c5f3

Browse files
authored
chore: bump cargo-dist from 0.21.1 to 0.28.0 (#226)
1 parent b48cc78 commit 191c5f3

File tree

6 files changed

+78
-61
lines changed

6 files changed

+78
-61
lines changed

.github/workflows/release.yml

+40-26
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
#
@@ -45,7 +45,7 @@ on:
4545
- 'synd-term-v[0-9]+.[0-9]+.[0-9]+*' # DIRTY_FOR_SYND
4646

4747
jobs:
48-
# 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
4949
plan:
5050
runs-on: "ubuntu-20.04"
5151
outputs:
@@ -59,25 +59,25 @@ jobs:
5959
- uses: actions/checkout@v4
6060
with:
6161
submodules: recursive
62-
- name: Install cargo-dist
62+
- name: Install dist
6363
# we specify bash to get pipefail; it guards against the `curl` command
6464
# failing. otherwise `sh` won't catch that `curl` returned non-0
6565
shell: bash
66-
run: "curl --proto '=https' --tlsv1.2 -LsSf https://github.com/axodotdev/cargo-dist/releases/download/v0.21.1/cargo-dist-installer.sh | sh"
67-
- name: Cache cargo-dist
66+
run: "curl --proto '=https' --tlsv1.2 -LsSf https://github.com/axodotdev/cargo-dist/releases/download/v0.28.0/cargo-dist-installer.sh | sh"
67+
- name: Cache dist
6868
uses: actions/upload-artifact@v4
6969
with:
7070
name: cargo-dist-cache
71-
path: ~/.cargo/bin/cargo-dist
71+
path: ~/.cargo/bin/dist
7272
# sure would be cool if github gave us proper conditionals...
7373
# so here's a doubly-nested ternary-via-truthiness to try to provide the best possible
7474
# functionality based on whether this is a pull_request, and whether it's from a fork.
7575
# (PRs run on the *source* but secrets are usually on the *target* -- that's *good*
7676
# but also really annoying to build CI around when it needs secrets to work right.)
7777
- id: plan
7878
run: |
79-
cargo dist ${{ (!github.event.pull_request && format('host --steps=create --tag={0}', github.ref_name)) || 'plan' }} --output-format=json > plan-dist-manifest.json
80-
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"
8181
cat plan-dist-manifest.json
8282
echo "manifest=$(jq -c "." plan-dist-manifest.json)" >> "$GITHUB_OUTPUT"
8383
- name: "Upload dist-manifest.json"
@@ -95,18 +95,19 @@ jobs:
9595
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') }}
9696
strategy:
9797
fail-fast: false
98-
# Target platforms/runners are computed by cargo-dist in create-release.
98+
# Target platforms/runners are computed by dist in create-release.
9999
# Each member of the matrix has the following arguments:
100100
#
101101
# - runner: the github runner
102-
# - dist-args: cli flags to pass to cargo dist
103-
# - 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
104104
#
105105
# Typically there will be:
106106
# - 1 "global" task that builds universal installers
107107
# - N "local" tasks that build each platform's binaries and platform-specific installers
108108
matrix: ${{ fromJson(needs.plan.outputs.val).ci.github.artifacts_matrix }}
109109
runs-on: ${{ matrix.runner }}
110+
container: ${{ matrix.container && matrix.container.image || null }}
110111
env:
111112
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
112113
BUILD_MANIFEST_NAME: target/distrib/${{ join(matrix.targets, '-') }}-dist-manifest.json
@@ -118,8 +119,15 @@ jobs:
118119
- uses: actions/checkout@v4
119120
with:
120121
submodules: recursive
121-
- name: Install cargo-dist
122-
run: ${{ matrix.install_dist }}
122+
- name: Install Rust non-interactively if not already installed
123+
if: ${{ matrix.container }}
124+
run: |
125+
if ! command -v cargo > /dev/null 2>&1; then
126+
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y
127+
echo "$HOME/.cargo/bin" >> $GITHUB_PATH
128+
fi
129+
- name: Install dist
130+
run: ${{ matrix.install_dist.run }}
123131
# Get the dist-manifest
124132
- name: Fetch local artifacts
125133
uses: actions/download-artifact@v4
@@ -133,8 +141,8 @@ jobs:
133141
- name: Build artifacts
134142
run: |
135143
# Actually do builds and make zips and whatnot
136-
cargo dist build ${{ needs.plan.outputs.tag-flag }} --print=linkage --output-format=json ${{ matrix.dist_args }} > dist-manifest.json
137-
echo "cargo dist ran successfully"
144+
dist build ${{ needs.plan.outputs.tag-flag }} --print=linkage --output-format=json ${{ matrix.dist_args }} > dist-manifest.json
145+
echo "dist ran successfully"
138146
- id: cargo-dist
139147
name: Post-build
140148
# We force bash here just because github makes it really hard to get values up
@@ -144,7 +152,7 @@ jobs:
144152
run: |
145153
# Parse out what we just built and upload it to scratch storage
146154
echo "paths<<EOF" >> "$GITHUB_OUTPUT"
147-
jq --raw-output ".upload_files[]" dist-manifest.json >> "$GITHUB_OUTPUT"
155+
dist print-upload-files-from-manifest --manifest dist-manifest.json >> "$GITHUB_OUTPUT"
148156
echo "EOF" >> "$GITHUB_OUTPUT"
149157
150158
cp dist-manifest.json "$BUILD_MANIFEST_NAME"
@@ -165,16 +173,17 @@ jobs:
165173
env:
166174
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
167175
BUILD_MANIFEST_NAME: target/distrib/global-dist-manifest.json
176+
RUSTFLAGS: "--cfg tokio_unstable" # DIRTY_FOR_SYND
168177
steps:
169178
- uses: actions/checkout@v4
170179
with:
171180
submodules: recursive
172-
- name: Install cached cargo-dist
181+
- name: Install cached dist
173182
uses: actions/download-artifact@v4
174183
with:
175184
name: cargo-dist-cache
176185
path: ~/.cargo/bin/
177-
- run: chmod +x ~/.cargo/bin/cargo-dist
186+
- run: chmod +x ~/.cargo/bin/dist
178187
# Get all the local artifacts for the global tasks to use (for e.g. checksums)
179188
- name: Fetch local artifacts
180189
uses: actions/download-artifact@v4
@@ -185,8 +194,8 @@ jobs:
185194
- id: cargo-dist
186195
shell: bash
187196
run: |
188-
cargo dist build ${{ needs.plan.outputs.tag-flag }} --output-format=json "--artifacts=global" > dist-manifest.json
189-
echo "cargo dist ran successfully"
197+
dist build ${{ needs.plan.outputs.tag-flag }} --output-format=json "--artifacts=global" > dist-manifest.json
198+
echo "dist ran successfully"
190199
191200
# Parse out what we just built and upload it to scratch storage
192201
echo "paths<<EOF" >> "$GITHUB_OUTPUT"
@@ -218,12 +227,12 @@ jobs:
218227
- uses: actions/checkout@v4
219228
with:
220229
submodules: recursive
221-
- name: Install cached cargo-dist
230+
- name: Install cached dist
222231
uses: actions/download-artifact@v4
223232
with:
224233
name: cargo-dist-cache
225234
path: ~/.cargo/bin/
226-
- run: chmod +x ~/.cargo/bin/cargo-dist
235+
- run: chmod +x ~/.cargo/bin/dist
227236
# Fetch artifacts from scratch-storage
228237
- name: Fetch artifacts
229238
uses: actions/download-artifact@v4
@@ -234,7 +243,7 @@ jobs:
234243
- id: host
235244
shell: bash
236245
run: |
237-
cargo dist host ${{ needs.plan.outputs.tag-flag }} --steps=upload --steps=release --output-format=json > dist-manifest.json
246+
dist host ${{ needs.plan.outputs.tag-flag }} --steps=upload --steps=release --output-format=json > dist-manifest.json
238247
echo "artifacts uploaded and released successfully"
239248
cat dist-manifest.json
240249
echo "manifest=$(jq -c "." dist-manifest.json)" >> "$GITHUB_OUTPUT"
@@ -302,6 +311,11 @@ jobs:
302311
name=$(echo "$filename" | sed "s/\.rb$//")
303312
version=$(echo "$release" | jq .app_version --raw-output)
304313
314+
export PATH="/home/linuxbrew/.linuxbrew/bin:$PATH"
315+
brew update
316+
# We avoid reformatting user-provided data such as the app description and homepage.
317+
brew style --except-cops FormulaAudit/Homepage,FormulaAudit/Desc,FormulaAuditStrict --fix "Formula/${filename}" || true
318+
305319
git add "Formula/${filename}"
306320
git commit -m "${name} ${version}"
307321
done

Cargo.toml

-28
Original file line numberDiff line numberDiff line change
@@ -90,34 +90,6 @@ name = "synd"
9090
[workspace.metadata.release]
9191
allow-branch = ["main"]
9292

93-
# Config for 'cargo dist'
94-
[workspace.metadata.dist]
95-
allow-dirty = ["ci"]
96-
# The preferred cargo-dist version to use in CI (Cargo.toml SemVer syntax)
97-
cargo-dist-version = "0.21.1"
98-
# CI backends to support
99-
ci = "github"
100-
# The installers to generate for each app
101-
installers = ["shell", "powershell", "npm", "homebrew"]
102-
# A GitHub repo to push Homebrew formulas to
103-
tap = "ymgyt/homebrew-syndicationd"
104-
# Target platforms to build apps for (Rust target-triple syntax)
105-
targets = ["aarch64-apple-darwin", "x86_64-apple-darwin", "x86_64-unknown-linux-gnu", "x86_64-unknown-linux-musl", "x86_64-pc-windows-msvc"]
106-
# Publish jobs to run in CI
107-
publish-jobs = ["homebrew", "npm"]
108-
# Which actions to run on pull requests
109-
pr-run-mode = "plan"
110-
# The archive format to use for windows builds (defaults .zip)
111-
windows-archive = ".tar.gz"
112-
# The archive format to use for non-windows builds (defaults .tar.xz)
113-
unix-archive = ".tar.gz"
114-
# A namespace to use when publishing this package to the npm registry
115-
npm-scope = "@syndicationd"
116-
# Whether to install an updater program
117-
install-updater = true
118-
# Path that installers should place binaries in
119-
install-path = "CARGO_HOME"
120-
12193
# The profile that 'cargo dist' will build with
12294
[profile.dist]
12395
inherits = "release"

dist-workspace.toml

+31
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
[workspace]
2+
members = ["cargo:."]
3+
4+
# Config for 'dist'
5+
[dist]
6+
# Skip checking whether the specified configuration files are up to date
7+
allow-dirty = ["ci"]
8+
# The preferred dist version to use in CI (Cargo.toml SemVer syntax)
9+
cargo-dist-version = "0.28.0"
10+
# CI backends to support
11+
ci = "github"
12+
# The installers to generate for each app
13+
installers = ["shell", "powershell", "npm", "homebrew"]
14+
# A GitHub repo to push Homebrew formulas to
15+
tap = "ymgyt/homebrew-syndicationd"
16+
# Target platforms to build apps for (Rust target-triple syntax)
17+
targets = ["aarch64-apple-darwin", "x86_64-apple-darwin", "x86_64-unknown-linux-gnu", "x86_64-unknown-linux-musl", "x86_64-pc-windows-msvc"]
18+
# Publish jobs to run in CI
19+
publish-jobs = ["homebrew", "npm"]
20+
# Which actions to run on pull requests
21+
pr-run-mode = "plan"
22+
# The archive format to use for windows builds (defaults .zip)
23+
windows-archive = ".tar.gz"
24+
# The archive format to use for non-windows builds (defaults .tar.xz)
25+
unix-archive = ".tar.gz"
26+
# A namespace to use when publishing this package to the npm registry
27+
npm-scope = "@syndicationd"
28+
# Whether to install an updater program
29+
install-updater = true
30+
# Path that installers should place binaries in
31+
install-path = "CARGO_HOME"

docs/ci.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ When Dependabot updates dependencies and it is a patch version, it automatically
2626

2727
#### [`release`](https://github.com/ymgyt/syndicationd/blob/main/.github/workflows/release.yml)
2828

29-
The workflow generated by `cargo dist` crates binaries and a GitHub release when a tag is pushed.
29+
The workflow generated by `dist(cargo-dist)` creates binaries and a GitHub release when a tag is pushed.
3030
Whether a package is included in this workflow is controlled by the `[package.metadata.dist.dist]` section in the Cargo.toml file.
3131

3232
#### [`release_image`](https://github.com/ymgyt/syndicationd/blob/main/.github/workflows/releases_image.yml)

etc/just/dist.just

+3-3
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,14 @@ import '.base.just'
33
# Update Cargo.toml [metadata.dist] section
44
[no-cd]
55
init *flags:
6-
cargo dist init --allow-dirty {{flags}}
6+
dist init --allow-dirty {{flags}}
77

88
# Show cargo-dist plan
99
[no-cd]
1010
plan version:
11-
cargo dist plan --tag=synd-term-{{version}} --output-format=json
11+
dist plan --tag=synd-term-{{version}} --output-format=json
1212

1313
# Generate github action release workflow
1414
[no-cd]
1515
generate:
16-
cargo dist generate --mode ci
16+
dist generate --mode ci

flake.lock

+3-3
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)