-
Notifications
You must be signed in to change notification settings - Fork 179
47 lines (39 loc) · 1.31 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
name: P release
# A new release is triggered by a new tag of the form p-VERSION
on:
push:
tags:
- p-*
workflow_dispatch:
inputs:
args:
description: Additional arguments
default: ""
required: false
jobs:
Release:
name: P release
runs-on: ubuntu-latest
steps:
- name: Checkout the repository
uses: actions/checkout@v1
- name: Setup .NET Core @ Latest
uses: actions/setup-dotnet@v1
with:
dotnet-version: 8.0.x
- name: Set the package version
run: |
# The environment variable GITHUB_REF is refs/tags/p-*
echo "TAG=${GITHUB_REF:10}" >> $GITHUB_ENV
echo "VERSION=${GITHUB_REF:12}" >> $GITHUB_ENV
TAG=${GITHUB_REF:10}
VERSION=${GITHUB_REF:12}
# Validate tag and version
python3 .github/workflows/regex_check.py ${TAG} ${VERSION}
- name: Create the package
run: |
# Grab version number from the tag via the environment variable
dotnet pack -p:PackageVersion=${VERSION} -c Release
- name: Push generated package to Nuget
run: |
dotnet nuget push ./Bld/Drops/Release/Binaries/P.${VERSION}.nupkg -k ${{ secrets.NUGET_SECRET }} -s https://api.nuget.org/v3/index.json --no-symbols --skip-duplicate