This repository has been archived by the owner on May 27, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
47 lines (38 loc) · 1.57 KB
/
Deploy.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: "Build and publish"
on:
push:
tags:
- 'v*'
env:
PROJECT_PATH: 'AnimDL/AnimDL.csproj'
CORE_PROJECT_PATH: 'AnimDL.Core/AnimDL.Core.csproj'
PROJECT_NAME: 'AnimDL'
PACKAGE_OUTPUT_DIRECTORY : ${{ github.workspace }}\output
NUGET_SOURCE_URL: 'https://api.nuget.org/v3/index.json'
jobs:
deploy:
name: 'Build and deploy'
runs-on: 'windows-latest'
steps:
- name: 'Checkout'
uses: actions/checkout@v2
- name: 'Install dotnet'
uses: actions/setup-dotnet@v1
with:
dotnet-version: '7.0'
- name: 'Restore packages'
run: |
dotnet restore ${{ env.PROJECT_PATH }}
dotnet restore ${{ env.CORE_PROJECT_PATH}}
- name: 'Get version'
id: version
uses: battila7/get-version-action@v2
- name: 'Build project'
run: |
dotnet build ${{ env.CORE_PROJECT_PATH }} --no-restore -c Release -p:Version=${{ steps.version.outputs.version-without-v}}
- name: 'Pack'
run: |
dotnet pack ${{ env.CORE_PROJECT_PATH }} --no-restore --no-build -c Release --include-symbols -p:PackageVersion=${{ steps.version.outputs.version-without-v}} --output ${{ env.PACKAGE_OUTPUT_DIRECTORY }}
- name: 'Push'
run: |
dotnet nuget push ${{ env.PACKAGE_OUTPUT_DIRECTORY }}\${{ env.PROJECT_NAME }}.Core.${{ steps.version.outputs.version-without-v }}.nupkg -s ${{ env.NUGET_SOURCE_URL }} -k ${{ secrets.NUGET_AUTH_TOKEN }}