-
Notifications
You must be signed in to change notification settings - Fork 10
38 lines (26 loc) · 1.07 KB
/
nuget_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
name: Nuget Release
on:
release:
types: [published]
workflow_dispatch:
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Setup NuGet
uses: NuGet/setup-nuget@v1
- name: Setup dotnet
uses: actions/setup-dotnet@v3
with:
dotnet-version: 7.0.x
- name: Build and Publish
run: |
set -x
version=$(grep -oP '(?<=PluginVersion = ")[^"]*' ./RoR2BepInExPack/RoR2BepInExPack.cs)
sed -i "0,/<PropertyGroup>/s/<PropertyGroup>/<PropertyGroup>\n <Version>$version<\/Version>/" ./RoR2BepInExPack/RoR2BepInExPack.csproj
sed -i "0,/<PropertyGroup>/s/<PropertyGroup>/<PropertyGroup>\n <AssemblyVersion>$version<\/AssemblyVersion>/" ./RoR2BepInExPack/RoR2BepInExPack.csproj
dotnet pack --configuration Release /p:PackageOutputPath=./ReleaseOutput /p:OutputPath=./ReleaseOutput
nuget setapikey "${{ secrets.NUGET_API_KEY }}"
nuget push ./RoR2BepInExPack/ReleaseOutput/*.nupkg -Source 'https://api.nuget.org/v3/index.json'