-
Notifications
You must be signed in to change notification settings - Fork 4
44 lines (35 loc) · 1.55 KB
/
release-preview.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
name: release-preview
concurrency: 'release-preview'
on:
workflow_run:
branches: [ main ]
workflows: [ 'verification' ]
types: [ completed ]
workflow_dispatch:
inputs:
nugetRelease:
description: 'Release to NuGet? Set to "true" to release to NuGet.org as well as GPR.'
required: true
default: 'false'
jobs:
release-preview:
if: github.event_name == 'workflow_dispatch' || github.ref == 'refs/heads/main' && ${{ github.event.workflow_run.conclusion == 'success' }}
runs-on: ubuntu-latest
steps:
- name: 🛒 Checkout repository
uses: actions/checkout@v2
with:
fetch-depth: 0
- name: ⚙️ Setup GIT versioning
uses: dotnet/nbgv@v0.4.0
- name: ⚙️ Setup dotnet 7.0.x
uses: actions/setup-dotnet@v1
with:
dotnet-version: '7.0.x'
- name: 🛠️ Building library in release mode
run: dotnet pack -c Release -o ${GITHUB_WORKSPACE}/packages -p:ContinuousIntegrationBuild=true -p:publicrelease=true
- name: 🛠️ Upload library to GitHub Package Repository
run: dotnet nuget push ${GITHUB_WORKSPACE}/packages/*.nupkg -k ${{ secrets.GITHUB_TOKEN }} -s https://nuget.pkg.github.com/atc-net/index.json --skip-duplicate --no-symbols
- name: 🛠️ Upload library to NuGet.org repository
if: github.event.inputs.nugetRelease == 'true'
run: dotnet nuget push ${GITHUB_WORKSPACE}/packages/*.nupkg -k ${{ secrets.NUGET_KEY }} -s https://api.nuget.org/v3/index.json --skip-duplicate --no-symbols