Skip to content

Start Release

Start Release #17

Workflow file for this run

name: Start Release
on:
workflow_dispatch:
permissions:
contents: write
packages: write
jobs:
version-and-changelog:
name: Version and Changelog
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: '0'
- name: Setup .NET 8.0
uses: actions/setup-dotnet@v4
with:
dotnet-version: 8.0.x
- name: Build Solution
run: dotnet build
- name: Create NuGet Package
run: dotnet pack
- name: Install AutoVer
run: dotnet tool install -g --add-source src/AutoVer/bin/Release autover
- name: Setup Git User
run: |
git config --global user.email "[email protected]"
git config --global user.name "GitHub User"
- name: Increment Version
run: autover version
- name: Update Chagelog
run: autover changelog
- name: Push Changes
run: git push && git push origin --tags
package-release:
needs: version-and-changelog
name: Package Release
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
ref: ${{ github.ref }}
fetch-depth: '0'
- name: Setup .NET 8.0
uses: actions/setup-dotnet@v4
with:
dotnet-version: 8.0.x
- name: Build Solution
run: dotnet build
- name: Create NuGet Package
run: dotnet pack
- name: Install AutoVer
run: dotnet tool install -g --add-source src/AutoVer/bin/Release autover
- name: Setup Git User
run: |
git config --global user.email "[email protected]"
git config --global user.name "GitHub User"
- name: Read Release Name
id: read-release-name
run: |
version=$(autover changelog --release-name)
echo "VERSION=$version" >> $GITHUB_OUTPUT
- name: Read Tag Name
id: read-tag-name
run: |
tag=$(autover changelog --tag-name)
echo "TAG=$tag" >> $GITHUB_OUTPUT
- name: Read Changelog
id: read-changelog
run: |
changelog=$(autover changelog --output-to-console)
echo "CHANGELOG<<EOF"$'\n'"$changelog"$'\n'EOF >> "$GITHUB_OUTPUT"
- name: Create GitHub Release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ steps.read-tag-name.outputs.TAG }}
release_name: ${{ steps.read-release-name.outputs.VERSION }}
body: ${{ steps.read-changelog.outputs.CHANGELOG }}
draft: false
prerelease: false
- name: Push to GitHub Registry
run: |
dotnet nuget add source --username philasmar --password ${{ secrets.GITHUB_TOKEN }} --store-password-in-clear-text --name github "https://nuget.pkg.github.com/philasmar/index.json"
dotnet nuget push src/AutoVer/bin/Release/*.nupkg --api-key ${{ secrets.GITHUB_TOKEN }} --source "github"
- name: Push to NuGet
run: dotnet nuget push src/AutoVer/bin/Release/*.nupkg --api-key ${{ secrets.NUGET_API_KEY }} --source "https://api.nuget.org/v3/index.json"