|
1 |
| -name: Build and Release |
| 1 | +name: Build |
2 | 2 |
|
3 | 3 | on:
|
4 | 4 | push:
|
5 | 5 | branches: [ main ]
|
6 | 6 | pull_request:
|
7 |
| - types: [opened, synchronize, reopened, closed] |
8 | 7 | branches: [ main ]
|
9 | 8 |
|
10 | 9 | env:
|
|
13 | 12 |
|
14 | 13 | jobs:
|
15 | 14 | build:
|
16 |
| - runs-on: windows-latest |
| 15 | + runs-on: windows-2022 |
17 | 16 | outputs:
|
18 | 17 | nbgv: ${{ steps.nbgv.outputs.SemVer2 }}
|
19 | 18 | steps:
|
|
33 | 32 | with:
|
34 | 33 | dotnet-version: 5.0.x
|
35 | 34 |
|
36 |
| - # - name: Update VS2019 |
37 |
| - # shell: powershell |
38 |
| - # run: Start-Process -Wait -PassThru -FilePath "C:\Program Files (x86)\Microsoft Visual Studio\Installer\vs_installer.exe" -ArgumentList "update --passive --norestart --installpath ""C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise""" |
| 35 | + - name: Install .NET 6 |
| 36 | + uses: actions/setup-dotnet@v1.8.2 |
| 37 | + with: |
| 38 | + dotnet-version: 6.0.x |
| 39 | + include-prerelease: true |
39 | 40 |
|
40 | 41 | - name: NBGV
|
41 | 42 | id: nbgv
|
|
79 | 80 | with:
|
80 | 81 | name: nuget
|
81 | 82 | path: '**/*.nupkg'
|
82 |
| - |
83 |
| - release: |
84 |
| - runs-on: windows-latest |
85 |
| - needs: build |
86 |
| - if: contains(github.event.pull_request.labels.*.name, 'release') && github.event_name == 'pull_request' && github.event.action == 'closed' && github.event.pull_request.merged == true |
87 |
| - steps: |
88 |
| - - name: Checkout |
89 |
| - uses: actions/checkout@v2.3.4 |
90 |
| - with: |
91 |
| - fetch-depth: 0 |
92 |
| - |
93 |
| - - name: Download NuGet Packages |
94 |
| - uses: actions/download-artifact@v2.0.10 |
95 |
| - with: |
96 |
| - name: nuget |
97 |
| - |
98 |
| - - uses: nuget/setup-nuget@v1 |
99 |
| - name: Setup NuGet |
100 |
| - |
101 |
| - # Decode the base 64 encoded pfx and save the Signing_Certificate |
102 |
| - - name: Sign NuGet packages |
103 |
| - shell: pwsh |
104 |
| - run: | |
105 |
| - $pfx_cert_byte = [System.Convert]::FromBase64String("${{ secrets.SIGNING_CERTIFICATE }}") |
106 |
| - [IO.File]::WriteAllBytes("GitHubActionsWorkflow.pfx", $pfx_cert_byte) |
107 |
| - $secure_password = ConvertTo-SecureString ${{ secrets.SIGN_CERTIFICATE_PASSWORD }} –asplaintext –force |
108 |
| - Import-PfxCertificate -FilePath GitHubActionsWorkflow.pfx -Password $secure_password -CertStoreLocation Cert:\CurrentUser\My |
109 |
| - nuget sign -Timestamper http://timestamp.digicert.com -CertificateFingerprint ${{ secrets.SIGN_CERTIFICATE_HASH }} **/*.nupkg |
110 |
| -
|
111 |
| - - name: Changelog |
112 |
| - uses: glennawatson/ChangeLog@v1 |
113 |
| - id: changelog |
114 |
| - |
115 |
| - - name: Create Release |
116 |
| - uses: actions/create-release@v1.1.4 |
117 |
| - env: |
118 |
| - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # This token is provided by Actions, you do not need to create your own token |
119 |
| - with: |
120 |
| - tag_name: ${{ needs.build.outputs.nbgv }} |
121 |
| - release_name: ${{ needs.build.outputs.nbgv }} |
122 |
| - body: | |
123 |
| - ${{ steps.changelog.outputs.commitLog }} |
124 |
| -
|
125 |
| - - name: NuGet Push |
126 |
| - env: |
127 |
| - NUGET_AUTH_TOKEN: ${{ secrets.NUGET_API_KEY }} |
128 |
| - SOURCE_URL: https://api.nuget.org/v3/index.json |
129 |
| - run: | |
130 |
| - dotnet nuget push -s ${{ env.SOURCE_URL }} -k ${{ env.NUGET_AUTH_TOKEN }} **/*.nupkg |
0 commit comments