3838 with :
3939 fetch-depth : 0
4040 persist-credentials : false
41+ ref : ${{ inputs.tag || github.ref }}
4142 - uses : dtolnay/rust-toolchain@6c977a6ca4077a0ceb28ffbe03f59d46e9ac8772 # upstream commit
4243 with :
4344 toolchain : 1.97.1
5051 Copy-Item "target/${{ matrix.target }}/release/dev.exe" "${{ matrix.asset }}"
5152 Copy-Item "target/${{ matrix.target }}/release/dev.exe" "release-assets/dev.exe"
5253 Copy-Item "powershell/DevNav.psm1" "release-assets/DevNav.psm1"
53- $version = "${env:GITHUB_REF_NAME }".TrimStart('v')
54+ $version = "${{ inputs.tag || github.ref_name } }".TrimStart('v')
5455 git fetch origin main --quiet
5556 git merge-base --is-ancestor $env:GITHUB_SHA origin/main
5657 if ($LASTEXITCODE -ne 0) { throw 'Release tags must point to a commit contained in main.' }
@@ -155,6 +156,7 @@ jobs:
155156 steps :
156157 - uses : actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
157158 with :
159+ ref : ${{ inputs.tag || github.ref }}
158160 persist-credentials : false
159161 - uses : actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8
160162 with :
@@ -165,7 +167,8 @@ jobs:
165167 working-directory : artifacts
166168 shell : bash
167169 run : |
168- version="${GITHUB_REF_NAME#v}"
170+ version="${{ inputs.tag || github.ref_name }}"
171+ version="${version#v}"
169172 mkdir -p manifests/j/JacobOptimiza/DevNav/"$version"
170173 x64_sha=$(sha256sum DevNavSetup-x64.exe | cut -d' ' -f1)
171174 arm64_sha=$(sha256sum DevNavSetup-arm64.exe | cut -d' ' -f1)
@@ -211,7 +214,8 @@ jobs:
211214 - name : Generate the Scoop manifest for this release
212215 working-directory : artifacts
213216 run : |
214- version="${GITHUB_REF_NAME#v}"
217+ version="${{ inputs.tag || github.ref_name }}"
218+ version="${version#v}"
215219 hash() { sha256sum "$1" | cut -d' ' -f1; }
216220 base="https://github.com/JacobOptimiza/dev-nav/releases/download/v$version"
217221 jq --arg version "$version" \
@@ -226,7 +230,8 @@ jobs:
226230 - name : Generate the release manifest
227231 working-directory : artifacts
228232 run : |
229- version="${GITHUB_REF_NAME#v}"
233+ version="${{ inputs.tag || github.ref_name }}"
234+ version="${version#v}"
230235 hash() { sha256sum "$1" | cut -d' ' -f1; }
231236 jq -n --arg version "$version" \
232237 --arg winget_file "winget-manifests-$version.zip" \
@@ -341,7 +346,7 @@ jobs:
341346 GH_TOKEN : ${{ github.token }}
342347 # Upload files only; the unpacked manifests directory is not a release asset.
343348 run : |
344- gh release create "${GITHUB_REF_NAME }" \
349+ gh release create "${{ inputs.tag || github.ref_name } }" \
345350 artifacts/*.exe \
346351 artifacts/*.zip \
347352 artifacts/*.psm1 \
@@ -369,6 +374,7 @@ jobs:
369374 steps :
370375 - uses : actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
371376 with :
377+ ref : ${{ inputs.tag || github.ref }}
372378 persist-credentials : false
373379 - uses : actions/setup-node@820762786026740c76f36085b0efc47a31fe5020 # v7.0.0
374380 with :
@@ -386,7 +392,7 @@ jobs:
386392 shell : pwsh
387393 run : |
388394 $ErrorActionPreference = 'Stop'
389- $version = "${env:GITHUB_REF_NAME }".TrimStart('v')
395+ $version = "${{ inputs.tag || github.ref_name } }".TrimStart('v')
390396 if ([version]$version -le [version]'0.9.7') {
391397 throw "npm must not publish v${version}; the first multichannel release must be newer than 0.9.7."
392398 }
@@ -438,7 +444,7 @@ jobs:
438444 shell : pwsh
439445 run : |
440446 $ErrorActionPreference = 'Stop'
441- $version = "${env:GITHUB_REF_NAME }".TrimStart('v')
447+ $version = "${{ inputs.tag || github.ref_name } }".TrimStart('v')
442448 $tarball = (Resolve-Path "npm-package\jacoboptimiza-devnav-$version.tgz").Path
443449 # Same forms the README documents, resolved against the local tarball
444450 # instead of the registry.
@@ -474,7 +480,7 @@ jobs:
474480 }
475481 - uses : actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7
476482 with :
477- name : npm-package-${{ github.ref_name }}
483+ name : npm-package-${{ inputs.tag || github.ref_name }}
478484 path : npm-package/*.tgz
479485 if-no-files-found : error
480486
@@ -489,6 +495,7 @@ jobs:
489495 steps :
490496 - uses : actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
491497 with :
498+ ref : ${{ inputs.tag || github.ref }}
492499 persist-credentials : false
493500 - uses : actions/setup-node@820762786026740c76f36085b0efc47a31fe5020 # v7.0.0
494501 with :
@@ -500,7 +507,7 @@ jobs:
500507 uses : ./.github/actions/install-npm-cli
501508 - uses : actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8
502509 with :
503- name : npm-package-${{ github.ref_name }}
510+ name : npm-package-${{ inputs.tag || github.ref_name }}
504511 path : npm-package
505512 - name : Stage the exact tested tarball via OIDC trusted publishing
506513 working-directory : npm-package
0 commit comments