|
1 | | -name: Build and Release |
| 1 | +name: Release |
2 | 2 |
|
3 | 3 | on: |
4 | 4 | push: |
5 | 5 | branches: [ main ] |
6 | | - |
| 6 | + |
7 | 7 | env: |
8 | | - configuration: Release |
9 | 8 | productNamespacePrefix: "Splat" |
10 | 9 |
|
11 | 10 | jobs: |
12 | 11 | release: |
13 | | - runs-on: windows-2022 |
14 | | - environment: |
15 | | - name: release |
16 | | - outputs: |
17 | | - nbgv: ${{ steps.nbgv.outputs.SemVer2 }} |
18 | | - steps: |
19 | | - - name: Checkout |
20 | | - |
21 | | - with: |
22 | | - fetch-depth: 0 |
23 | | - |
24 | | - - name: Install .NET Core |
25 | | - |
26 | | - with: |
27 | | - dotnet-version: 3.1.x |
28 | | - |
29 | | - - name: Install .NET 5 |
30 | | - |
31 | | - with: |
32 | | - dotnet-version: 5.0.x |
33 | | - |
34 | | - - name: NBGV |
35 | | - id: nbgv |
36 | | - uses: dotnet/nbgv@master |
37 | | - with: |
38 | | - setAllVars: true |
39 | | - |
40 | | - - name: NuGet Restore |
41 | | - run: dotnet restore |
42 | | - working-directory: src |
43 | | - |
44 | | - - name: Build |
45 | | - run: dotnet build --configuration=${{ env.configuration }} --verbosity=minimal --no-restore |
46 | | - working-directory: src |
47 | | - |
48 | | - - uses: nuget/setup-nuget@v1 |
49 | | - name: Setup NuGet |
50 | | - |
51 | | - - name: Pack |
52 | | - run: dotnet pack --configuration=${{ env.configuration }} --verbosity=minimal --no-restore |
53 | | - working-directory: src |
54 | | - |
55 | | - # Decode the base 64 encoded pfx and save the Signing_Certificate |
56 | | - - name: Sign NuGet packages |
57 | | - shell: pwsh |
58 | | - run: | |
59 | | - $pfx_cert_byte = [System.Convert]::FromBase64String("${{ secrets.SIGNING_CERTIFICATE }}") |
60 | | - [IO.File]::WriteAllBytes("GitHubActionsWorkflow.pfx", $pfx_cert_byte) |
61 | | - $secure_password = ConvertTo-SecureString ${{ secrets.SIGN_CERTIFICATE_PASSWORD }} –asplaintext –force |
62 | | - Import-PfxCertificate -FilePath GitHubActionsWorkflow.pfx -Password $secure_password -CertStoreLocation Cert:\CurrentUser\My |
63 | | - nuget sign -Timestamper http://timestamp.digicert.com -CertificateFingerprint ${{ secrets.SIGN_CERTIFICATE_HASH }} **/*.nupkg |
64 | | -
|
65 | | - - name: Changelog |
66 | | - uses: glennawatson/ChangeLog@v1 |
67 | | - id: changelog |
68 | | - |
69 | | - - name: Create Release |
70 | | - |
71 | | - env: |
72 | | - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # This token is provided by Actions, you do not need to create your own token |
73 | | - with: |
74 | | - tag_name: ${{ steps.nbgv.outputs.SemVer2 }} |
75 | | - release_name: ${{ steps.nbgv.outputs.SemVer2 }} |
76 | | - body: | |
77 | | - ${{ steps.changelog.outputs.commitLog }} |
78 | | -
|
79 | | - - name: NuGet Push |
80 | | - env: |
81 | | - NUGET_AUTH_TOKEN: ${{ secrets.NUGET_API_KEY }} |
82 | | - SOURCE_URL: https://api.nuget.org/v3/index.json |
83 | | - run: | |
84 | | - dotnet nuget push -s ${{ env.SOURCE_URL }} -k ${{ env.NUGET_AUTH_TOKEN }} **/*.nupkg |
| 12 | + uses: reactiveui/actions-common/.github/workflows/workflow-common-release.yml@main |
| 13 | + with: |
| 14 | + configuration: Release |
| 15 | + productNamespacePrefix: "Splat" |
| 16 | + useVisualStudioPreview: false |
| 17 | + useMauiCheckDotNetTool: false |
| 18 | + secrets: |
| 19 | + SIGN_CLIENT_USER_ID: ${{ secrets.SIGN_CLIENT_USER_ID }} |
| 20 | + SIGN_CLIENT_SECRET: ${{ secrets.SIGN_CLIENT_SECRET }} |
| 21 | + SIGN_CLIENT_CONFIG: ${{ secrets.SIGN_CLIENT_CONFIG }} |
| 22 | + NUGET_API_KEY: ${{ secrets.NUGET_API_KEY }} |
0 commit comments