Skip to content

Update prepare-commit-msg (#135) #102

Update prepare-commit-msg (#135)

Update prepare-commit-msg (#135) #102

Workflow file for this run

name: Continuous Integration
on:
push:
branches:
- main
workflow_dispatch:
jobs:
build:
runs-on: ubuntu-latest
outputs:
fullSemVer: ${{ steps.gitversion.outputs.fullSemVer }}
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Install GitVersion
uses: gittools/actions/gitversion/[email protected]
with:
versionSpec: '6.x'
- name: Determine Version
id: gitversion
uses: gittools/actions/gitversion/[email protected]
with:
useConfigFile: true
updateAssemblyInfo: true
- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: '9.0.x'
- name: Restore dependencies
run: dotnet restore
- name: Build
run: dotnet build -c Release --no-restore
- name: Run tests
run: dotnet test -c Release --no-restore --no-build --verbosity normal
- name: Pack
run: dotnet pack -c Release --no-restore --no-build -o ./nupkg -p:PackageVersion=${{ env.fullSemVer }} -p:IncludeSymbols=true -p:SymbolPackageFormat=snupkg
- name: Push to NuGet
run: dotnet nuget push ./nupkg/*.nupkg -k ${{ secrets.NUGET_API_KEY }} -s https://api.nuget.org/v3/index.json
create_release:
name: Create release
runs-on: ubuntu-latest
permissions:
contents: write
needs: build
env:
fullSemVer: ${{ needs.build.outputs.fullSemVer }}
steps:
- name: Create Release
uses: ncipollo/[email protected]
with:
skipIfReleaseExists: true
allowUpdates: false
draft: false
makeLatest: true
tag: v${{ env.fullSemVer }}
name: Release v${{ env.fullSemVer }}
generateReleaseNotes: true
body: Release ${{ env.fullSemVer }} of ${{ github.repository }}