Skip to content

Commit 66a33bf

Browse files
authored
update cargo-dist (#17325)
Putting this up to confirm that it does what it should: * undirty the release.yml by including action-commits in the config * add persist-credentials=false hardening
1 parent 5b1d835 commit 66a33bf

File tree

2 files changed

+26
-18
lines changed

2 files changed

+26
-18
lines changed

.github/workflows/release.yml

+19-14
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
# This file was autogenerated by dist: https://github.com/astral-sh/cargo-dist
22
#
3+
# Copyright 2022-2024, axodotdev
34
# Copyright 2025 Astral Software Inc.
45
# SPDX-License-Identifier: MIT or Apache-2.0
56
#
@@ -59,16 +60,17 @@ jobs:
5960
env:
6061
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
6162
steps:
62-
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
63+
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
6364
with:
65+
persist-credentials: false
6466
submodules: recursive
6567
- name: Install dist
6668
# we specify bash to get pipefail; it guards against the `curl` command
6769
# failing. otherwise `sh` won't catch that `curl` returned non-0
6870
shell: bash
69-
run: "curl --proto '=https' --tlsv1.2 -LsSf https://github.com/astral-sh/cargo-dist/releases/download/v0.28.3/cargo-dist-installer.sh | sh"
71+
run: "curl --proto '=https' --tlsv1.2 -LsSf https://github.com/astral-sh/cargo-dist/releases/download/v0.28.4-prerelease.1/cargo-dist-installer.sh | sh"
7072
- name: Cache dist
71-
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
73+
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02
7274
with:
7375
name: cargo-dist-cache
7476
path: ~/.cargo/bin/dist
@@ -84,7 +86,7 @@ jobs:
8486
cat plan-dist-manifest.json
8587
echo "manifest=$(jq -c "." plan-dist-manifest.json)" >> "$GITHUB_OUTPUT"
8688
- name: "Upload dist-manifest.json"
87-
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
89+
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02
8890
with:
8991
name: artifacts-plan-dist-manifest
9092
path: plan-dist-manifest.json
@@ -121,18 +123,19 @@ jobs:
121123
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
122124
BUILD_MANIFEST_NAME: target/distrib/global-dist-manifest.json
123125
steps:
124-
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
126+
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
125127
with:
128+
persist-credentials: false
126129
submodules: recursive
127130
- name: Install cached dist
128-
uses: actions/download-artifact@95815c38cf2ff2164869cbab79da8d1f422bc89e # v4.2.1
131+
uses: actions/download-artifact@95815c38cf2ff2164869cbab79da8d1f422bc89e
129132
with:
130133
name: cargo-dist-cache
131134
path: ~/.cargo/bin/
132135
- run: chmod +x ~/.cargo/bin/dist
133136
# Get all the local artifacts for the global tasks to use (for e.g. checksums)
134137
- name: Fetch local artifacts
135-
uses: actions/download-artifact@95815c38cf2ff2164869cbab79da8d1f422bc89e # v4.2.1
138+
uses: actions/download-artifact@95815c38cf2ff2164869cbab79da8d1f422bc89e
136139
with:
137140
pattern: artifacts-*
138141
path: target/distrib/
@@ -150,7 +153,7 @@ jobs:
150153
151154
cp dist-manifest.json "$BUILD_MANIFEST_NAME"
152155
- name: "Upload artifacts"
153-
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
156+
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02
154157
with:
155158
name: artifacts-build-global
156159
path: |
@@ -171,18 +174,19 @@ jobs:
171174
outputs:
172175
val: ${{ steps.host.outputs.manifest }}
173176
steps:
174-
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
177+
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
175178
with:
179+
persist-credentials: false
176180
submodules: recursive
177181
- name: Install cached dist
178-
uses: actions/download-artifact@95815c38cf2ff2164869cbab79da8d1f422bc89e # v4.2.1
182+
uses: actions/download-artifact@95815c38cf2ff2164869cbab79da8d1f422bc89e
179183
with:
180184
name: cargo-dist-cache
181185
path: ~/.cargo/bin/
182186
- run: chmod +x ~/.cargo/bin/dist
183187
# Fetch artifacts from scratch-storage
184188
- name: Fetch artifacts
185-
uses: actions/download-artifact@95815c38cf2ff2164869cbab79da8d1f422bc89e # v4.2.1
189+
uses: actions/download-artifact@95815c38cf2ff2164869cbab79da8d1f422bc89e
186190
with:
187191
pattern: artifacts-*
188192
path: target/distrib/
@@ -196,7 +200,7 @@ jobs:
196200
cat dist-manifest.json
197201
echo "manifest=$(jq -c "." dist-manifest.json)" >> "$GITHUB_OUTPUT"
198202
- name: "Upload dist-manifest.json"
199-
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
203+
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02
200204
with:
201205
# Overwrite the previous copy
202206
name: artifacts-dist-manifest
@@ -246,12 +250,13 @@ jobs:
246250
env:
247251
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
248252
steps:
249-
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
253+
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
250254
with:
255+
persist-credentials: false
251256
submodules: recursive
252257
# Create a GitHub Release while uploading all files to it
253258
- name: "Download GitHub Artifacts"
254-
uses: actions/download-artifact@95815c38cf2ff2164869cbab79da8d1f422bc89e # v4.2.1
259+
uses: actions/download-artifact@95815c38cf2ff2164869cbab79da8d1f422bc89e
255260
with:
256261
pattern: artifacts-*
257262
path: artifacts

Cargo.toml

+7-4
Original file line numberDiff line numberDiff line change
@@ -272,7 +272,7 @@ inherits = "release"
272272
# Config for 'dist'
273273
[workspace.metadata.dist]
274274
# The preferred dist version to use in CI (Cargo.toml SemVer syntax)
275-
cargo-dist-version = "0.28.3"
275+
cargo-dist-version = "0.28.4-prerelease.1"
276276
# CI backends to support
277277
ci = "github"
278278
# The installers to generate for each app
@@ -329,9 +329,12 @@ github-custom-job-permissions = { "build-docker" = { packages = "write", content
329329
install-updater = false
330330
# Path that installers should place binaries in
331331
install-path = ["$XDG_BIN_HOME/", "$XDG_DATA_HOME/../bin", "~/.local/bin"]
332-
# Temporarily allow changes to the `release` workflow, in which we pin actions
333-
# to a SHA instead of a tag (https://github.com/astral-sh/uv/issues/12253)
334-
allow-dirty = ["ci"]
335332

336333
[workspace.metadata.dist.github-custom-runners]
337334
global = "depot-ubuntu-latest-4"
335+
336+
[workspace.metadata.dist.github-action-commits]
337+
"actions/checkout" = "11bd71901bbe5b1630ceea73d27597364c9af683" # v4
338+
"actions/upload-artifact" = "ea165f8d65b6e75b540449e92b4886f43607fa02" # v4.6.2
339+
"actions/download-artifact" = "95815c38cf2ff2164869cbab79da8d1f422bc89e" # v4.2.1
340+
"actions/attest-build-provenance" = "c074443f1aee8d4aeeae555aebba3282517141b2" #v2.2.3

0 commit comments

Comments
 (0)