1
- # GH_TOKEN
1
+ # GITHUB_TOKEN
2
2
# NEXUS_USER
3
3
# NEXUS_PASS64 (base64 NOTE: `base64` and `openssl base64` failed, had to use Java
4
4
# byte[] data = "{{password}}".getBytes(StandardCharsets.UTF_8);
@@ -30,13 +30,17 @@ jobs:
30
30
runs-on : ubuntu-latest
31
31
name : deploy
32
32
env :
33
- gh_token : ${{ secrets.GH_TOKEN }}
33
+ GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
34
34
ORG_GRADLE_PROJECT_nexus_user : ${{ secrets.NEXUS_USER }}
35
35
ORG_GRADLE_PROJECT_nexus_pass64 : ${{ secrets.NEXUS_PASS64 }}
36
36
ORG_GRADLE_PROJECT_gpg_passphrase : ${{ secrets.GPG_PASSPHRASE }}
37
37
ORG_GRADLE_PROJECT_gpg_key64 : ${{ secrets.GPG_KEY64 }}
38
+ permissions :
39
+ contents : write
38
40
steps :
39
41
- uses : actions/checkout@v4
42
+ with :
43
+ fetch-depth : 0 # All tags should be fetched.
40
44
- name : jdk 11
41
45
uses : actions/setup-java@v4
42
46
with :
@@ -46,23 +50,69 @@ jobs:
46
50
uses : gradle/actions/setup-gradle@v3
47
51
with :
48
52
gradle-home-cache-cleanup : true
49
- - name : git fetch origin main
50
- run : git fetch origin main
53
+ - name : Generate release name for lib
54
+ if : github.event.inputs.to_publish == 'all' || github.event.inputs.to_publish == 'lib'
55
+ run : |
56
+ # Find the latest tag in the lib/ namespace
57
+ export LIB_TAG=$(git tag --sort=-creatordate --list 'lib/*' | head -n 1)
58
+ echo "LIB_TAG=$LIB_TAG" >> $GITHUB_ENV
59
+ # Generate the release name looks like "Lib 1.2.3"
60
+ echo "LIB_NAME=Lib $(echo $LIB_TAG | cut -d'/' -f2)" >> $GITHUB_ENV
61
+ - name : Extract release notes for lib
62
+ if : github.event.inputs.to_publish == 'all' || github.event.inputs.to_publish == 'lib'
63
+ uses : ffurrer2/extract-release-notes@v2
64
+ with :
65
+ changelog_file : CHANGES.md
66
+ release_notes_file : RELEASE_NOTES_FOR_LIB.md
67
+ - name : Generate release name for Gradle plugin
68
+ if : github.event.inputs.to_publish == 'all' || github.event.inputs.to_publish == 'plugin-gradle'
69
+ run : |
70
+ # Find the latest tag in the gradle/ namespace
71
+ export PLUGIN_GRADLE_TAG=$(git tag --sort=-creatordate --list 'gradle/*' | head -n 1)
72
+ echo "PLUGIN_GRADLE_TAG=$PLUGIN_GRADLE_TAG" >> $GITHUB_ENV
73
+ # Generate the release name looks like "Gradle Plugin 1.2.3"
74
+ echo "PLUGIN_GRADLE_NAME=Gradle Plugin $(echo $PLUGIN_GRADLE_TAG | cut -d'/' -f2)" >> $GITHUB_ENV
75
+ - name : Extract release notes for Gradle plugin
76
+ if : github.event.inputs.to_publish == 'all' || github.event.inputs.to_publish == 'plugin-gradle'
77
+ uses : ffurrer2/extract-release-notes@v2
78
+ with :
79
+ changelog_file : plugin-gradle/CHANGES.md
80
+ release_notes_file : RELEASE_NOTES_FOR_PLUGIN_GRADLE.md
81
+ - name : Generate release name for Maven plugin
82
+ if : github.event.inputs.to_publish == 'all' || github.event.inputs.to_publish == 'plugin-maven'
83
+ run : |
84
+ # Find the latest tag in the maven/ namespace
85
+ export PLUGIN_MAVEN_TAG=$(git tag --sort=-creatordate --list 'maven/*' | head -n 1)
86
+ echo "PLUGIN_MAVEN_TAG=$PLUGIN_MAVEN_TAG" >> $GITHUB_ENV
87
+ # Generate the release name looks like "Maven Plugin 1.2.3"
88
+ echo "PLUGIN_MAVEN_NAME=Maven Plugin $(echo $PLUGIN_MAVEN_TAG | cut -d'/' -f2)" >> $GITHUB_ENV
89
+ - name : Extract release notes for Maven plugin
90
+ if : github.event.inputs.to_publish == 'all' || github.event.inputs.to_publish == 'plugin-maven'
91
+ uses : ffurrer2/extract-release-notes@v2
92
+ with :
93
+ changelog_file : plugin-maven/CHANGES.md
94
+ release_notes_file : RELEASE_NOTES_FOR_PLUGIN_MAVEN.md
51
95
- name : publish all
52
96
if : " ${{ github.event.inputs.to_publish == 'all' }}"
53
97
run : |
54
98
./gradlew :changelogPush -Prelease=true --stacktrace --warning-mode all --no-configuration-cache
55
99
./gradlew :plugin-gradle:changelogPush -Prelease=true -Pgradle.publish.key=${{ secrets.GRADLE_KEY }} -Pgradle.publish.secret=${{ secrets.GRADLE_SECRET }} --stacktrace --warning-mode all --no-configuration-cache
56
100
./gradlew :plugin-maven:changelogPush -Prelease=true --stacktrace --warning-mode all --no-configuration-cache
101
+ gh release create ${{ env.LIB_TAG }} --title '${{ env.LIB_NAME }}' --notes-file RELEASE_NOTES_FOR_LIB.md
102
+ gh release create ${{ env.PLUGIN_GRADLE_TAG }} --title '${{ env.PLUGIN_GRADLE_NAME }}' --notes-file RELEASE_NOTES_FOR_PLUGIN_GRADLE.md
103
+ gh release create ${{ env.PLUGIN_MAVEN_TAG }} --title '${{ env.PLUGIN_MAVEN_NAME }}' --notes-file RELEASE_NOTES_FOR_PLUGIN_MAVEN.md
57
104
- name : publish just plugin-gradle
58
105
if : " ${{ github.event.inputs.to_publish == 'plugin-gradle' }}"
59
106
run : |
60
107
./gradlew :plugin-gradle:changelogPush -Prelease=true -Pgradle.publish.key=${{ secrets.GRADLE_KEY }} -Pgradle.publish.secret=${{ secrets.GRADLE_SECRET }} --stacktrace --warning-mode all --no-configuration-cache
108
+ gh release create ${{ env.PLUGIN_GRADLE_TAG }} --title '${{ env.PLUGIN_GRADLE_NAME }}' --notes-file RELEASE_NOTES_FOR_PLUGIN_GRADLE.md
61
109
- name : publish just plugin-maven
62
110
if : " ${{ github.event.inputs.to_publish == 'plugin-maven' }}"
63
111
run : |
64
112
./gradlew :plugin-maven:changelogPush -Prelease=true --stacktrace --warning-mode all --no-configuration-cache
113
+ gh release create ${{ env.PLUGIN_MAVEN_TAG }} --title '${{ env.PLUGIN_MAVEN_NAME }}' --notes-file RELEASE_NOTES_FOR_PLUGIN_MAVEN.md
65
114
- name : publish just lib
66
115
if : " ${{ github.event.inputs.to_publish == 'lib' }}"
67
116
run : |
68
117
./gradlew :changelogPush -Prelease=true --stacktrace --warning-mode all --no-configuration-cache
118
+ gh release create ${{ env.LIB_TAG }} --title '${{ env.LIB_NAME }}' --notes-file RELEASE_NOTES_FOR_LIB.md
0 commit comments