-
-
Notifications
You must be signed in to change notification settings - Fork 3
38 lines (34 loc) · 1.1 KB
/
publish.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
name: Publish
on:
release:
types: [ published ]
jobs:
publish:
name: Publish
runs-on: ubuntu-latest
if: ${{ github.event.workflow_run.conclusion != 'cancelled' }}
permissions:
packages: write
contents: write
environment: ${{ github.event.release.prerelease && 'Staging' || 'Production' }}
steps:
- name: Checkout
uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Install .NET 7
uses: actions/setup-dotnet@v1
with:
dotnet-version: "7.0.x"
source-url: https://nuget.pkg.github.com/${{ github.repository_owner }}/index.json
env:
NUGET_AUTH_TOKEN: ${{ github.token }}
- name: Publish to GitHub Packages
run: |
dotnet pack -o output -c Release /p:ContinuousIntegrationBuild=true /p:Version=${{ github.ref_name }} /p:SourceRevisionId=${{ github.sha }}
dotnet nuget push ./output/*.nupkg
- name: Publish to GitHub Releases
uses: svenstaro/upload-release-action@v2
with:
file: ./output/*.{snupkg,nupkg}
file_glob: true