-
Notifications
You must be signed in to change notification settings - Fork 8
22 lines (22 loc) · 864 Bytes
/
publish.yaml
File metadata and controls
22 lines (22 loc) · 864 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
name: NuGet Publish
on:
workflow_dispatch:
push:
tags: [ '*' ]
jobs:
build:
name: Build and publish NuGet package
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v2
- name: Fetch all tags
run: git fetch --depth=1 origin +refs/tags/*:refs/tags/*
- name: Get current tag
run: echo "CURRENT_TAG=$(git describe --abbrev=0 --tags $(git rev-list --tags --max-count=1))" >> $GITHUB_ENV
- name: Restore
run: dotnet restore
- name: Build
run: dotnet pack CelesteMod.Templates.csproj --configuration Release -p:version=${{env.CURRENT_TAG}} --no-restore
- name: Publish
run: dotnet nuget push bin/Release/CelesteMod.Templates.${{env.CURRENT_TAG}}.nupkg --source 'https://api.nuget.org/v3/index.json' --api-key ${{secrets.NUGET_API_KEY}}