ci: ignore insignificant commits #2
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: Release | |
on: | |
push: | |
branches: [ "master" ] | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- name: Install Versionize | |
run: dotnet tool install --global Versionize | |
- name: Setup git | |
run: | | |
git config --global user.email opencommissioning@spiratec.com | |
git config --global user.name "oc-bot" | |
- name: Versioning | |
id: versionize | |
run: versionize --exit-insignificant-commits | |
continue-on-error: true | |
- name: Get current version | |
if: steps.versionize.outcome == 'success' | |
run: echo "VERSION=v$(versionize inspect)" >> $GITHUB_ENV | |
- name: Get current changelog | |
if: steps.versionize.outcome == 'success' | |
run: echo "$(versionize changelog)" > latest_changelog.md | |
- name: Push changes to GitHub | |
if: steps.versionize.outcome == 'success' | |
uses: ad-m/github-push-action@master | |
with: | |
github_token: ${{ secrets.GITHUB_TOKEN }} | |
branch: ${{ github.ref }} | |
tags: true | |
- name: Dotnet build | |
if: steps.versionize.outcome == 'success' | |
run: dotnet build OC.Assistant.Sdk --configuration release --output ./Publish | |
- name: Push to NuGet | |
if: steps.versionize.outcome == 'success' | |
run: dotnet nuget push "./Publish/*.nupkg" --api-key ${{secrets.NUGET_API_KEY}} --source https://api.nuget.org/v3/index.json | |
- name: Publish new release | |
if: steps.versionize.outcome == 'success' | |
run: | | |
gh release create ${{env.VERSION}} -t "Release ${{env.VERSION}}" -F latest_changelog.md | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |