-
Notifications
You must be signed in to change notification settings - Fork 45
59 lines (48 loc) · 1.31 KB
/
publish_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
48
49
50
51
52
53
54
55
56
57
58
59
name: Publish Release on GitHub
on:
push:
tags:
- 'v*'
env:
DOTNET_SKIP_FIRST_TIME_EXPERIENCE: 1
DOTNET_CLI_TELEMETRY_OPTOUT: 1
DOTNET_NOLOGO: 1
permissions:
contents: write
jobs:
build:
runs-on: windows-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup dotnet
uses: actions/setup-dotnet@v4
with:
dotnet-version: '9.x'
- name: Get Version
id: get_version
shell: bash
run: |
tag=${GITHUB_REF##*/}
echo Current branch: ${tag:1}
echo "version_num=${tag:1}" >> "$GITHUB_OUTPUT"
- name: Run build script
run: ./build.ps1 --target=Build
shell: powershell
- name: Create Release
uses: softprops/action-gh-release@v2
with:
name: Release ${{ github.ref }}
body: ""
draft: false
prerelease: false
token: ${{ secrets.GITHUB_TOKEN }}
files: |
./Harmony/bin/Release/HarmonyX.${{ steps.get_version.outputs.version_num }}.nupkg
- name: Publish
env:
NUGET_SOURCE: 'nuget.org'
NUGET_API_KEY: ${{ secrets.NUGET_KEY }}
run: |
dotnet nuget push --skip-duplicate "./Harmony/bin/Release/HarmonyX.*.nupkg" \
--source "$NUGET_SOURCE" --api-key "$NUGET_API_KEY"