Skip to content

Commit

Permalink
Investigate installation of SignPath powershell module.
Browse files Browse the repository at this point in the history
  • Loading branch information
hsorby committed Oct 9, 2024
1 parent 6926988 commit 300684d
Show file tree
Hide file tree
Showing 2 changed files with 80 additions and 1 deletion.
2 changes: 1 addition & 1 deletion .github/workflows/test-code-signing.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ on:

jobs:
setup:
if: github.repository == 'hsorby/mapclient'
if: github.repository == 'not-hsorby/mapclient'
runs-on: ubuntu-latest
outputs:
matrix: ${{ steps.set-matrix.outputs.matrix }}
Expand Down
79 changes: 79 additions & 0 deletions .github/workflows/test-install-powershell-package.yaml
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

0 comments on commit 300684d

Please sign in to comment.