File tree Expand file tree Collapse file tree 4 files changed +82
-24
lines changed
actions/publish-to-artifactory Expand file tree Collapse file tree 4 files changed +82
-24
lines changed Original file line number Diff line number Diff line change 1+ ---
2+ name : ' publish-to-artifactory'
3+ description : ' Composite action to publish to artifactory'
4+ inputs :
5+ publish-version :
6+ description : ' version to publish with'
7+ required : true
8+
9+ runs :
10+ using : " composite"
11+ steps :
12+
13+ - name : Authneticate JFrog
14+ id : jfrog
15+ if : " !startsWith(github.ref, 'refs/tags/')"
16+ uses : jfrog/setup-jfrog-cli@v4
17+ env :
18+ JF_URL : " https://consensys.jfrog.io"
19+ with :
20+ oidc-provider-name : ' github'
21+ oidc-audience : ' '
22+
23+ - name : Publish Artifactory
24+ id : artifactory
25+ if : " !startsWith(github.ref, 'refs/tags/')"
26+ shell : sh
27+ run : |
28+ ./gradlew artifactoryPublish -PreleaseVersion=${{ inputs.publish-version }}
29+ env :
30+ ARTIFACTORY_USER : ${{ steps.jfrog.outputs.oidc-user }}
31+ ARTIFACTORY_PASSWORD : ${{ steps.jfrog.outputs.oidc-token }}
Original file line number Diff line number Diff line change 5555 runs-on : ubuntu-latest
5656 env :
5757 GRADLE_OPTS : -Dorg.gradle.daemon=false -Dorg.gradle.parallel=true -Dorg.gradle.workers.max=2
58-
5958 steps :
6059 - name : Checkout
6160 uses : actions/checkout@v4
9089 with :
9190 name : jar
9291 path : ' build/libs/'
92+
93+ publishToArtifactory :
94+ needs :
95+ - assemble
96+ - unitTests
97+ runs-on : ubuntu-latest
98+ env :
99+ GRADLE_OPTS : -Dorg.gradle.daemon=false -Dorg.gradle.parallel=true -Dorg.gradle.workers.max=2
100+ environment : publish
101+ permissions :
102+ contents : write
103+ id-token : write
104+ steps :
105+ - name : Checkout
106+ uses : actions/checkout@v4
107+
108+ - name : Setup Java and Gradle
109+ id : setup-java-gradle
110+ uses : ConsenSys/github-actions/java-setup-gradle@main
111+ with :
112+ DISTRIBUTION : ' adopt'
113+
114+ - name : Download workspace
115+ uses : actions/download-artifact@v4
116+ with :
117+ name : workspace
118+
119+ - name : Determine version
120+ id : project_version
121+ uses : ConsenSys/github-actions/java-get-project-version@main
122+
123+ - name : Publish to artifactory
124+ if : " !startsWith(github.ref, 'refs/tags/')"
125+ uses : ./.github/actions/publish-to-artifactory
126+ with :
127+ publish-version : ${{ steps.project_version.outputs.specific-version }}
Original file line number Diff line number Diff line change @@ -16,15 +16,11 @@ jobs:
1616 - name : Checkout
1717 uses : actions/checkout@v4
1818
19- - name : Set up JDK 21
20- 19+ - name : Setup Java and Gradle
20+ id : setup-java-gradle
21+ uses : ConsenSys/github-actions/java-setup-gradle@main
2122 with :
22- java-version : ' 21'
23- distribution : ' adopt'
24- cache : ' gradle'
25-
26- - name : Grant execute permission for gradlew
27- run : chmod +x gradlew
23+ DISTRIBUTION : ' adopt'
2824
2925 - name : Get the version
3026 id : get_version
5450 generate_release_notes : true
5551 fail_on_unmatched_files : true
5652 files : ./build/libs/besu-fleet-plugin-${{ steps.get_version.outputs.VERSION }}.jar
57-
58- - name : Authneticate JFrog
59- id : jfrog
60- uses : jfrog/setup-jfrog-cli@v4
61- env :
62- JF_URL : " https://consensys.jfrog.io"
63- with :
64- oidc-provider-name : ' github'
65- oidc-audience : ' '
6653
67- - name : Publish Artifactory
68- id : artifactory
69- run : ./gradlew artifactoryPublish -PreleaseVersion=${{ steps.get_version.outputs.VERSION }}
70- env :
71- ARTIFACTORY_USER : ${{ steps.jfrog.outputs.oidc-user }}
72- ARTIFACTORY_PASSWORD : ${{ steps.jfrog.outputs.oidc-token }}
54+ - name : Publish to artifactory
55+ if : " !startsWith(github.ref, 'refs/tags/')"
56+ uses : ./.github/actions/publish-to-artifactory
57+ with :
58+ publish-version : ${{ steps.get_version.outputs.VERSION }}
Original file line number Diff line number Diff line change @@ -235,6 +235,12 @@ task plugin(dependsOn: 'jar') {
235235 description ' Alias for the jar task'
236236}
237237
238+ task printVersion () {
239+ doFirst {
240+ println " specific-version=${ calculateVersion()} "
241+ println " publish-version=${ project.version} "
242+ }
243+ }
238244
239245@Memoized
240246def calculateVersion () {
You can’t perform that action at this time.
0 commit comments