Skip to content

Release SDK

Release SDK #5

Workflow file for this run

name: Release SDK
on:
workflow_dispatch:
inputs:
dry-run:
description: 'If true, simulate the commands without executing them'
required: false
default: 'true'
jobs:
read-version:
runs-on: ubuntu-latest
steps:
- name: Checkout repo
uses: actions/checkout@v4
- name: Set up Java
uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: '11'
- name: Extract version from pom.xml
id: get_version
run: |
VERSION=$(mvn help:evaluate -Dexpression=project.version -q -DforceStdout)
echo "VERSION=$VERSION"
echo "version=$VERSION" >> $GITHUB_OUTPUT
- name: Show extracted version
run: echo "Current version is ${{ steps.get_version.outputs.version }}"
- name: Extract release version
id: extract_version
run: |
RAW_VERSION=$(mvn help:evaluate -Dexpression=project.version -q -DforceStdout)
RELEASE_VERSION=${RAW_VERSION/-SNAPSHOT/}
echo "RELEASE_VERSION=$RELEASE_VERSION"
echo "release-version=$RELEASE_VERSION" >> $GITHUB_OUTPUT
- name: Tag release
run: |
RELEASE_VERSION=${{ steps.extract_version.outputs.release-version }}
if [ "${{ github.event.inputs.dry-run }}" = "true" ]; then
echo "Would tag current commit with: v$RELEASE_VERSION"
echo "Command: git tag -a v$RELEASE_VERSION -m 'Release v$RELEASE_VERSION'"
else
git config user.name "github-actions"
git config user.email "github-actions@github.com"
git tag -a v$RELEASE_VERSION -m "Release v$RELEASE_VERSION"
git push origin v$RELEASE_VERSION
fi