Skip to content

Commit

Permalink
Create main.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
DiFFoZ authored Jun 21, 2021
1 parent 17ab958 commit 46b5718
Showing 1 changed file with 58 additions and 0 deletions.
58 changes: 58 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
name: 'Build project and Push to NuGet'
on:
workflow_dispatch:
inputs:
version:
description: 'Plugin Version (SemVer: https://semver.org)'
required: true
is_prerelease:
default: false
description: 'Push to NuGet as a prerelease version'
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>#\" Deps.props"
- name: Update package version
run: "sed -i \"s#<PackageVersion>0.0.0</PackageVersion>#<PackageVersion>${{ github.event.inputs.version }}</PackageVersion>#\" Deps.props"
- name: Update informational version
run: "sed -i \"s#<InformationalVersion>0.0.0</InformationalVersion>#<InformationalVersion>${{ github.event.inputs.version }}</InformationalVersion>#\" Deps.props"
- name: Build
run: dotnet build EvolutionPlugins.Universal.Extras.sln --configuration Release --no-restore
- name: 'Deploy to NuGet EvolutionPlugins.Universal.Extras'
run: dotnet nuget push EvolutionPlugins.Universal.Extras/bin/Release/*.nupkg
--api-key ${{ secrets.NUGET_DEPLOY_KEY }}
--source https://api.nuget.org/v3/index.json
- name: 'Deploy to NuGet EvolutionPlugins.Universal.Extras.Unturned'
run: dotnet nuget push EvolutionPlugins.Universal.Extras.Unturned/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 library plugin with command: `EvolutionPlugins.Universal.Extras`
NuGet: https://www.nuget.org/packages/EvolutionPlugins.Universal.Extras & https://www.nuget.org/packages/EvolutionPlugins.Universal.Extras.Unturned
Changelog:
${{ github.event.inputs.update_notes }}
release_name: EvolutionPlugins.Universal.Extras v${{ github.event.inputs.version }}
tag_name: v${{ github.event.inputs.version }}

0 comments on commit 46b5718

Please # to comment.