-
Notifications
You must be signed in to change notification settings - Fork 0
75 lines (65 loc) · 1.97 KB
/
release.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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
name: Pack & Release
on:
workflow_call:
inputs:
version:
required: true
type: string
is-prerelease:
required: true
type: boolean
secrets:
NUGET_ORG_API_KEY:
required: true
env:
MinVerVersionOverride: ${{ inputs.version }}
DOTNET_SKIP_FIRST_TIME_EXPERIENCE: 1
DOTNET_NOLOGO: true
ArtifactDirectory: ${{ github.workspace }}/artifacts
defaults:
run:
shell: pwsh
jobs:
release:
runs-on: ubuntu-latest
permissions:
contents: write
packages: write
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Setup .NET
uses: actions/setup-dotnet@v3
with:
dotnet-version: 9
dotnet-quality: ga
- run: |
dotnet nuget add source `
--username USERNAME `
--password ${{ secrets.GITHUB_TOKEN }} `
--store-password-in-clear-text `
--name github "https://nuget.pkg.github.com/${{ github.repository_owner }}/index.json"
- run: |
dotnet pack `
-c Release `
-o ${{ env.ArtifactDirectory }} `
/p:RepositoryUrl="${{ github.server_url }}/${{ github.repository }}" `
/p:Authors=${{ github.repository_owner }}
- name: Echo artifact directory
run: |
echo ${{ env.ArtifactDirectory }}
ls ${{ env.ArtifactDirectory }}
- name: Create GitHub release
id: release
uses: ncipollo/release-action@v1
with:
tag: v${{ inputs.version }}
prerelease: ${{ inputs.is-prerelease }}
artifacts: "${{ env.ArtifactDirectory }}/*.nupkg"
- name: Publish to pkg.github.com
run: |
dotnet nuget push "${{ env.ArtifactDirectory }}/*.nupkg" -s "github"
- name: Publish to nuget.org
run: |
dotnet nuget push "${{ env.ArtifactDirectory }}/*.nupkg" -k ${{ secrets.NUGET_ORG_API_KEY }} -s https://api.nuget.org/v3/index.json