|
| 1 | +name: 'Build project and Push to NuGet' |
| 2 | +on: |
| 3 | + workflow_dispatch: |
| 4 | + inputs: |
| 5 | + version: |
| 6 | + description: 'Plugin Version (SemVer: https://semver.org)' |
| 7 | + required: true |
| 8 | + is_prerelease: |
| 9 | + default: false |
| 10 | + description: 'Push to NuGet as a prerelease version' |
| 11 | + required: true |
| 12 | + update_notes: |
| 13 | + default: "-" |
| 14 | + description: "Update Notes to Release" |
| 15 | + required: true |
| 16 | +jobs: |
| 17 | + deploy: |
| 18 | + name: "NuGet Deployment" |
| 19 | + runs-on: ubuntu-latest |
| 20 | + steps: |
| 21 | + - uses: actions/checkout@v2 |
| 22 | + name: Checkout Repository |
| 23 | + with: |
| 24 | + fetch-depth: 0 |
| 25 | + - name: Setup .NET |
| 26 | + uses: actions/setup-dotnet@v1 |
| 27 | + with: |
| 28 | + dotnet-version: 5.0.x |
| 29 | + - name: Install dependencies |
| 30 | + run: dotnet restore |
| 31 | + - name: Update version |
| 32 | + run: "sed -i \"s#<Version>0.0.0</Version>#<Version>${{ github.event.inputs.version }}</Version>#\" Deps.props" |
| 33 | + - name: Update package version |
| 34 | + run: "sed -i \"s#<PackageVersion>0.0.0</PackageVersion>#<PackageVersion>${{ github.event.inputs.version }}</PackageVersion>#\" Deps.props" |
| 35 | + - name: Update informational version |
| 36 | + run: "sed -i \"s#<InformationalVersion>0.0.0</InformationalVersion>#<InformationalVersion>${{ github.event.inputs.version }}</InformationalVersion>#\" Deps.props" |
| 37 | + - name: Build |
| 38 | + run: dotnet build EvolutionPlugins.Universal.Extras.sln --configuration Release --no-restore |
| 39 | + - name: 'Deploy to NuGet EvolutionPlugins.Universal.Extras' |
| 40 | + run: dotnet nuget push EvolutionPlugins.Universal.Extras/bin/Release/*.nupkg |
| 41 | + --api-key ${{ secrets.NUGET_DEPLOY_KEY }} |
| 42 | + --source https://api.nuget.org/v3/index.json |
| 43 | + - name: 'Deploy to NuGet EvolutionPlugins.Universal.Extras.Unturned' |
| 44 | + run: dotnet nuget push EvolutionPlugins.Universal.Extras.Unturned/bin/Release/*.nupkg |
| 45 | + --api-key ${{ secrets.NUGET_DEPLOY_KEY }} |
| 46 | + --source https://api.nuget.org/v3/index.json |
| 47 | + - name: Release to GitHub |
| 48 | + uses: actions/create-release@master |
| 49 | + env: |
| 50 | + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
| 51 | + with: |
| 52 | + body: | |
| 53 | + Install library plugin with command: `EvolutionPlugins.Universal.Extras` |
| 54 | + NuGet: https://www.nuget.org/packages/EvolutionPlugins.Universal.Extras & https://www.nuget.org/packages/EvolutionPlugins.Universal.Extras.Unturned |
| 55 | + Changelog: |
| 56 | + ${{ github.event.inputs.update_notes }} |
| 57 | + release_name: EvolutionPlugins.Universal.Extras v${{ github.event.inputs.version }} |
| 58 | + tag_name: v${{ github.event.inputs.version }} |
0 commit comments