34
34
permissions :
35
35
id-token : write # To sign the artifacts
36
36
runs-on : ubuntu-latest
37
- needs : [ci, process-tag]
38
- outputs :
39
- hashes : ${{ steps.hash.outputs.hashes }}
37
+ needs : [ci]
40
38
steps :
41
- - name : checkout tag
39
+ - name : Checkout tag
42
40
uses : actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
43
41
44
42
- name : Set up JDK 11
47
45
java-version : 11
48
46
distribution : ' temurin'
49
47
48
+ - name : Setup Gradle
49
+ uses : gradle/actions/setup-gradle@417ae3ccd767c252f5661f1ace9f835f9654f2b5 # v3.1.0
50
+
50
51
- name : Build, Sign and Release to Gradle Plugin Portal
51
52
run : |
52
53
./gradlew publishPlugins -Prelease -Pgradle.publish.key=$GRADLE_PUBLISH_KEY -Pgradle.publish.secret=$GRADLE_PUBLISH_SECRET
@@ -56,63 +57,15 @@ jobs:
56
57
GRADLE_PUBLISH_KEY : ${{ secrets.GRADLE_PUBLISH_KEY }}
57
58
GRADLE_PUBLISH_SECRET : ${{ secrets.GRADLE_PUBLISH_SECRET }}
58
59
59
- - name : SLSA -- Hash Artifacts
60
- id : hash
61
- run : |
62
- mkdir slsa-files
63
- cp sigstore-gradle/sigstore-gradle-sign-plugin/build/libs/*.jar slsa-files
64
- cp sigstore-gradle/sigstore-gradle-sign-plugin/build/publications/pluginMaven/pom-default.xml slsa-files/sigstore-gradle-sign-plugin-${{ needs.process-tag.outputs.version }}.pom
65
- cp sigstore-gradle/sigstore-gradle-sign-plugin/build/publications/pluginMaven/module.json slsa-files/sigstore-gradle-sign-plugin-${{ needs.process-tag.outputs.version }}.module
66
- cp sigstore-gradle/sigstore-gradle-sign-base-plugin/build/libs/*.jar slsa-files
67
- cp sigstore-gradle/sigstore-gradle-sign-base-plugin/build/publications/pluginMaven/pom-default.xml slsa-files/sigstore-gradle-sign-base-plugin-${{ needs.process-tag.outputs.version }}.pom
68
- cp sigstore-gradle/sigstore-gradle-sign-base-plugin/build/publications/pluginMaven/module.json slsa-files/sigstore-gradle-sign-base-plugin-${{ needs.process-tag.outputs.version }}.module
69
- cd slsa-files
70
- echo "hashes=$(sha256sum ./* | base64 -w0)" >> $GITHUB_OUTPUT
71
-
72
- - name : Upload build artifacts
73
- uses : actions/upload-artifact@5d5d22a31266ced268874388b861e4b58bb5c2f3 # v4.3.1
74
- with :
75
- name : project-release-artifacts
76
- path : ./slsa-files
77
- if-no-files-found : error
78
-
79
- provenance :
80
- needs : [build, process-tag]
81
- permissions :
82
- actions : read # To read the workflow path.
83
- id-token : write # To sign the provenance.
84
- contents : write # To add assets to a release.
85
- # use tags here: https://github.com/slsa-framework/slsa-github-generator#referencing-slsa-builders-and-generators
86
- # remember to update "Download Attestations" when SLSA updates to actions/download-artifact@v4
87
- uses :
slsa-framework/slsa-github-generator/.github/workflows/[email protected]
88
- with :
89
- provenance-name : " sigstore-gradle-sign-plugin-${{ needs.process-tag.outputs.version }}.attestation.intoto.jsonl"
90
- base64-subjects : " ${{ needs.build.outputs.hashes }}"
91
-
92
60
create-release-on-github :
93
61
runs-on : ubuntu-latest
94
- needs : [provenance, build, process-tag ]
62
+ needs : [build]
95
63
permissions :
96
64
contents : write
97
65
steps :
98
- - name : Download attestation
99
- # keep at v3.x since slsa generator uses 3.x (update this when slsa-framework updates)
100
- uses : actions/download-artifact@9bc31d5ccc31df68ecc42ccf4149144866c47d8a # v3.0.2
101
- with :
102
- name : " ${{ needs.provenance.outputs.attestation-name }}"
103
- path : ./release/
104
- - name : Copy attestation for base plugin
105
- run : |
106
- cp "./release/${{ needs.provenance.outputs.attestation-name }}" "./release/sigstore-gradle-sign-base-plugin-${{ needs.process-tag.outputs.version }}.attestation.intoto.jsonl"
107
- - name : Download gradle release artifacts
108
- uses : actions/download-artifact@6b208ae046db98c579e8a3aa621ab581ff575935 # v4.1.1
109
- with :
110
- name : project-release-artifacts
111
- path : ./release/
112
66
- name : Create release
113
67
uses : softprops/action-gh-release@de2c0eb89ae2a093876385947365aca7b0e5f844 # tag=v0.1.15
114
68
with :
115
- tag_name : v ${{ needs.process-tag.outputs.version }}
116
- name : v ${{ needs.process-tag.outputs.version }}-gradle
69
+ tag_name : ${{ github.ref_name }}
70
+ name : ${{ github.ref_name }}-gradle
117
71
body : " See [CHANGELOG.md](https://github.com/${{ vars.GITHUB_REPOSITORY }}/blob/main/CHANGELOG.md) for more details."
118
- files : ./release/*
0 commit comments