Release V3 - take 3 :D #10
This file contains hidden or 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: | |
| pull_request: | |
| types: | |
| - closed | |
| branches: | |
| - release | |
| jobs: | |
| # Get Version to tag and release the branch, no up-version - [no-ver] included in PR title | |
| validate-environment: | |
| if: github.event.pull_request.merged == true && contains(github.event.pull_request.title, 'no-ver') | |
| name: Get Version from UPM package | |
| uses: ./.github/workflows/getpackageversionfrompackage.yml | |
| with: | |
| build-host: ubuntu-latest | |
| # Perform tagging | |
| release-Package-only: | |
| needs: validate-environment | |
| name: Release package only, no upversion | |
| uses: ./.github/workflows/tagrelease.yml | |
| 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: github.event.pull_request.merged == true && contains(github.event.pull_request.title, 'no-ver') == false && contains(github.event.pull_request.title, 'major-release') | |
| name: Major Version package and release | |
| uses: ./.github/workflows/upversionandtagrelease.yml | |
| with: | |
| build-host: ubuntu-latest | |
| build-type: major | |
| secrets: inherit | |
| # Up version the release and publish minor release | |
| upversion-minor-Package: | |
| if: github.event.pull_request.merged == true && contains(github.event.pull_request.title, 'no-ver') == false && contains(github.event.pull_request.title, 'minor-release') | |
| name: Minor Version package and release | |
| uses: ./.github/workflows/upversionandtagrelease.yml | |
| with: | |
| build-host: ubuntu-latest | |
| build-type: minor | |
| secrets: inherit | |
| # Up version the release and publish patch release (default) | |
| upversion-patch-Package: | |
| if: github.event.pull_request.merged == true && contains(github.event.pull_request.title, 'no-ver') == false && contains(github.event.pull_request.title, 'minor-release') == false && contains(github.event.pull_request.title, 'major-release') == false | |
| name: Patch Version package and release | |
| uses: ./.github/workflows/upversionandtagrelease.yml | |
| with: | |
| build-host: ubuntu-latest | |
| build-type: patch-release | |
| secrets: inherit | |
| release-Complete: | |
| # Only succeed if no upstream release job actually failed. Skipped siblings | |
| # (the build-types that didn't match the PR title) are tolerated; a real | |
| # failure makes this job skip so it can no longer report a false "success". | |
| if: ${{ !failure() && !cancelled() }} | |
| 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: | |
| # Skip if the release didn't actually complete, so we never refresh | |
| # development from a half-finished or failed release. | |
| if: ${{ needs.release-Complete.result == 'success' }} | |
| needs: [release-Complete] | |
| name: Refresh development branch | |
| uses: ./.github/workflows/refreshbranch.yml | |
| with: | |
| build-host: ubuntu-latest | |
| target-branch: development | |
| # The branch this release PR merged into (the trigger pins this to the | |
| # release branch). Avoids hardcoding a branch name that doesn't exist. | |
| source-branch: ${{ github.event.pull_request.base.ref }} | |
| secrets: inherit | |
| # Up version the development branch ready for future development | |
| upversion-development: | |
| # Only re-version development once it has been refreshed successfully. | |
| if: ${{ needs.refresh-development.result == 'success' }} | |
| needs: [refresh-development] | |
| name: UpVersion the development branch for the next release | |
| uses: ./.github/workflows/upversionandtagrelease.yml | |
| with: | |
| build-host: ubuntu-latest | |
| build-type: patch | |
| target-branch: development | |
| createTag: false | |
| secrets: inherit |