Skip to content

Releasing GitHub_Actions_POC #1 #5

Releasing GitHub_Actions_POC #1

Releasing GitHub_Actions_POC #1 #5

Workflow file for this run

name: Release Pipeline
run-name: "Releasing ${{ github.event.repository.name }} #${{github.run_attempt}}"
on:
workflow_dispatch
jobs:
initialization:
runs-on: ubuntu-latest
if: github.ref == 'refs/heads/main' || github.ref_name == 'refs/heads/master'
outputs:
POM_VERSION: ${{steps.getVersion.outputs.POM_VERSION}}
steps:
- name: Checkout Code Repository
uses: actions/checkout@v4
- name: Downloading Java
uses: actions/setup-java@v4
with:
java-version: '11'
distribution: 'temurin'
- name: Get Current Version
run: |
echo "POM_VERSION=$(mvn help:evaluate -Dexpression=project.version -q -DforceStdout)" >> $GITHUB_ENV
- name: Print Version
run: echo ${{env.POM_VERSION}}
- name: Verify Is SNAPSHOT Version
if: ${{ !contains(env.POM_VERSION, '-SNAPSHOT')}}
run: |
echo "ERROR: Version is set to incompatible version ${{env.POM_VERSION}}. Only SNAPSHOT development versions can be converted to a release version."
exit 1
- name: Get Release Version
run: |
echo "RELEASE_VERSION=${env.POM_VERSION##-}" >> $GITHUB_ENV
echo "Release version ${{env.RELEASE_VERSION}}"