Skip to content

Commit 268c132

Browse files
authored
Merge pull request #9 from ArteGEIE/CI-494-Fix-Workflow
feat: enable manual run for workflow
2 parents 4673425 + cfab6ba commit 268c132

File tree

1 file changed

+19
-2
lines changed

1 file changed

+19
-2
lines changed

.github/workflows/maven-publish.yml

Lines changed: 19 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,12 @@ name: Publish package to GitHub Packages
33
on:
44
release:
55
types: [published]
6+
workflow_dispatch:
7+
inputs:
8+
release_tag:
9+
description: 'Release Tag'
10+
required: true
11+
default: 'v1.0.0'
612

713
jobs:
814
publish:
@@ -11,7 +17,18 @@ jobs:
1117
contents: read
1218
packages: write
1319
steps:
20+
- name: Get Release Tag
21+
id: get_tag
22+
run: |
23+
if [ "${{ github.event_name }}" = "release" ]; then
24+
echo "release_tag=${{ github.event.release.tag_name }}" >> $GITHUB_OUTPUT
25+
else
26+
echo "release_tag=${{ github.event.inputs.release_tag }}" >> $GITHUB_OUTPUT
27+
fi
28+
1429
- uses: actions/checkout@v4
30+
with:
31+
ref: ${{ steps.get_tag.outputs.release_tag }}
1532

1633
- name: Setup xmllint
1734
uses: Bpolitycki/setup-xmllint-action@1.0.1
@@ -51,7 +68,7 @@ jobs:
5168
distribution: 'temurin'
5269

5370
- name: Publish package
54-
run: mvn --batch-mode deploy -Drevision=${{ github.event.release.tag_name }}
71+
run: mvn --batch-mode deploy -Drevision=${{ steps.get_tag.outputs.release_tag }} -DskipTests
5572
env:
5673
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
5774

@@ -65,6 +82,6 @@ jobs:
6582

6683
- name: Trigger Keycloak Configuration Repo
6784
run: |
68-
gh workflow run update-plugin.yml --repo ArteGEIE/keycloak-configuration --ref main -f "version=${{ github.event.release.tag_name }}" -f "plugin=${{ github.repository }}"
85+
gh workflow run update-plugin.yml --repo ArteGEIE/keycloak-configuration --ref main -f "version=${{ steps.get_tag.outputs.release_tag }}" -f "plugin=${{ github.repository }}"
6986
env:
7087
GITHUB_TOKEN: ${{ steps.generate_token.outputs.token }}

0 commit comments

Comments
 (0)