|
| 1 | +name: release-signed |
| 2 | + |
| 3 | +on: |
| 4 | + push: |
| 5 | + branches: |
| 6 | + - signed_release |
| 7 | + |
| 8 | +permissions: |
| 9 | + contents: read |
| 10 | + |
| 11 | +env: |
| 12 | + DOTNET_NOLOGO: 1 |
| 13 | + DOTNET_CLI_TELEMETRY_OPTOUT: 1 |
| 14 | + DOTNET_GENERATE_ASPNET_CERTIFICATE: 0 |
| 15 | + ContinuousIntegrationBuild: true |
| 16 | + RestoreLockedMode: true |
| 17 | + Configuration: Release |
| 18 | + RepositoryBranch: '${{ github.ref_name }}' |
| 19 | + RepositoryCommit: '${{ github.sha }}' |
| 20 | + |
| 21 | +jobs: |
| 22 | + build: |
| 23 | + runs-on: ubuntu-22.04 |
| 24 | + |
| 25 | + steps: |
| 26 | + - name: checkout |
| 27 | + uses: actions/checkout@v4 |
| 28 | + |
| 29 | + - name: setup dotnet |
| 30 | + uses: actions/setup-dotnet@v4 |
| 31 | + with: |
| 32 | + dotnet-version: | |
| 33 | + 6 |
| 34 | + 7 |
| 35 | + 8 |
| 36 | + 9 |
| 37 | +
|
| 38 | + - name: restore |
| 39 | + run: dotnet restore |
| 40 | + |
| 41 | + - name: build |
| 42 | + run: dotnet build --no-restore |
| 43 | + |
| 44 | + - name: test |
| 45 | + run: dotnet test --no-build --no-restore |
| 46 | + |
| 47 | + - name: pack |
| 48 | + run: dotnet pack --no-build --no-restore -o dist |
| 49 | + |
| 50 | + - name: publish artifact |
| 51 | + uses: actions/upload-artifact@v4 |
| 52 | + with: |
| 53 | + name: VbaCompression_unsigned_packages |
| 54 | + path: | |
| 55 | + ${{ github.workspace }}/dist |
| 56 | + ${{ github.workspace }}/src/Kavod.Vba.Compression/README.md |
| 57 | +
|
| 58 | + sign: |
| 59 | + needs: build |
| 60 | + |
| 61 | + environment: sign |
| 62 | + |
| 63 | + runs-on: windows-2022 |
| 64 | + |
| 65 | + permissions: |
| 66 | + contents: read |
| 67 | + id-token: write |
| 68 | + |
| 69 | + steps: |
| 70 | + - name: publish artifact |
| 71 | + uses: actions/download-artifact@v4 |
| 72 | + with: |
| 73 | + name: VbaCompression_unsigned_packages |
| 74 | + |
| 75 | + - name: azure login |
| 76 | + uses: azure/login@v2 |
| 77 | + with: |
| 78 | + client-id: ${{ secrets.TRUSTED_SIGNING_CLIENT_ID }} |
| 79 | + tenant-id: ${{ secrets.AZURE_TENANT_ID }} |
| 80 | + subscription-id: ${{ secrets.AZURE_SUBSCRIPTION_ID }} |
| 81 | + |
| 82 | + - name: setup dotnet sign |
| 83 | + run: dotnet tool install --global sign --version 0.9.1-beta.24529.1 |
| 84 | + |
| 85 | + - name: sign |
| 86 | + run: > |
| 87 | + sign code trusted-signing |
| 88 | + **/*.nupkg |
| 89 | + --base-directory "${{ github.workspace }}/dist" |
| 90 | + --publisher-name "NetOffice" |
| 91 | + --description "VbaCompression library" |
| 92 | + --description-url "https://github.com/NetOfficeFw/VbaCompression" |
| 93 | + --trusted-signing-endpoint "https://weu.codesigning.azure.net/" |
| 94 | + --trusted-signing-account "OpenSourceSigning" |
| 95 | + --trusted-signing-certificate-profile "JozefIzsoOpenSourceProfile" |
| 96 | +
|
| 97 | + - name: publish artifact |
| 98 | + uses: actions/upload-artifact@v4 |
| 99 | + with: |
| 100 | + name: VbaCompression_signed_packages |
| 101 | + path: | |
| 102 | + ${{ github.workspace }}/dist |
| 103 | + ${{ github.workspace }}/src/Kavod.Vba.Compression/README.md |
0 commit comments