Publish Stage #29
This file contains 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 Stage | |
on: | |
workflow_dispatch: | |
jobs: | |
publish: | |
name: publish | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Setup .NET | |
uses: actions/setup-dotnet@v3 | |
with: | |
dotnet-version: 6.0.x | |
- name: Build | |
run: dotnet build -c Release src/GroupDocs.Viewer.Cli/GroupDocs.Viewer.Cli.csproj | |
- name: Pack | |
run: dotnet pack --include-symbols -p:SymbolPackageFormat=snupkg --no-build -c Release src/GroupDocs.Viewer.Cli/GroupDocs.Viewer.Cli.csproj -o . | |
- name: Write cert | |
env: | |
PFX_IN_BASE64: ${{ secrets.PFX_IN_BASE64 }} | |
PFX_PATH: ${{ secrets.PFX_PATH }} | |
run: echo "${PFX_IN_BASE64}" | base64 --decode > ${PFX_PATH} | |
- name: Sign | |
env: | |
PFX_PATH: ${{ secrets.PFX_PATH }} | |
PFX_PWD: ${{ secrets.PFX_PWD }} | |
PFX_TMS: ${{ secrets.PFX_TMS }} | |
run: dotnet nuget sign *.nupkg --certificate-path ${PFX_PATH} --certificate-password ${PFX_PWD} --timestamper ${PFX_TMS} | |
- name: Verify | |
run: dotnet nuget verify *.nupkg | |
- name: Remove cert | |
env: | |
PFX_PATH: ${{ secrets.PFX_PATH }} | |
run: rm $PFX_PATH | |
- name: Publish | |
env: | |
NUGET_TOKEN: ${{ secrets.NUGET_API_KEY_STAGE }} | |
run: dotnet nuget push *.nupkg -s https://apiint.nugettest.org/v3/index.json -k ${NUGET_TOKEN} --skip-duplicate |