forked from MusculoskeletalAtlasProject/mapclient
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Investigate installation of SignPath powershell module.
- Loading branch information
Showing
2 changed files
with
80 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,79 @@ | ||
name: test-code-signing | ||
|
||
on: | ||
push: | ||
branches: [code-signing] | ||
|
||
jobs: | ||
setup: | ||
if: github.repository == 'hsorby/mapclient' | ||
runs-on: ubuntu-latest | ||
outputs: | ||
matrix: ${{ steps.set-matrix.outputs.matrix }} | ||
run-installer: ${{ steps.set-matrix.outputs.run-installer }} | ||
package: ${{ steps.set-matrix.outputs.run-packaging }} | ||
tag: ${{ steps.get-tag.outputs.tag }} | ||
steps: | ||
- name: Get the tag | ||
id: get-tag | ||
shell: bash | ||
run: | | ||
echo "Setting tag as: vX.Y.Z" | ||
echo "tag=vX.Y.Z" >> $GITHUB_OUTPUT | ||
- name: Get the release name | ||
id: get-release-name | ||
shell: bash | ||
run: | | ||
tag=${{ steps.get-tag.outputs.tag }} | ||
bare_tag=${tag/v/} | ||
IFS='.' read -ra bare_tag_parts <<< "$bare_tag" | ||
name="${bare_tag_parts[0]}.${bare_tag_parts[1]}.${bare_tag_parts[2]}" | ||
echo "Setting name as: ${name}" | ||
echo "name=$name" >> $GITHUB_OUTPUT | ||
- name: Determine required assets | ||
id: set-variants | ||
shell: cmake -P {0} | ||
run: | | ||
set(RELEASE_BODY "${{ github.event.release.body }}") | ||
string(REPLACE "\n" ";" _PARTS "${RELEASE_BODY}") | ||
set(VARIANTS standard) | ||
message(STATUS "variants=\"${VARIANTS}\"") | ||
file(APPEND $ENV{GITHUB_OUTPUT} "variants=\"${VARIANTS}\"") | ||
- name: set_matrix | ||
id: set-matrix | ||
shell: bash | ||
run: | | ||
matrixElements=() | ||
variants=${{ steps.set-variants.outputs.variants }} | ||
for v in $variants; do | ||
matrixElements+=('{"os":"windows-2022","variant":"'$v'","tag":"${{ steps.get-tag.outputs.tag }}","release-name":"${{ steps.get-release-name.outputs.name }}","python-version":"3.9"}') | ||
done | ||
if [ "${#matrixElements[@]}" -eq "0" ]; then | ||
echo run-installer=false >> $GITHUB_OUTPUT | ||
echo run-packaging=false >> $GITHUB_OUTPUT | ||
else | ||
echo run-installer=true >> $GITHUB_OUTPUT | ||
echo run-packaging=true >> $GITHUB_OUTPUT | ||
fi | ||
function join_by { local IFS="$1"; shift; echo "$*"; } | ||
content=`join_by , ${matrixElements[@]}` | ||
echo "{\"include\":[$content]}" | ||
echo "matrix={\"include\":[$content]}" >> $GITHUB_OUTPUT | ||
installer: | ||
needs: setup | ||
name: installer | ||
if: needs.setup.outputs.run-installer == 'true' | ||
runs-on: ${{ matrix.os }} | ||
strategy: | ||
matrix: ${{fromJson(needs.setup.outputs.matrix)}} | ||
steps: | ||
- name: Install PowerShell module SignPath (Windows) | ||
if: runner.os == 'Windows' | ||
shell: pwsh | ||
run: | | ||
Install-Module -Name SignPath |