Skip to content

Publish

Publish #51

Workflow file for this run

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