|
| 1 | +on: |
| 2 | + workflow_dispatch: |
| 3 | + |
| 4 | +name: release |
| 5 | +jobs: |
| 6 | + build: |
| 7 | + name: Build |
| 8 | + runs-on: windows-2022 |
| 9 | + |
| 10 | + strategy: |
| 11 | + fail-fast: false |
| 12 | + matrix: |
| 13 | + platform: [ x86, x64, arm64 ] |
| 14 | + configuration: [ Debug, Release ] |
| 15 | + |
| 16 | + steps: |
| 17 | + - name: Checkout |
| 18 | + uses: actions/checkout@v4 |
| 19 | + |
| 20 | + - name: Build configure |
| 21 | + shell: cmd |
| 22 | + run: | |
| 23 | + call "C:\Program Files\Microsoft Visual Studio\2022\Enterprise\Common7\Tools\VsDevCmd.bat" |
| 24 | + msbuild Configure.sln /m /t:Rebuild /p:Configuration=${{ matrix.Configuration }},Platform=${{ matrix.platform }} |
| 25 | +
|
| 26 | + - name: Upload executable |
| 27 | + uses: actions/upload-artifact@v4 |
| 28 | + with: |
| 29 | + name: Configure.${{ matrix.Configuration }}.${{ matrix.platform }} |
| 30 | + path: Artifacts/${{ matrix.Configuration }}/${{ matrix.platform}}/bin |
| 31 | + |
| 32 | + release: |
| 33 | + name: Release |
| 34 | + runs-on: windows-2022 |
| 35 | + needs: build |
| 36 | + |
| 37 | + permissions: |
| 38 | + contents: write |
| 39 | + id-token: write |
| 40 | + |
| 41 | + steps: |
| 42 | + - name: Checkout |
| 43 | + uses: actions/checkout@v4 |
| 44 | + |
| 45 | + - uses: actions/download-artifact@v4 |
| 46 | + name: Download executables |
| 47 | + with: |
| 48 | + path: ${{ github.workspace }}/Artifacts |
| 49 | + merge-multiple: true |
| 50 | + |
| 51 | + - name: Install dotnet sign |
| 52 | + shell: cmd |
| 53 | + run: dotnet tool install --global sign --prerelease |
| 54 | + |
| 55 | + - name: Azure CLI login with federated credential |
| 56 | + uses: azure/login@v2 |
| 57 | + with: |
| 58 | + client-id: ${{ secrets.AZURE_CLIENT_ID }} |
| 59 | + tenant-id: ${{ secrets.AZURE_TENANT_ID }} |
| 60 | + subscription-id: ${{ secrets.AZURE_SUBSCRIPTION_ID }} |
| 61 | + |
| 62 | + - name: Sign executables |
| 63 | + run: sign code trusted-signing *.exe ` |
| 64 | + --trusted-signing-account ImageMagick ` |
| 65 | + --trusted-signing-certificate-profile ImageMagick ` |
| 66 | + --trusted-signing-endpoint https://eus.codesigning.azure.net ` |
| 67 | + --verbosity information |
| 68 | + working-directory: ${{ github.workspace }}/Artifacts |
| 69 | + |
| 70 | + - name: Set release number |
| 71 | + shell: bash |
| 72 | + run: echo "release=$(date +'%Y.%m.%d.%H%M')" >> $GITHUB_ENV |
| 73 | + |
| 74 | + - name: Create and push tag |
| 75 | + shell: bash |
| 76 | + run: | |
| 77 | + git config user.name "github-actions[bot]" |
| 78 | + git config user.email "github-actions[bot]@users.noreply.github.com" |
| 79 | + git tag $release |
| 80 | + git push origin $release |
| 81 | +
|
| 82 | + - name: Publish release |
| 83 | + uses: softprops/action-gh-release@v2 |
| 84 | + with: |
| 85 | + name: ${{ env.release }} |
| 86 | + tag_name: ${{ env.release }} |
| 87 | + files: | |
| 88 | + ${{ github.workspace }}/Artifacts/Configure.Debug.x64.exe |
| 89 | + ${{ github.workspace }}/Artifacts/Configure.Debug.arm64.exe |
| 90 | + ${{ github.workspace }}/Artifacts/Configure.Debug.x86.exe |
| 91 | + ${{ github.workspace }}/Artifacts/Configure.Release.x64.exe |
| 92 | + ${{ github.workspace }}/Artifacts/Configure.Release.arm64.exe |
| 93 | + ${{ github.workspace }}/Artifacts/Configure.Release.x86.exe |
0 commit comments