Skip to content

Improve CI to ensure it runs correctly #51

Improve CI to ensure it runs correctly

Improve CI to ensure it runs correctly #51

Workflow file for this run

name: Pack
on:
pull_request:
push:
branches:
- main
tags:
- "*"
jobs:
pack:
runs-on: ubuntu-latest
steps:
- uses: actions/[email protected]
- uses: actions/[email protected]
with:
dotnet-version: 8.0.100
- run: |
echo "${{ secrets.SNK_FILE }}" | base64 --decode > private.snk
echo "PRIVATE_KEY_PATH=$pwd/private.snk" >> $GITHUB_ENV
- if: ${{ github.event_name == 'pull_request' }}
run: |
.github/scripts/pack-on-pull-request.ps1 `
-OutputPath "pack" `
-PullRequestNumber ${{ github.event.pull_request.number }}
shell: pwsh
- if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/main' }}
run: |
.github/scripts/pack-on-push-main.ps1 `
-OutputPath "pack" `
-KeyPath "$pwd/private.snk" `
-NugetApiKey ${{ secrets.NUGET_API_KEY }}
shell: pwsh
env:
GH_TOKEN: ${{ github.token }}
- if: ${{ github.event_name == 'push' && startsWith(github.ref, 'refs/tags/') }}
run: |
$tagName = "${{ github.ref }}" -replace "refs/tags/", ""
.github/scripts/pack-on-push-tag.ps1 `
-OutputPath "pack" `
-KeyPath "$pwd/private.snk" `
-NugetApiKey ${{ secrets.NUGET_API_KEY }}
-TagName $tagName
shell: pwsh
env:
GH_TOKEN: ${{ github.token }}