Release Workflow #4
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: Release | |
| on: | |
| workflow_dispatch: | |
| inputs: | |
| bump: | |
| description: 'Version bump type' | |
| required: true | |
| type: choice | |
| options: | |
| - patch | |
| - minor | |
| - major | |
| version-properties-file: | |
| description: 'Path to properties file containing version' | |
| required: false | |
| type: string | |
| default: 'gradle.properties' | |
| concurrency: | |
| group: release | |
| cancel-in-progress: false | |
| jobs: | |
| publish: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| with: | |
| token: ${{ secrets.STREAM_PUBLIC_BOT_TOKEN }} | |
| ref: develop | |
| - name: Bump version | |
| id: bump | |
| uses: ./.github/actions/bump-version | |
| with: | |
| bump: ${{ github.event.inputs.bump }} | |
| file: ${{ github.event.inputs.version-properties-file }} | |
| - name: Commit version file | |
| uses: EndBug/[email protected] | |
| with: | |
| add: ${{ github.event.inputs.version-properties-file }} | |
| message: "AUTOMATION: Version Bump" | |
| default_author: github_actions | |
| push: false | |
| - name: Push changes to ci-release branch | |
| run: git push origin HEAD:ci-release --force-with-lease | |
| - name: Setup Gradle | |
| uses: ./.github/actions/setup-gradle | |
| with: | |
| cache-read-only: false | |
| - name: Build and publish | |
| run: ./gradlew build publish --no-configuration-cache | |
| env: | |
| GRADLE_PUBLISH_KEY: ${{ secrets.GRADLE_PUBLISH_KEY }} | |
| GRADLE_PUBLISH_SECRET: ${{ secrets.GRADLE_PUBLISH_SECRET }} | |
| ORG_GRADLE_PROJECT_mavenCentralUsername: ${{ secrets.OSSRH_USERNAME }} | |
| ORG_GRADLE_PROJECT_mavenCentralPassword: ${{ secrets.OSSRH_PASSWORD }} | |
| ORG_GRADLE_PROJECT_signingInMemoryKey: ${{ secrets.SIGNING_KEY }} | |
| ORG_GRADLE_PROJECT_signingInMemoryKeyId: ${{ secrets.SIGNING_KEY_ID }} | |
| ORG_GRADLE_PROJECT_signingInMemoryKeyPassword: ${{ secrets.SIGNING_PASSWORD }} | |
| - name: Create Github Release | |
| uses: ncipollo/[email protected] | |
| with: | |
| generateReleaseNotes: true | |
| token: ${{ secrets.STREAM_PUBLIC_BOT_TOKEN }} | |
| tag: v${{ steps.bump.outputs.new-version }} | |
| commit: ci-release | |
| makeLatest: true | |
| sync_branches: | |
| needs: publish | |
| name: Sync main and develop with release | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Check out code | |
| uses: actions/checkout@v4 | |
| with: | |
| ref: main | |
| fetch-depth: 0 | |
| token: ${{ secrets.STREAM_PUBLIC_BOT_TOKEN }} | |
| - name: Configure git | |
| run: | | |
| git config user.email "41898282+github-actions[bot]@users.noreply.github.com" | |
| git config user.name "github-actions[bot]" | |
| - name: Sync main with ci-release | |
| run: | | |
| git fetch origin ci-release | |
| git merge --ff-only origin/ci-release | |
| - name: Sync develop with main | |
| run: | | |
| git fetch origin develop | |
| git checkout develop | |
| git merge --no-edit main | |
| - name: Push both branches | |
| run: | | |
| git push origin main | |
| git push origin develop |