Skip to content

Commit 021052a

Browse files
committed
Shot in the dark here
1 parent 89ff1ce commit 021052a

File tree

1 file changed

+8
-5
lines changed

1 file changed

+8
-5
lines changed

.github/workflows/build.yml

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -36,18 +36,21 @@ jobs:
3636
distribution: adopt-hotspot
3737
java-version: ${{ matrix.java-version }}
3838

39+
- name: Testing to see if Maven wrapper needs to be run first before the step after this one
40+
run: ./mvnw --version
41+
3942
# Set environment variable for the project version: "var_to_set=$(command_to_run)" >> sink
40-
# - For maven: echo "JRELEASER_PROJECT_VERSION=$(./mvnw help:evaluate -Dexpression=project.version -q -DforceStdout)" >> $GITHUB_ENV
41-
# - For gradle: echo "JRELEASER_PROJECT_VERSION=$(./gradlew properties | grep -Po '(?<=version: ).*')" >> $GITHUB_ENV
43+
# - For maven: echo "PROJECT_VERSION=$(./mvnw help:evaluate -Dexpression=project.version -q -DforceStdout)" >> $GITHUB_ENV
44+
# - For gradle: echo "PROJECT_VERSION=$(./gradlew properties | grep -Po '(?<=version: ).*')" >> $GITHUB_ENV
4245
- name: Extract project version to environment variable
43-
run: echo "JRELEASER_PROJECT_VERSION=$(./mvnw help:evaluate -Dexpression=project.version -q -DforceStdout)" >> $GITHUB_ENV
46+
run: echo "PROJECT_VERSION=$(./mvnw help:evaluate -Dexpression=project.version -q -DforceStdout)" >> $GITHUB_ENV
4447

4548
# Check if a tag exists that matches the current project version.
4649
# Write the existence state to the step output 'tagExists'.
4750
- name: 'Check: package version has corresponding git tag'
4851
id: tagged
4952
shell: bash
50-
run: git show-ref --tags --verify --quiet -- "refs/tags/${{ env.JRELEASER_PROJECT_VERSION }}" && echo "tagExists=1" >> $GITHUB_OUTPUT || echo "tagExists=0" >> $GITHUB_OUTPUT
53+
run: git show-ref --tags --verify --quiet -- "refs/tags/${{ env.PROJECT_VERSION }}" && echo "tagExists=1" >> $GITHUB_OUTPUT || echo "tagExists=0" >> $GITHUB_OUTPUT
5154

5255
# Run tests & build artifact
5356
- name: Build
@@ -75,7 +78,7 @@ jobs:
7578
with:
7679
arguments: full-release
7780
env:
78-
JRELEASER_PROJECT_VERSION: ${{ env.JRELEASER_PROJECT_VERSION }}
81+
JRELEASER_PROJECT_VERSION: ${{ env.PROJECT_VERSION }}
7982
JRELEASER_GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
8083
JRELEASER_GPG_PASSPHRASE: ${{ secrets.JRELEASER_GPG_PASSPHRASE }}
8184
JRELEASER_GPG_PUBLIC_KEY: ${{ secrets.JRELEASER_GPG_PUBLIC_KEY }}

0 commit comments

Comments
 (0)