-
Notifications
You must be signed in to change notification settings - Fork 357
179 lines (149 loc) · 4.93 KB
/
release.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
name: Full Release
on:
pull_request:
branches:
- master
types: [closed]
env:
artifactId: gaffer2
MAVEN_OPTS: -Dmaven.wagon.http.retryHandler.count=3 -Dmaven.wagon.httpconnectionManager.ttlSeconds=25
jobs:
deploy-release:
if: ${{ github.event.pull_request.merged }}
runs-on: ubuntu-latest
outputs:
release_version: ${{ steps.release-version.outputs.release_version }}
steps:
- name: Setup JDK
uses: actions/setup-java@v4
with:
distribution: 'zulu'
java-version: '8'
- name: Checkout master
uses: actions/checkout@v4
with:
ref: master
token: ${{ secrets.ADMIN_GITHUB_TOKEN }}
fetch-depth: 0
- name: Set up Github credentials
run: |
git config user.name github-actions[bot]
git config user.email 41898282+github-actions[bot]@users.noreply.github.com
- name: Output release version
id: release-version
run: |
echo "release_version=$(mvn -q help:evaluate -DforceStdout -Dexpression=pom.version)" >> $GITHUB_OUTPUT
generate-javadoc:
runs-on: ubuntu-latest
needs:
- deploy-release
steps:
- name: Checkout Master
uses: actions/checkout@v4
with:
ref: master
token: ${{ secrets.ADMIN_GITHUB_TOKEN }}
- name: Set up Github credentials
run: |
git config user.name github-actions[bot]
git config user.email 41898282+github-actions[bot]@users.noreply.github.com
- name: Setup JDK
uses: actions/setup-java@v4
with:
distribution: 'zulu'
java-version: '11'
- name: Set version
run: echo "RELEASE_VERSION=$(echo ${{ needs.deploy-release.outputs.release_version }})" >> $GITHUB_ENV
- name: Upload Javadoc
run: |
git remote set-branches --add origin gh-pages
git pull
mvn -q clean install -Pquick -Dskip.jar-with-dependencies=true -Dshaded.jar.phase=true
mvn -q javadoc:aggregate
git checkout gh-pages
rm -rf uk
rm -rf jquery
rm -rf resources
cp -rlf target/site/apidocs/* .
git add .
git commit -a -m "Updated javadoc - $RELEASE_VERSION"
git push
release-to-nexus:
runs-on: ubuntu-latest
needs:
- deploy-release
steps:
- name: Setup JDK
uses: actions/setup-java@v4
with:
distribution: 'zulu'
java-version: '8'
- name: Checkout release
uses: actions/checkout@v4
with:
ref: master
- name: Decode CodeSigning key
env:
CODE_SIGNING_KEY: ${{ secrets.CODE_SIGNING_KEY }}
CODE_SIGNING_IV: ${{ secrets.CODE_SIGNING_IV }}
run: openssl aes-256-cbc -K "$CODE_SIGNING_KEY" -iv "$CODE_SIGNING_IV" -in cd/codesigning.asc.enc -out cd/codesigning.asc -d
- name: Import CodeSigning key
run: gpg --batch --fast-import cd/codesigning.asc
- name: Release to Nexus
env:
GPG_KEY_NAME: ${{ secrets.GPG_KEY_NAME }}
GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }}
OSS_NEXUS_USERNAME: ${{ secrets.OSS_NEXUS_USERNAME }}
OSS_NEXUS_PASSWORD: ${{ secrets.OSS_NEXUS_PASSWORD }}
run:
mvn deploy -P quick,ossrh-release --settings cd/mvnsettings.xml -B
update-github-releases:
runs-on: ubuntu-latest
needs:
- deploy-release
steps:
- name: Checkout Master
uses: actions/checkout@v4
with:
ref: master
- name: Set version
run: echo "RELEASE_VERSION=$(echo ${{ needs.deploy-release.outputs.release_version }})" >> $GITHUB_ENV
- name: Create github release
uses: softprops/action-gh-release@v2
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ env.artifactId }}-${{ env.RELEASE_VERSION }}
name: Gaffer ${{ env.RELEASE_VERSION }}
update-develop:
runs-on: ubuntu-latest
needs:
- deploy-release
steps:
- name: Checkout develop
uses: actions/checkout@v4
with:
ref: develop
token: ${{ secrets.ADMIN_GITHUB_TOKEN }}
fetch-depth: 0
- name: Set up Github credentials
run: |
git config user.name github-actions[bot]
git config user.email 41898282+github-actions[bot]@users.noreply.github.com
- name: Setup JDK
uses: actions/setup-java@v4
with:
distribution: 'zulu'
java-version: '8'
- name: Merge master into develop
run: |
git merge origin/master
- name: Update develop branch
run: |
git checkout develop
mvn versions:set-property -Dproperty=revision -DnewVersion=$(echo ${{ needs.deploy-release.outputs.release_version }})-SNAPSHOT
mvn build-helper:parse-version versions:set-property \
-Dproperty=revision \
-DnewVersion=\${parsedVersion.majorVersion}.\${parsedVersion.minorVersion}.\${parsedVersion.nextIncrementalVersion}-SNAPSHOT
git commit -a -m "prepare for next development iteration"
git push