Skip to content

Commit 2edf5d3

Browse files
authored
chore: Update & fix cargo-dist for releases (#252)
1 parent 1ec4ae0 commit 2edf5d3

File tree

4 files changed

+69
-42
lines changed

4 files changed

+69
-42
lines changed

.github/workflows/release.yml

Lines changed: 29 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -62,23 +62,23 @@ jobs:
6262
# we specify bash to get pipefail; it guards against the `curl` command
6363
# failing. otherwise `sh` won't catch that `curl` returned non-0
6464
shell: bash
65-
run: "curl --proto '=https' --tlsv1.2 -LsSf https://github.com/axodotdev/cargo-dist/releases/download/v0.8.2/cargo-dist-installer.sh | sh"
65+
run: "curl --proto '=https' --tlsv1.2 -LsSf https://github.com/axodotdev/cargo-dist/releases/download/v0.11.1/cargo-dist-installer.sh | sh"
6666
# sure would be cool if github gave us proper conditionals...
6767
# so here's a doubly-nested ternary-via-truthiness to try to provide the best possible
6868
# functionality based on whether this is a pull_request, and whether it's from a fork.
6969
# (PRs run on the *source* but secrets are usually on the *target* -- that's *good*
7070
# but also really annoying to build CI around when it needs secrets to work right.)
7171
- id: plan
7272
run: |
73-
cargo dist ${{ (!github.event.pull_request && format('host --steps=create --tag={0}', github.ref_name)) || 'plan' }} --output-format=json > dist-manifest.json
73+
cargo dist ${{ (!github.event.pull_request && format('host --steps=create --tag={0}', github.ref_name)) || 'plan' }} --output-format=json > plan-dist-manifest.json
7474
echo "cargo dist ran successfully"
75-
cat dist-manifest.json
76-
echo "manifest=$(jq -c "." dist-manifest.json)" >> "$GITHUB_OUTPUT"
75+
cat plan-dist-manifest.json
76+
echo "manifest=$(jq -c "." plan-dist-manifest.json)" >> "$GITHUB_OUTPUT"
7777
- name: "Upload dist-manifest.json"
78-
uses: actions/upload-artifact@v3
78+
uses: actions/upload-artifact@v4
7979
with:
80-
name: artifacts
81-
path: dist-manifest.json
80+
name: artifacts-plan-dist-manifest
81+
path: plan-dist-manifest.json
8282

8383
# Build and packages all the platform-specific things
8484
build-local-artifacts:
@@ -113,10 +113,11 @@ jobs:
113113
run: ${{ matrix.install_dist }}
114114
# Get the dist-manifest
115115
- name: Fetch local artifacts
116-
uses: actions/download-artifact@v3
116+
uses: actions/download-artifact@v4
117117
with:
118-
name: artifacts
118+
pattern: artifacts-*
119119
path: target/distrib/
120+
merge-multiple: true
120121
- name: Install dependencies
121122
run: |
122123
${{ matrix.packages_install }}
@@ -139,9 +140,9 @@ jobs:
139140
140141
cp dist-manifest.json "$BUILD_MANIFEST_NAME"
141142
- name: "Upload artifacts"
142-
uses: actions/upload-artifact@v3
143+
uses: actions/upload-artifact@v4
143144
with:
144-
name: artifacts
145+
name: artifacts-build-local-${{ join(matrix.targets, '_') }}
145146
path: |
146147
${{ steps.cargo-dist.outputs.paths }}
147148
${{ env.BUILD_MANIFEST_NAME }}
@@ -160,13 +161,15 @@ jobs:
160161
with:
161162
submodules: recursive
162163
- name: Install cargo-dist
163-
run: "curl --proto '=https' --tlsv1.2 -LsSf https://github.com/axodotdev/cargo-dist/releases/download/v0.8.2/cargo-dist-installer.sh | sh"
164+
shell: bash
165+
run: "curl --proto '=https' --tlsv1.2 -LsSf https://github.com/axodotdev/cargo-dist/releases/download/v0.11.1/cargo-dist-installer.sh | sh"
164166
# Get all the local artifacts for the global tasks to use (for e.g. checksums)
165167
- name: Fetch local artifacts
166-
uses: actions/download-artifact@v3
168+
uses: actions/download-artifact@v4
167169
with:
168-
name: artifacts
170+
pattern: artifacts-*
169171
path: target/distrib/
172+
merge-multiple: true
170173
- id: cargo-dist
171174
shell: bash
172175
run: |
@@ -180,9 +183,9 @@ jobs:
180183
181184
cp dist-manifest.json "$BUILD_MANIFEST_NAME"
182185
- name: "Upload artifacts"
183-
uses: actions/upload-artifact@v3
186+
uses: actions/upload-artifact@v4
184187
with:
185-
name: artifacts
188+
name: artifacts-build-global
186189
path: |
187190
${{ steps.cargo-dist.outputs.paths }}
188191
${{ env.BUILD_MANIFEST_NAME }}
@@ -204,13 +207,14 @@ jobs:
204207
with:
205208
submodules: recursive
206209
- name: Install cargo-dist
207-
run: "curl --proto '=https' --tlsv1.2 -LsSf https://github.com/axodotdev/cargo-dist/releases/download/v0.8.2/cargo-dist-installer.sh | sh"
210+
run: "curl --proto '=https' --tlsv1.2 -LsSf https://github.com/axodotdev/cargo-dist/releases/download/v0.11.1/cargo-dist-installer.sh | sh"
208211
# Fetch artifacts from scratch-storage
209212
- name: Fetch artifacts
210-
uses: actions/download-artifact@v3
213+
uses: actions/download-artifact@v4
211214
with:
212-
name: artifacts
215+
pattern: artifacts-*
213216
path: target/distrib/
217+
merge-multiple: true
214218
# This is a harmless no-op for Github Releases, hosting for that happens in "announce"
215219
- id: host
216220
shell: bash
@@ -220,9 +224,10 @@ jobs:
220224
cat dist-manifest.json
221225
echo "manifest=$(jq -c "." dist-manifest.json)" >> "$GITHUB_OUTPUT"
222226
- name: "Upload dist-manifest.json"
223-
uses: actions/upload-artifact@v3
227+
uses: actions/upload-artifact@v4
224228
with:
225-
name: artifacts
229+
# Overwrite the previous copy
230+
name: artifacts-dist-manifest
226231
path: dist-manifest.json
227232

228233
# Create a Github Release while uploading all files to it
@@ -242,10 +247,11 @@ jobs:
242247
with:
243248
submodules: recursive
244249
- name: "Download Github Artifacts"
245-
uses: actions/download-artifact@v3
250+
uses: actions/download-artifact@v4
246251
with:
247-
name: artifacts
252+
pattern: artifacts-*
248253
path: artifacts
254+
merge-multiple: true
249255
- name: Cleanup
250256
run: |
251257
# Remove the granular manifests

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ tokio-util = "0.7.8"
3333
# Config for 'cargo dist'
3434
[workspace.metadata.dist]
3535
# The preferred cargo-dist version to use in CI (Cargo.toml SemVer syntax)
36-
cargo-dist-version = "0.8.2"
36+
cargo-dist-version = "0.11.1"
3737
# CI backends to support
3838
ci = ["github"]
3939
# The installers to generate for each app

flake.lock

Lines changed: 25 additions & 9 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

flake.nix

Lines changed: 14 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33

44
inputs = {
55
nixpkgs.url = "nixpkgs/nixos-23.11";
6+
nixpkgs-unstable.url = "nixpkgs/nixos-unstable";
67
flake-utils.url = "github:numtide/flake-utils";
78
command-utils.url = "github:expede/nix-command-utils";
89

@@ -16,13 +17,15 @@
1617
outputs = {
1718
self,
1819
nixpkgs,
20+
nixpkgs-unstable,
1921
flake-utils,
2022
rust-overlay,
2123
command-utils,
2224
} @ inputs:
2325
flake-utils.lib.eachDefaultSystem (system: let
2426
overlays = [(import rust-overlay)];
2527
pkgs = import nixpkgs {inherit system overlays;};
28+
unstable = import nixpkgs-unstable {inherit system overlays;};
2629

2730
rust-toolchain =
2831
pkgs.rust-bin.fromRustupToolchainFile ./rust-toolchain.toml;
@@ -36,15 +39,17 @@
3639

3740
format-pkgs = with pkgs; [nixpkgs-fmt alejandra];
3841

39-
cargo-installs = with pkgs; [
40-
cargo-deny
41-
cargo-expand
42-
cargo-outdated
43-
cargo-sort
44-
cargo-udeps
45-
cargo-watch
46-
diesel-cli
47-
];
42+
cargo-installs = with pkgs;
43+
[
44+
cargo-deny
45+
cargo-expand
46+
cargo-outdated
47+
cargo-sort
48+
cargo-udeps
49+
cargo-watch
50+
diesel-cli
51+
]
52+
++ [unstable.cargo-dist];
4853

4954
pgctl = "${pkgs.postgresql}/bin/pg_ctl";
5055
ipfs = "${pkgs.kubo}/bin/ipfs";

0 commit comments

Comments
 (0)