Github Release and Nuget Deploy #27
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Github Release and Nuget Deploy | |
on: | |
workflow_dispatch: | |
inputs: | |
version: | |
description: 'Plugin SemVer:' | |
required: true | |
update_notes: | |
default: "-" | |
description: "Update Notes to Release" | |
required: true | |
jobs: | |
release_deploy: | |
name: "OpenMod Economy Release/Deployment" | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@master | |
name: Checkout Repository | |
with: | |
fetch-depth: 0 | |
- name: Setup .NET Core | |
uses: actions/setup-dotnet@master | |
with: | |
dotnet-version: 5.0.100 | |
- name: Restore dependencies | |
run: dotnet restore OpenMod.Economy | |
- name: Update version | |
run: "sed -i \"s#<Version>0.0.0</Version>#<Version>${{ github.event.inputs.version }}</Version>#\" OpenMod.Economy/OpenMod.Economy.csproj" | |
- name: Build | |
run: dotnet build OpenMod.Economy --configuration Release --no-restore | |
- name: Push to NuGet | |
run: dotnet nuget push OpenMod.Economy/bin/Release/*.nupkg | |
--api-key ${{ secrets.NUGET_DEPLOY_KEY }} | |
--source https://api.nuget.org/v3/index.json | |
- name: Release | |
id: create_release | |
uses: actions/create-release@master | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
body: | | |
Install: openmod install Openmod.Economy | |
Nuget: https://www.nuget.org/packages/OpenMod.Economy | |
Notes: | |
${{ github.event.inputs.update_notes }} | |
release_name: OpenMod.Economy v${{ github.event.inputs.version }} | |
tag_name: V${{ github.event.inputs.version }} |