workflows only run with headcommit that starts with 'Update Version' #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
# This workflow will build a .NET project | |
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-net | |
name: Compile AoT (MacOS-x64) | |
on: | |
push: | |
branches: [ "main" ] | |
pull_request: | |
branches: [ "main" ] | |
jobs: | |
build: | |
runs-on: macos-13 | |
# Only run this workflow if the last commit message starts with 'Update Version' | |
# This is useful to avoid running the workflow on every commit | |
# Just make sure to push all commits immediately authoring 'Update Version' | |
if: startsWith(github.event.head_commit.message, 'Update Version') | |
steps: | |
- uses: actions/checkout@v4 | |
- 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 --no-restore | |
- name: Release | |
run: dotnet publish -r osx-x64 -c Release |