Skip to content

Commit 56b59cd

Browse files
committed
Fix action that publishes the Gradle plugin
- Set up Java so that it's available for ./gradlew to use - Make the build-number an input for easier re-use in an emergency - Use a working directory to hide main repository's buildSrc
1 parent 18ada7c commit 56b59cd

File tree

1 file changed

+12
-8
lines changed

1 file changed

+12
-8
lines changed

Diff for: .github/actions/publish-gradle-plugin/action.yml

+12-8
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,10 @@ inputs:
1313
gradle-plugin-publish-secret:
1414
description: 'Gradle publishing secret'
1515
required: true
16+
build-number:
17+
description: 'The build number to use when downloading plugin artifacts'
18+
required: false
19+
default: ${{ github.run_number }}
1620
runs:
1721
using: composite
1822
steps:
@@ -22,13 +26,13 @@ runs:
2226
JF_ENV_SPRING: ${{ inputs.jfrog-cli-config-token }}
2327
- name: Download Artifacts
2428
shell: bash
25-
run: jf rt download --spec ${{ format('{0}/artifacts.spec', github.action_path) }} --spec-vars 'buildName=${{ format('spring-boot-{0}', inputs.plugin-version) }};buildNumber=${{ github.run_number }}'
29+
run: jf rt download --spec ${{ format('{0}/artifacts.spec', github.action_path) }} --spec-vars 'buildName=${{ format('spring-boot-{0}', inputs.plugin-version) }};buildNumber=${{ inputs.build-number }}'
30+
- name: Set Up Java
31+
uses: actions/setup-java@v4
32+
with:
33+
distribution: 'liberica'
34+
java-version: '17'
2635
- name: Publish
2736
shell: bash
28-
run: >
29-
./gradlew publishExisting
30-
-p ${{ github.action_path }}
31-
-Pgradle.publish.key=${{ inputs.gradle-plugin-publish-key }}
32-
-Pgradle.publish.secret=${{ inputs.gradle-plugin-publish-secret }}
33-
-PbootVersion=${{ inputs.plugin-version }}
34-
-PrepositoryRoot=$(pwd)/repository
37+
working-directory: ${{ github.action_path }}
38+
run: ${{ github.workspace }}/gradlew publishExisting -Pgradle.publish.key=${{ inputs.gradle-plugin-publish-key }} -Pgradle.publish.secret=${{ inputs.gradle-plugin-publish-secret }} -PbootVersion=${{ inputs.plugin-version }} -PrepositoryRoot=${{ github.workspace }}/repository

0 commit comments

Comments
 (0)