Package #33
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: Package | |
| on: | |
| workflow_dispatch: | |
| inputs: | |
| build_id: | |
| description: '构建工作流ID' | |
| required: true | |
| type: string | |
| version: | |
| description: '版本号' | |
| required: true | |
| default: '1.0.0' | |
| type: string | |
| artifact_name: | |
| description: '签名的制品名称' | |
| required: true | |
| default: 'Speedy-unsigned-artifacts' | |
| type: string | |
| jobs: | |
| package: | |
| runs-on: windows-latest # GitHub-hosted runner | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Download build artifact | |
| uses: actions/download-artifact@v4 | |
| with: | |
| name: ${{ github.event.inputs.artifact_name }} | |
| run-id: ${{ github.event.inputs.build_id }} | |
| path: artifacts/ | |
| github-token: ${{ secrets.GITHUB_TOKEN }} | |
| - id: upload-unsigned-artifacts | |
| name: Re-upload as new artifact | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: OpenSpeedy-unsigned-artifacts | |
| path: artifacts/ | |
| retention-days: 30 | |
| - name: SignPath signing | |
| uses: signpath/[email protected] | |
| with: | |
| api-token: ${{ secrets.SIGNPATH_API_TOKEN }} | |
| organization-id: '58b9835d-38ea-4898-a564-76610c01cecd' | |
| project-slug: OpenSpeedy | |
| signing-policy-slug: release-signing | |
| github-artifact-id: ${{ steps.upload-unsigned-artifacts.outputs.artifact-id }} | |
| artifact-configuration-slug: initial | |
| wait-for-completion: true | |
| output-artifact-directory: signed-artifacts/ | |
| parameters: | | |
| version: ${{ toJSON(github.event.inputs.version) }} | |
| - name: Upload signed artifacts | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: OpenSpeedy-${{ github.event.inputs.version }} | |
| path: signed-artifacts/ | |
| retention-days: 30 | |
| - name: Install WiX Toolset | |
| run: | | |
| dotnet tool install --global wix --version 5.0.2 | |
| wix --version | |
| - name: Prepare installer files | |
| run: | | |
| New-Item -ItemType Directory -Force -Path installer/files | |
| Copy-Item -Path "signed-artifacts/*" -Destination "installer/files/" -Recurse -Force | |
| - name: Build MSI installer | |
| run: | | |
| cd installer | |
| wix build OpenSpeedy.wxs -d Version=${{ github.event.inputs.version }} -o ../OpenSpeedy-installer-${{ github.event.inputs.version }}.msi | |
| - id: upload-unsigned-installer | |
| name: Upload installer | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: OpenSpeedy-unsigned-installer-${{ github.event.inputs.version }} | |
| path: OpenSpeedy-installer-${{ github.event.inputs.version }}.msi | |
| - name: SignPath signing | |
| uses: signpath/[email protected] | |
| with: | |
| api-token: ${{ secrets.SIGNPATH_API_TOKEN }} | |
| organization-id: '58b9835d-38ea-4898-a564-76610c01cecd' | |
| project-slug: OpenSpeedy | |
| signing-policy-slug: release-signing | |
| github-artifact-id: ${{ steps.upload-unsigned-installer.outputs.artifact-id }} | |
| artifact-configuration-slug: installer | |
| wait-for-completion: true | |
| output-artifact-directory: signed-installer/ | |
| parameters: | | |
| version: ${{ toJSON(github.event.inputs.version) }} | |
| - name: Upload signed installer | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: OpenSpeedy-installer-${{ github.event.inputs.version }} | |
| path: signed-installer/ | |
| retention-days: 30 |