Skip to content

Commit

Permalink
Updated steps to include workflow_dispatch tag usage
Browse files Browse the repository at this point in the history
Signed-off-by: Roger Barker <roger.barker@swirldslabs.com>
  • Loading branch information
rbarkerSL committed May 16, 2024
1 parent 86cf4e5 commit fa123b3
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion .github/workflows/release-artifacts.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ jobs:

- name: Retrieve Tag Version
if: ${{ github.event_name == 'workflow_dispatch' }}
id: tag
id: workflow_tag
run: echo "version=${{github.event.inputs.version}}" >> "${GITHUB_OUTPUT}"

- name: Setup Java
Expand All @@ -63,12 +63,21 @@ jobs:
run: echo "version=$(./gradlew -q showVersion | tr -d '[:space:]')" >> "${GITHUB_OUTPUT}"

- name: Validate Release
if: ${{ github.event_name == 'push' }}
run: |
if [[ "${{ steps.tag.outputs.version }}" != "${{ steps.project.outputs.version }}" ]]; then
echo "::error file=version.gradle,line=5,title=Version Mismatch::Tag version '${{ steps.tag.outputs.version }}' does not match the Gradle project version '${{ steps.project.outputs.version }}'. Please update the 'version.gradle' file before tagging."
exit 1
fi
- name: Validate Release
if: ${{ github.event_name == 'workflow_dispatch' }}
run: |
if [[ "${{ steps.workflow_tag.outputs.version }}" != "${{ steps.project.outputs.version }}" ]]; then
echo "::error file=version.gradle,line=5,title=Version Mismatch::Tag version '${{ steps.workflow_tag.outputs.version }}' does not match the Gradle project version '${{ steps.project.outputs.version }}'. Please update the 'version.gradle' file before tagging."
exit 1
fi
maven-central:
name: Publish to Maven Central
runs-on: [ self-hosted, Linux, medium, ephemeral ]
Expand Down

0 comments on commit fa123b3

Please sign in to comment.