Skip to content

v26.18.0

v26.18.0 #24

on:
workflow_dispatch:
inputs:
librariesBomVersion:
description: 'The version of the Libraries BOM we generate release note (e.g., 26.1.5)'
required: true
type: string
release: # https://docs.github.com/en/actions/using-workflows/events-that-trigger-workflows#release
types: [released]
name: release-notes
jobs:
release-note-generation:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-java@v3
with:
distribution: temurin
java-version: 11
cache: maven
- run: java -version
- name: Pick Libraries BOM version
id: pick-version
shell: bash
run: |
set -x
if [ -n "${WORKFLOW_DISPATCH_INPUT}" ]; then
echo "WORKFLOW_DISPATCH_INPUT: ${WORKFLOW_DISPATCH_INPUT}"
echo "libraries-bom-version=${WORKFLOW_DISPATCH_INPUT}" >> $GITHUB_OUTPUT
elif [[ "${GITHUB_REF}" == *"refs/tags/v"* ]]; then
# https://docs.github.com/en/actions/using-workflows/events-that-trigger-workflows#release
# Example value of GITHUB_REF: refs/tags/v26.5.0
# With the single-component setup of Release Please, the Libraries BOM
# version is the version of this repository release.
echo "GITHUB_REF: ${GITHUB_REF}"
VERSION=${GITHUB_REF#refs/*/v}
echo "libraries-bom-version=${VERSION}" >> $GITHUB_OUTPUT
else
echo "Couldn't find the Libraries BOM version. WORKFLOW_DISPATCH_INPUT \
was empty and GITHUB_REF was ${GITHUB_REF}."
exit 1
fi
env:
WORKFLOW_DISPATCH_INPUT: ${{ inputs.librariesBomVersion }}
- name: Install the BOMs locally
run: mvn install
shell: bash
- name: Generate release_note.md
shell: bash
run: |
set -x
mvn -B -ntp compile
GOOGLE_CLOUD_JAVA_VERSION=$(grep -A1 'gapic-libraries-bom' \
../google-cloud-bom/pom.xml |perl -nle 'print $1 if m/<version>(.+)</')
# This generates release_note.md file
mvn -B -ntp exec:java \
-Dlibraries-bom.version="${LIBRARIES_BOM_VERSION}" \
-Dgoogle-cloud-java.version="${GOOGLE_CLOUD_JAVA_VERSION}"
working-directory: release-note-generation
env:
LIBRARIES_BOM_VERSION: ${{ steps.pick-version.outputs.libraries-bom-version }}
GH_TOKEN: ${{ github.token }}
- name: Update the release note with release_note.md
run: |
TAG="v${LIBRARIES_BOM_VERSION}"
echo "Updating ${TAG}"
gh release edit "${TAG}" --notes-file release_note.md
working-directory: release-note-generation
env:
LIBRARIES_BOM_VERSION: ${{ steps.pick-version.outputs.libraries-bom-version }}
GH_TOKEN: ${{ github.token }}