-
Notifications
You must be signed in to change notification settings - Fork 37
30 lines (27 loc) · 1.18 KB
/
release.yml
File metadata and controls
30 lines (27 loc) · 1.18 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
name: Release
on:
push:
tags:
- "v[0-9]+.[0-9]+.[0-9]+"
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Set VERSION variable from tag
run: echo "VERSION=${GITHUB_REF/refs\/tags\/v/}" >> $GITHUB_ENV
- name: Set VERSION_NUMBER
run: echo "VERSION_NUMBER=$(echo $VERSION | grep -i -P -o '^\d+\.\d+\.\d+')" >> $GITHUB_ENV
- name: Build and Package
run: dotnet pack ./ISOv4Plugin/ISOv4Plugin.csproj -c Release -o ./dist -p:NuspecFile=../AgGatewayISOPlugin.nuspec -p:NuspecProperties=version=${{ env.VERSION }} -p:FileVersion=${{ env.VERSION_NUMBER }}+${{ github.run_number }}
- name: Push release to Github
uses: svenstaro/upload-release-action@v2
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: ./dist/AgGatewayISOPlugin.${{ env.VERSION }}.nupkg
tag: ${{ github.ref }}
- name: Push release to public Nuget
run: dotnet nuget push ./dist/AgGatewayISOPlugin.${{ env.VERSION }}.nupkg --source https://api.nuget.org/v3/index.json --api-key ${NUGET_API_KEY}
env:
NUGET_API_KEY: ${{ secrets.NUGET_API_KEY }}