Publish Prod #97
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Publish Prod | |
| on: | |
| workflow_dispatch: | |
| jobs: | |
| publish_prod: | |
| runs-on: windows-latest | |
| env: | |
| DOTNET_CLI_TELEMETRY_OPTOUT: true | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v3 | |
| - name: Setup .NET SDK | |
| uses: actions/setup-dotnet@v3 | |
| with: | |
| global-json-file: global.json | |
| - name: Build packages | |
| env: | |
| BUILD_TYPE: PROD | |
| run: .\build.ps1 | |
| - name: Download CodeSignTool | |
| run: | | |
| Invoke-WebRequest -Uri https://github.com/SSLcom/CodeSignTool/releases/download/v1.3.0/CodeSignTool-v1.3.0-windows.zip -OutFile codesign.zip | |
| - name: Unpack CodeSignTool | |
| run: | | |
| New-Item -ItemType Directory -Force -Path "$env:GITHUB_WORKSPACE\code_sign" | Out-Null | |
| Expand-Archive -Path codesign.zip -DestinationPath "$env:GITHUB_WORKSPACE\code_sign" -Force | |
| - name: Configure CodeSignTool | |
| run: | | |
| $confPath = "$env:GITHUB_WORKSPACE\code_sign\conf\code_sign_tool.properties" | |
| if (Test-Path $confPath) { Remove-Item $confPath -Force } | |
| $lines = @( | |
| 'CLIENT_ID=kaXTRACNijSWsFdRKg_KAfD3fqrBlzMbWs6TwWHwAn8' | |
| 'OAUTH2_ENDPOINT=https://login.ssl.com/oauth2/token' | |
| 'CSC_API_ENDPOINT=https://cs.ssl.com' | |
| 'TSA_URL=http://ts.ssl.com' | |
| 'TSA_LEGACY_URL=http://ts.ssl.com/legacy' | |
| ) | |
| Set-Content -Path $confPath -Value $lines | |
| - name: Prepare artifacts directory | |
| run: | | |
| New-Item -ItemType Directory -Force -Path "$env:GITHUB_WORKSPACE\artifacts" | Out-Null | |
| Move-Item "$env:GITHUB_WORKSPACE\build_out\*" "$env:GITHUB_WORKSPACE\artifacts" -Exclude *.nupkg -Force | |
| - name: Sign packages with SSL.com eSigner | |
| working-directory: ${{ github.workspace }}\code_sign | |
| run: | | |
| & ".\jdk-11.0.2\bin\java" -Xmx1024M -jar ".\jar\code_sign_tool-1.3.0.jar" batch_sign -username="${{ secrets.ES_USERNAME }}" -password="${{ secrets.ES_PASSWORD }}" -totp_secret="${{ secrets.ES_TOTP_SECRET }}" -input_dir_path="$env:GITHUB_WORKSPACE/build_out" -output_dir_path="$env:GITHUB_WORKSPACE/artifacts" | |
| - name: Publish to Prod | |
| env: | |
| NUGET_API_KEY_PROD: ${{ secrets.NUGET_API_KEY_PROD }} | |
| run: .\publish-prod.ps1 | |
| - name: Archive packages | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: artifacts | |
| path: artifacts |