-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
51 additions
and
0 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
name: GitHub release and NuGet deploy | ||
|
||
on: | ||
workflow_dispatch: | ||
inputs: | ||
version: | ||
description: 'Plugin Version (SemVer: https://semver.org)' | ||
required: true | ||
update_notes: | ||
default: "-" | ||
description: "Update Notes to Release" | ||
required: true | ||
jobs: | ||
deploy: | ||
name: "NuGet Deployment" | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
name: Checkout Repository | ||
with: | ||
fetch-depth: 0 | ||
- name: Setup .NET | ||
uses: actions/setup-dotnet@v1 | ||
with: | ||
dotnet-version: 5.0.x | ||
- name: Install dependencies | ||
run: dotnet restore | ||
- name: Update version | ||
run: "sed -i \"s#<Version>0.0.0</Version>#<Version>${{ github.event.inputs.version }}</Version>#\" EvolutionPlugins.Economy.Stub/EvolutionPlugins.Economy.Stub.csproj" | ||
- name: Update package version | ||
run: "sed -i \"s#<PackageVersion>0.0.0</PackageVersion>#<PackageVersion>${{ github.event.inputs.version }}</PackageVersion>#\" EvolutionPlugins.Economy.Stub/EvolutionPlugins.Economy.Stub.csproj" | ||
- name: Update informational version | ||
run: "sed -i \"s#<InformationalVersion>0.0.0</InformationalVersion>#<InformationalVersion>${{ github.event.inputs.version }}</InformationalVersion>#\" EvolutionPlugins.Economy.Stub/EvolutionPlugins.Economy.Stub.csproj" | ||
- name: Build | ||
run: dotnet build EvolutionPlugins.Economy.Stub/EvolutionPlugins.Economy.Stub.csproj --configuration Release --no-restore | ||
- name: Deploy to NuGet | ||
run: dotnet nuget push EvolutionPlugins.Economy.Stub/bin/Release/*.nupkg | ||
--api-key ${{ secrets.NUGET_DEPLOY_KEY }} | ||
--source https://api.nuget.org/v3/index.json | ||
- name: Release to GitHub | ||
uses: actions/create-release@master | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
with: | ||
body: | | ||
Install plugin with command: `openmod install EvolutionPlugins.Economy.Stub` | ||
NuGet: https://www.nuget.org/packages/EvolutionPlugins.Economy.Stub | ||
Changelog: | ||
${{ github.event.inputs.update_notes }} | ||
release_name: EvolutionPlugins.Economy.Stub v${{ github.event.inputs.version }} | ||
tag_name: v${{ github.event.inputs.version }} |