Create new Release #52
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: Create new Release | |
on: | |
workflow_dispatch: | |
inputs: | |
versionIncrement: | |
description: 'The new version. For example: 1.1.0' | |
required: true | |
default: '' | |
prerelease: | |
description: 'Is this a pre-release?' | |
type: boolean | |
required: false | |
default: false | |
jobs: | |
release: | |
name: Publish new release | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout repository | |
uses: actions/[email protected] | |
with: | |
token: ${{ secrets.SBPAT }} | |
persist-credentials: true | |
fetch-depth: 0 | |
- name: Get changelog entries | |
id: changelog | |
uses: mindsers/[email protected] | |
with: | |
version: Unreleased | |
path: ./CHANGELOG.md | |
- name: Setup dotnet | |
uses: actions/[email protected] | |
with: | |
dotnet-version: | | |
6.0.x | |
7.0.x | |
8.0.x | |
- name: Update CHANGELOG file | |
uses: thomaseizinger/[email protected] | |
with: | |
version: ${{ github.event.inputs.versionIncrement }} | |
- name: Set git config | |
run: | | |
git config --local user.email "[email protected]" | |
git config --local user.name "LinkDotNet Bot" | |
- name: Commit changes and push changes | |
run: | | |
git add CHANGELOG.md | |
git commit -m "Update Changelog.md for ${{github.event.inputs.versionIncrement}} release" | |
git push origin main | |
- name: Create release on GitHub | |
uses: thomaseizinger/[email protected] | |
env: | |
GITHUB_TOKEN: ${{ secrets.SBPAT }} | |
with: | |
tag_name: v${{ github.event.inputs.versionIncrement }} | |
target_commitish: ${{ env.RELEASE_COMMIT_HASH }} | |
name: v${{ github.event.inputs.versionIncrement }} | |
body: ${{ steps.changelog.outputs.changes }} | |
draft: false | |
prerelease: ${{ github.event.inputs.prerelease }} | |
- name: Create release package | |
run: | | |
dotnet pack -c RELEASE -p:PackageVersion=${{ github.event.inputs.versionIncrement }} --property:PackageOutputPath=${GITHUB_WORKSPACE}/packages /p:ContinuousIntegrationBuild=true --nologo --include-symbols -p:SymbolPackageFormat=snupkg | |
- name: Upload to nuget | |
run: | | |
dotnet nuget push ${GITHUB_WORKSPACE}/packages/*.nupkg -k ${{ secrets.NUGET_API_KEY }} -s https://api.nuget.org/v3/index.json --skip-duplicate | |
dotnet nuget push ${GITHUB_WORKSPACE}/packages/*.snupkg -k ${{ secrets.NUGET_API_KEY }} -s https://api.nuget.org/v3/index.json --skip-duplicate |