Skip to content

Commit 0ff8378

Browse files
authored
fix gradle publish version (#176)
# Goal To publish the correct version from tag we need to pass that version in `./gradlew publish`
1 parent 658e8e3 commit 0ff8378

File tree

1 file changed

+8
-5
lines changed

1 file changed

+8
-5
lines changed

.github/workflows/release.yml

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -157,16 +157,19 @@ jobs:
157157
distribution: 'adopt'
158158
- name: Build JNI package
159159
run: make build-jni
160-
- name: Build and Publish with Gradle
161-
working-directory: java
160+
- name: Get current version
161+
id: version
162162
run: |
163163
# removing v from in front of tag to get version
164164
NEW_VERSION=$(echo '${{ env.NEW_RELEASE_TAG }}' | cut -d 'v' -f 2)
165165
echo "New version: $NEW_VERSION"
166-
./gradlew -PprojVersion="$NEW_VERSION" build
166+
echo "version=$NEW_VERSION" >> $GITHUB_OUTPUT
167+
- name: Build and Publish with Gradle
168+
working-directory: java
169+
run: ./gradlew -PprojVersion='${{ steps.version.outputs.version }}' build
167170
- name: Publish to GitHub Packages
168171
working-directory: java
169-
run: ./gradlew publish
172+
run: ./gradlew -PprojVersion='${{ steps.version.outputs.version }}' publish
170173
if: env.TEST_RUN != 'true'
171174
env:
172175
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
@@ -199,7 +202,7 @@ jobs:
199202
- name: Show versions
200203
working-directory: bridge/node
201204
run: |
202-
echo "Package: v{{ steps.version.outputs.version }}"
205+
echo "Package: v${{ steps.version.outputs.version }}"
203206
echo " Actual: ${{ env.NEW_RELEASE_TAG }}"
204207
205208
- name: Use the new version

0 commit comments

Comments
 (0)