File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 6060 - name : Prepare package
6161 env :
6262 PACKAGE : ${{ inputs.package-name }}
63+ # --locked: fail rather than silently re-resolve if Cargo.lock is out of date, so a
64+ # release can never pick up a dependency version that was not already reviewed.
6365 run : |
64- cargo package -p "${PACKAGE}"
66+ cargo package --locked - p "${PACKAGE}"
6567 - uses : actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
6668 with :
6769 name : crate-${{ inputs.package-name }}
@@ -115,11 +117,13 @@ jobs:
115117 CARGO_REGISTRY_TOKEN : ${{ steps.auth.outputs.token }}
116118 PACKAGE : ${{ inputs.package-name }}
117119 DRY_RUN : ${{ inputs.dry-run && '--dry-run' || '' }}
120+ # DRY_RUN expansion cannot be double quoted when variable contains empty string otherwise cargo publish
121+ # would fail. This is safe since DRY_RUN is handled in the env section above.
122+ # --locked: see the packaging step. Matters most here, where a dependency build script
123+ # would run with CARGO_REGISTRY_TOKEN in the environment.
118124 run : |
119- # DRY_RUN expansion cannot be double quoted when variable contains empty string otherwise cargo publish
120- # would fail. This is safe since DRY_RUN is handled in the env section above.
121125 # shellcheck disable=SC2086
122- cargo publish -p "${PACKAGE}" ${DRY_RUN}
126+ cargo publish --locked - p "${PACKAGE}" ${DRY_RUN}
123127
124128 - name : Generate hash
125129 id : published_hash
Original file line number Diff line number Diff line change @@ -120,8 +120,10 @@ jobs:
120120 - name : Prepare package
121121 env :
122122 PACKAGE : ${{ inputs.package-name }}
123+ # --locked: fail rather than silently re-resolve if Cargo.lock is out of date, so a
124+ # release can never pick up a dependency version that was not already reviewed.
123125 run : |
124- cargo package -p "${PACKAGE}"
126+ cargo package --locked - p "${PACKAGE}"
125127
126128 - uses : actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
127129 with :
@@ -210,11 +212,13 @@ jobs:
210212 CARGO_REGISTRY_TOKEN : ${{ steps.auth.outputs.token }}
211213 PACKAGE : ${{ inputs.package-name }}
212214 DRY_RUN : ${{ inputs.dry-run && '--dry-run' || '' }}
215+ # DRY_RUN expansion cannot be double quoted when variable contains empty string otherwise cargo publish
216+ # would fail. This is safe since DRY_RUN is handled in the env section above.
217+ # --locked: see the packaging step. Matters most here, where a dependency build script
218+ # would run with CARGO_REGISTRY_TOKEN in the environment.
213219 run : |
214- # DRY_RUN expansion cannot be double quoted when variable contains empty string otherwise cargo publish
215- # would fail. This is safe since DRY_RUN is handled in the env section above.
216220 # shellcheck disable=SC2086
217- cargo publish -p "${PACKAGE}" ${DRY_RUN}
221+ cargo publish --locked - p "${PACKAGE}" ${DRY_RUN}
218222
219223 - name : Generate hash
220224 id : published_hash
You can’t perform that action at this time.
0 commit comments