Repository navigation
47 lines (47 loc) · 1.58 KB
/
Copy pathrelease.yml
File metadata and controls
47 lines (47 loc) · 1.58 KB
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
name: Check and release
on:
push:
branches: [main]
pull_request:
workflow_dispatch:
inputs:
publish:
description: Publish the checked package
type: boolean
default: false
permissions:
contents: read
jobs:
check:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262
- uses: actions/setup-dotnet@26b0ec14cb23fa6904739307f278c14f94c95bf1
with:
dotnet-version: '8.0.x'
- run: dotnet restore TranscriptDock.Checks --locked-mode
- run: python3 .ci/check.py
- run: dotnet pack TranscriptDock -c Release --no-restore -o artifacts
publish:
if: github.event_name == 'workflow_dispatch' && inputs.publish && github.ref == 'refs/heads/main'
needs: check
runs-on: ubuntu-latest
environment: nuget
permissions:
contents: read
id-token: write
steps:
- uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262
- uses: actions/setup-dotnet@26b0ec14cb23fa6904739307f278c14f94c95bf1
with:
dotnet-version: '8.0.x'
- run: dotnet restore TranscriptDock --locked-mode
- run: dotnet pack TranscriptDock -c Release --no-restore -o artifacts
- uses: NuGet/login@8d196754b4036150537f80ac539e15c2f1028841
id: login
with:
user: afaqak
- name: Publish package
env:
NUGET_API_KEY: ${{ steps.login.outputs.NUGET_API_KEY }}
run: dotnet nuget push artifacts/TranscriptDock.*.nupkg --api-key "$NUGET_API_KEY" --source https://api.nuget.org/v3/index.json