Release #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
# A Workflow for triggering a new release. | |
# | |
# Releasing is a two stage process. | |
# 1. Running this workflow will check the build is green and then push a release tag to the repo, e.g. v1.2.3 | |
# 2. Pushing the release tag (e.g. v1.2.3) will trigger the main CI build.yml. | |
# This main build has conditional steps that only run, or only don't run, when building a release build, i.e. a build triggered when a release tag is pushed. | |
name: Release | |
on: [workflow_dispatch] | |
permissions: | |
contents: read | |
concurrency: "${{ github.repository }}-versioning" | |
jobs: | |
release: | |
runs-on: ubuntu-latest | |
if: github.ref == 'refs/heads/main' | |
permissions: | |
contents: write | |
steps: | |
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7 | |
with: | |
token: ${{ secrets.TRIGGER_GITHUB_TOKEN }} | |
- name: Fetch version history | |
run: git fetch --tags --unshallow | |
- name: Set up JDK | |
uses: actions/setup-java@99b8673ff64fbf99d8d325f52d9a5bdedb8483e9 # v4.2.1 | |
with: | |
java-version: '16' | |
distribution: 'adopt' | |
cache: gradle | |
- name: Install Protoc | |
run: sudo apt install protobuf-compiler | |
- name: Ensure build is green | |
run: ./gradlew build | |
- name: Release | |
run: | | |
# The following command will trigger the build.yml workflow as it pushes a release tag | |
./gradlew release -Prelease.pushTagsOnly | |
- name: Capture version info | |
run: | | |
echo "Release version: $(./gradlew cV -q -Prelease.quiet)" >> $GITHUB_STEP_SUMMARY |