Release #7
This file contains hidden or 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
| name: Release | |
| on: | |
| workflow_dispatch: | |
| inputs: | |
| version: | |
| description: 'Version to release (e.g. 0.12.162)' | |
| required: true | |
| type: string | |
| permissions: | |
| contents: write | |
| actions: read | |
| env: | |
| SIGNPATH_ORG_ID: 'c9bd44ce-a067-4f9a-9135-468d00ed0b13' | |
| SIGNPATH_PROJECT_SLUG: 'DriverStoreExplorer' | |
| SIGNPATH_SIGNING_POLICY_SLUG: 'release-signing' | |
| jobs: | |
| release: | |
| runs-on: windows-latest | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v5 | |
| - name: Download CI artifact | |
| shell: pwsh | |
| env: | |
| GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| run: | | |
| $name = "DriverStoreExplorer-v${{ inputs.version }}-unsigned" | |
| $resp = gh api "repos/${{ github.repository }}/actions/artifacts?name=$name&per_page=1" | ConvertFrom-Json | |
| if ($resp.total_count -eq 0) { throw "Artifact '$name' not found from CI" } | |
| $id = $resp.artifacts[0].id | |
| Write-Host "Found artifact ID: $id" | |
| gh api "repos/${{ github.repository }}/actions/artifacts/$id/zip" > artifact.zip | |
| Expand-Archive artifact.zip -DestinationPath ci-build | |
| Remove-Item artifact.zip | |
| - name: Upload unsigned artifact for SignPath | |
| id: upload-unsigned | |
| uses: actions/upload-artifact@v7 | |
| with: | |
| name: DriverStoreExplorer-v${{ inputs.version }}-unsigned | |
| path: ci-build/ | |
| - name: Submit signing request to SignPath | |
| id: signpath | |
| uses: signpath/github-action-submit-signing-request@v1 | |
| with: | |
| api-token: ${{ secrets.SIGNPATH_API_TOKEN }} | |
| organization-id: ${{ env.SIGNPATH_ORG_ID }} | |
| project-slug: ${{ env.SIGNPATH_PROJECT_SLUG }} | |
| signing-policy-slug: ${{ env.SIGNPATH_SIGNING_POLICY_SLUG }} | |
| github-artifact-id: ${{ steps.upload-unsigned.outputs.artifact-id }} | |
| wait-for-completion: true | |
| wait-for-completion-timeout-in-seconds: 3600 | |
| output-artifact-directory: signed-artifact | |
| - name: Create release archive | |
| shell: pwsh | |
| run: | | |
| Compress-Archive -Path signed-artifact/* -DestinationPath "DriverStoreExplorer-v${{ inputs.version }}.zip" | |
| - name: Create GitHub release | |
| env: | |
| GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| run: | | |
| gh release create "v${{ inputs.version }}" ` | |
| "DriverStoreExplorer-v${{ inputs.version }}.zip" ` | |
| --title "DriverStore Explorer v${{ inputs.version }}" ` | |
| --generate-notes ` | |
| --draft |