Release 1.0.3 (#20) #4
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: Publish main branch and increment version | |
on: | |
push: | |
branches: | |
- main | |
# Allows you to run this workflow manually from the Actions tab, last resort if GitHub does not behave | |
workflow_dispatch: | |
jobs: | |
# Get Version to tag and release the branch, no up-version - [no-ver] included in PR title | |
validate-environment: | |
if: contains(github.event.head_commit.message, 'no-ver') | |
name: Get Version from UPM package | |
uses: realitycollective/reusableworkflows/.github/workflows/getpackageversionfrompackage.yml@v2 | |
with: | |
build-host: ubuntu-latest | |
# Perform tagging | |
release-Package-only: | |
needs: validate-environment | |
name: Release package only, no upversion | |
uses: realitycollective/reusableworkflows/.github/workflows/tagrelease.yml@v2 | |
with: | |
build-host: ubuntu-latest | |
version: ${{ needs.validate-environment.outputs.packageversion }} | |
secrets: inherit | |
# Up version the release and publish major release | |
upversion-major-Package: | |
if: contains(github.event.head_commit.message, 'no-ver') == false && contains(github.event.head_commit.message, 'major-release') | |
name: Major Version package and release | |
uses: realitycollective/reusableworkflows/.github/workflows/upversionandtagrelease.yml@v2 | |
with: | |
build-host: ubuntu-latest | |
build-type: major | |
secrets: inherit | |
# Up version the release and publish minor release | |
upversion-minor-Package: | |
if: contains(github.event.head_commit.message, 'no-ver') == false && contains(github.event.head_commit.message, 'minor-release') | |
name: Minor Version package and release | |
uses: realitycollective/reusableworkflows/.github/workflows/upversionandtagrelease.yml@v2 | |
with: | |
build-host: ubuntu-latest | |
build-type: minor | |
secrets: inherit | |
# Up version the release and publish patch release (default) | |
upversion-patch-Package: | |
if: contains(github.event.head_commit.message, 'no-ver') == false && contains(github.event.head_commit.message, 'minor-release') == false && contains(github.event.head_commit.message, 'major-release') == false | |
name: Patch Version package and release | |
uses: realitycollective/reusableworkflows/.github/workflows/upversionandtagrelease.yml@v2 | |
with: | |
build-host: ubuntu-latest | |
build-type: patch-release | |
secrets: inherit | |
release-Complete: | |
if: ${{ always() }} | |
needs: [upversion-major-Package, upversion-minor-Package, upversion-patch-Package, release-Package-only] | |
name: Release complete | |
runs-on: ubuntu-latest | |
steps: | |
- name: Script Version | |
run: echo "Release done, updating Development" | |
# Refresh the development branch with the main publish | |
refresh-development: | |
if: ${{ always() }} | |
needs: [release-Complete] | |
name: Refresh development branch | |
uses: realitycollective/reusableworkflows/.github/workflows/refreshbranch.yml@v2 | |
with: | |
build-host: ubuntu-latest | |
target-branch: development | |
source-branch: main | |
secrets: inherit | |
# Up version the development branch ready for future development | |
upversion-development: | |
if: ${{ always() }} | |
needs: [refresh-development] | |
name: UpVersion the development branch for the next release | |
uses: realitycollective/reusableworkflows/.github/workflows/upversionandtagrelease.yml@v2 | |
with: | |
build-host: ubuntu-latest | |
build-type: patch | |
target-branch: development | |
createTag: false | |
secrets: inherit |