-
Notifications
You must be signed in to change notification settings - Fork 8
42 lines (40 loc) · 1.29 KB
/
publish.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
name: Publish
on:
release:
types: [ created ]
jobs:
tests:
runs-on: windows-latest
steps:
- uses: actions/checkout@v3
- name: Setup .NET
uses: actions/setup-dotnet@v3
with:
dotnet-version: |
2.2.x
6.0.x
- name: Restore dependencies
run: dotnet restore ./GeometryDashAPI.sln
- name: Build
run: dotnet build --no-restore ./GeometryDashAPI.sln
- name: Test
run: dotnet test --no-build --verbosity normal ./GeometryDashAPI.sln
publish:
needs: tests
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Setup .NET
uses: actions/setup-dotnet@v2
with:
dotnet-version: 6.0.x
- name: Set Version
run: echo ${{ github.ref_name }} | sed -r "s/^v/GDAPI_VERSION=/" >> $GITHUB_ENV
- name: Restore dependencies
run: dotnet restore ./GeometryDashAPI.sln
- name: Release build
run: dotnet build -c Release ./GeometryDashAPI/GeometryDashAPI.csproj
- name: Pack
run: dotnet pack -c Release -o ./pack/ /p:PackageVersion=$GDAPI_VERSION ./GeometryDashAPI/GeometryDashAPI.csproj
- name: Push to NuGet
run: dotnet nuget push ./pack/GeometryDashAPI*.nupkg -k ${{secrets.NUGET_API_KEY}} -s https://api.nuget.org/v3/index.json --skip-duplicate