-
Notifications
You must be signed in to change notification settings - Fork 0
47 lines (43 loc) · 1.42 KB
/
release.yaml
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: release
on:
push:
tags:
- "[0-9]+.[0-9]+.[0-9]+*" # only tag
env:
BUILD_CONFIG: Release
jobs:
build-dotnet:
runs-on: ubuntu-latest
timeout-minutes: 15
steps:
- uses: actions/checkout@v4
- uses: guitarrapc/actions/.github/actions/setup-dotnet@main
# tag
- run: echo "GIT_TAG=${GITHUB_REF#refs/tags/}" >> $GITHUB_ENV
# build
- run: dotnet build -c ${{ env.BUILD_CONFIG }} -p:Version=${{ env.GIT_TAG }}
# pack
- run: dotnet pack -c ${{ env.BUILD_CONFIG }} -p:Version=${{ env.GIT_TAG }} -o ./.artifacts/
- uses: actions/upload-artifact@v4
with:
name: nuget
path: ./.artifacts/
create-release:
needs: [build-dotnet]
runs-on: ubuntu-latest
steps:
- uses: guitarrapc/actions/.github/actions/setup-dotnet@main
- run: echo "GIT_TAG=${GITHUB_REF#refs/tags/}" >> $GITHUB_ENV
# release
- name: Create Release
run: gh release create ${{ env.GIT_TAG }} --draft --verify-tag --title "Ver.${{ env.GIT_TAG }}" --generate-notes
env:
GH_REPO: ${{ github.repository }}
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# nuget
- uses: actions/download-artifact@v4
with:
name: nuget
path: ./nuget
# upload nuget
- run: dotnet nuget push "./nuget/*.nupkg" --skip-duplicate -s https://api.nuget.org/v3/index.json -k ${{ secrets.SYNCED_NUGET_KEY }}