|
8 | 8 | build: |
9 | 9 | runs-on: ubuntu-latest |
10 | 10 |
|
| 11 | + env: |
| 12 | + BUILD_CONFIG: 'Release' |
| 13 | + PROJECT: 'src/OpenAPI.Net/OpenAPI.Net.csproj' |
| 14 | + |
11 | 15 | steps: |
12 | 16 | - uses: actions/checkout@v2 |
| 17 | + |
| 18 | + - name: Get Build Version |
| 19 | + run: | |
| 20 | + Import-Module .\build\GetBuildVersion.psm1 |
| 21 | + Write-Host $Env:GITHUB_REF |
| 22 | + $version = GetBuildVersion -VersionString $Env:GITHUB_REF |
| 23 | + echo "BUILD_VERSION=$version" | Out-File -FilePath $Env:GITHUB_ENV -Encoding utf-8 -Append |
| 24 | + shell: pwsh |
| 25 | + |
| 26 | + - name: Setup NuGet |
| 27 | + uses: NuGet/setup-nuget@v1.0.5 |
| 28 | + |
| 29 | + - name: Restore dependencies |
| 30 | + run: nuget restore $PROJECT |
| 31 | + |
13 | 32 | - name: Setup .NET |
14 | 33 | uses: actions/setup-dotnet@v1 |
15 | 34 | with: |
16 | 35 | dotnet-version: '6.0.x' |
17 | | - - name: Install dependencies |
18 | | - run: dotnet restore src/OpenAPI.Net/OpenAPI.Net.csproj |
| 36 | + |
19 | 37 | - name: Build |
20 | | - run: dotnet build src/OpenAPI.Net/OpenAPI.Net.csproj --configuration Release --no-restore |
21 | | - - name: Publish on pre-release |
22 | | - uses: rohith/publish-nuget@v2 |
23 | | - with: |
24 | | - PROJECT_FILE_PATH: src/OpenAPI.Net/OpenAPI.Net.csproj |
25 | | - NUGET_KEY: ${{secrets.NUGET_API_KEY}} |
| 38 | + run: dotnet build $PROJECT --configuration $BUILD_CONFIG --no-restore |
| 39 | + |
| 40 | + - name: Decrypt Certificate |
| 41 | + run: ./decrypt_certificate.sh |
| 42 | + env: |
| 43 | + LARGE_SECRET_PASSPHRASE: ${{secrets.CERTIFICATE_GPG_PASSPHRASE}} |
| 44 | + |
| 45 | + - name: Sign Package |
| 46 | + run: nuget sign **\*.nupkg -CertificatePath $HOME/secrets/certificate.pfx -Timestamper http://timestamp.digicert.com/ |
| 47 | + |
| 48 | + - name: Publish Package |
| 49 | + run: nuget push **\*.nupkg -Source 'https://api.nuget.org/v3/index.json' -ApiKey ${{secrets.NUGET_API_KEY}} |
| 50 | + |
| 51 | + - name: Publish symbols |
| 52 | + run: nuget push **\*.snupkg -Source 'https://api.nuget.org/v3/index.json' -ApiKey ${{secrets.NUGET_API_KEY}} |
0 commit comments