Skip to content

3.0-RC-1

3.0-RC-1 #32

Workflow file for this run

name: Build library package on release
on:
release:
types:
- published
jobs:
build_library:
runs-on: ubuntu-latest
env:
RELEASE_NAME: ${{ github.ref_name}}
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Set up JDK
uses: actions/setup-java@v2
with:
java-version: '11'
distribution: 'temurin'
- name: Grant execute permission for Gradlew
run: chmod +x gradlew
- name: check release name matches version pattern
run: |
PATTERN="^([0-9]+\.[0-9]+(\.[0-9]+)?)(-[A-Za-z]+(-[0-9]+))?$"
if [[ $RELEASE_NAME =~ $PATTERN ]]; then
echo "The RELEASE_NAME '$RELEASE_NAME' is valid."
else
echo "The RELEASE_NAME '$RELEASE_NAME' is invalid."
exit 1
fi
- name: Build, run tests and publish
env:
GITHUB_ACTOR: ${{ secrets.GITHUB_ACTOR }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: ./gradlew -Pversion=$RELEASE_NAME publish