ci: setup a specific .NET Core #40
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: Semver | |
on: | |
push: | |
jobs: | |
bump: | |
runs-on: ubuntu-latest | |
outputs: | |
next: ${{ steps.semver.outputs.next }} | |
current: ${{ steps.semver.outputs.current }} | |
steps: | |
- name: Checkout Code | |
uses: actions/checkout@v3 | |
- name: Get Next Version | |
id: semver | |
uses: ietf-tools/semver-action@v1 | |
with: | |
token: ${{ github.token }} | |
branch: main | |
noVersionBumpBehavior: current | |
skipInvalidTags: true | |
- name: Replace version | |
if: steps.semver.outputs.next != steps.semver.outputs.current | |
run: | | |
sed -i "s/\(MyAppVersion\) '.*'/\1 '$next'/" NOWT.iss | |
sed -i "s/\(<AssemblyVersion>\).*</\1$major.0.0</" NOWT/NOWT.csproj | |
sed -i "s/\(<FileVersion>\).*</\1$next</" NOWT/NOWT.csproj | |
sed -i "s/\(<Version>\).*</\1$next</" NOWT/NOWT.csproj | |
sed -i "s/\(<version>\).*</\1$next</" NOWT/VersionInfo.xml | |
env: | |
next: ${{ steps.semver.outputs.nextStrict }} | |
major: ${{ steps.semver.outputs.nextMajorStrict }} | |
- name: Push new version to repo | |
if: steps.semver.outputs.next != steps.semver.outputs.current | |
uses: stefanzweifel/git-auto-commit-action@v4 | |
with: | |
commit_message: "chore: bump version to ${{ steps.semver.outputs.next }}" | |
file_pattern: "*.csproj *.xml *.iss" | |
tagging_message: ${{ steps.semver.outputs.next }} | |
build: | |
needs: bump | |
uses: ./.github/workflows/build.yml | |
if: needs.bump.outputs.current != needs.bump.outputs.next | |
with: | |
tag: ${{ needs.bump.outputs.next }} |