-
Notifications
You must be signed in to change notification settings - Fork 0
49 lines (47 loc) · 1.48 KB
/
pack.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
name: Pack
on:
pull_request:
push:
branches:
- main
tags:
- "*"
jobs:
pack:
runs-on: ubuntu-latest
defaults:
run:
shell: pwsh
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=$(Join-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 }}
- 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 }}