forked from AElfProject/aelf-developer-tools
-
Notifications
You must be signed in to change notification settings - Fork 0
36 lines (31 loc) · 1.04 KB
/
publish-templates-prod.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
on:
push:
tags:
- 'templates-v*'
branches:
- master
jobs:
publish:
runs-on: ubuntu-latest
env:
WORKING_DIRECTORY: templates
environment: prod
steps:
- name: Checkout repository
uses: actions/checkout@v2
- name: Setup .NET
uses: actions/setup-dotnet@v1
with:
dotnet-version: '7.0.*' # Change this to the .NET version you're using
- name: Read version from Version.props
working-directory: ${{ env.WORKING_DIRECTORY }}
run: |
version=$(grep -oP '<Version>\K[^<]+' Version.props)
echo "VERSION=$version" >> $GITHUB_ENV
- name: Pack
working-directory: ${{ env.WORKING_DIRECTORY }}
run: dotnet pack --configuration Release --output nupkgs /p:Version=$VERSION
- name: Publish NuGet packages
working-directory: ${{ env.WORKING_DIRECTORY }}
run: |
dotnet nuget push "nupkgs/*.nupkg" --api-key ${{ secrets.TEMPLATES_NUGET_API_KEY }} --source ${{ vars.TEMPLATES_NUGET_SOURCE_URL }}