22#
33# SPDX-License-Identifier: Apache-2.0
44
5+ name : Release
56
6- # Workflow will only run on tag creation. It will run the integration tests first to confirm that the build is sound and then
7- # and only then do the publishing
8- name : Publish Workflow
97on :
108 create :
119 tags :
12- - " * "
10+ - ' * '
1311 workflow_dispatch :
14-
12+
1513jobs :
16-
17- # Run the integration tests on the repo, before moving to the publishing.
18- # Run the integration tests on the repo
19- publish_call_intergationtest :
20- uses : ./.github/workflows/integrationtest.yml
14+ test :
15+ uses : ./.github/workflows/test.yaml
2116
22-
2317 # Publishing steps to both the Github Packages and the Sonatype
2418 publishjars :
2519 strategy :
2620 fail-fast : false
2721 matrix :
28- publish_target : ["publishAllPublicationsToGithubPackagesRepository","publishAllPublicationsToReleaseRepository"]
22+ publish_target :
23+ - publishAllPublicationsToGithubPackagesRepository
24+ - publishAllPublicationsToReleaseRepository
2925 runs-on : ubuntu-latest
30- needs : [publish_call_intergationtest]
26+ needs : test
3127 steps :
3228 - uses : actions/checkout@v3
3329 - uses : actions/setup-java@v3
@@ -36,12 +32,12 @@ jobs:
3632 java-version : ' 11'
3733 cache : ' gradle'
3834 - name : Validate Gradle wrapper
39- uses : gradle/wrapper-validation-action@v1.0.5
35+ uses : gradle/wrapper-validation-action@v1
4036 - name : Push to registry ${{ matrix.publish_target }}
4137 run : |
4238 set -xev
4339 ./gradlew -Psigning.key="${SIGNING_KEY}" -Psigning.password="${SIGNING_PASSWORD}" -PossrhUsername="${OSSRH_USER}" -PossrhPassword="${OSSRH_PASSWORD}" ${TARGET}
44- env :
40+ env :
4541 SIGNING_PASSWORD : ${{ secrets.OSSRH_GPG_SECRET_KEY_PASSWORD }}
4642 SIGNING_KEY : ${{ secrets.OSSRH_GPG_SECRET_KEY }}
4743 OSSRH_USER : ${{ secrets.OSSRH_USERNAME }}
5450 strategy :
5551 fail-fast : false
5652 matrix :
57- DOCKER_REGISTRY : ["docker.io","ghcr.io"]
53+ DOCKER_REGISTRY :
54+ - ' docker.io'
55+ - ' ghcr.io'
5856 runs-on : ubuntu-latest
59- needs : [publish_call_intergationtest]
57+ needs : test
6058 permissions :
6159 contents : read
6260 packages : write
@@ -68,31 +66,27 @@ jobs:
6866 java-version : ' 11'
6967 cache : ' gradle'
7068 - name : Validate Gradle wrapper
71- uses : gradle/wrapper-validation-action@v1.0.5
72- - name : Build the depencies needed for the image
73- uses : gradle/gradle-build-action@v2.3.3
69+ uses : gradle/wrapper-validation-action@v1
70+ - name : Build the dependencies needed for the image
71+ uses : gradle/gradle-build-action@v2
7472 with :
75- arguments : |
76- :fabric-chaincode-docker:copyAllDeps -x dependencyCheckAnalyze
77-
73+ arguments : |
74+ :fabric-chaincode-docker:copyAllDeps -x dependencyCheckAnalyze
7875 - name : Set up QEMU
7976 uses : docker/setup-qemu-action@v2
80-
8177 - name : Set up Docker Buildx
8278 uses : docker/setup-buildx-action@v2
8379 with :
8480 buildkitd-flags : --debug
8581 config-inline : |
8682 [worker.oci]
8783 max-parallelism = 1
88-
8984 - name : Login to the ${{ matrix.DOCKER_REGISTRY }} Container Registry
9085 uses : docker/login-action@v2
9186 with :
9287 registry : ${{ matrix.DOCKER_REGISTRY }}
9388 username : ${{ matrix.DOCKER_REGISTRY == 'docker.io' && secrets.DOCKERHUB_USERNAME || github.actor }}
9489 password : ${{ matrix.DOCKER_REGISTRY == 'docker.io' && secrets.DOCKERHUB_TOKEN || secrets.GITHUB_TOKEN }}
95-
9690 - name : Docker meta
9791 id : meta
9892 uses : docker/metadata-action@v4
@@ -112,4 +106,3 @@ jobs:
112106 tags : ${{ steps.meta.outputs.tags }}
113107 push : ${{ github.event_name != 'pull_request' }}
114108 labels : ${{ steps.meta.outputs.labels }}
115-
0 commit comments