-
-
Notifications
You must be signed in to change notification settings - Fork 5
292 lines (265 loc) · 17.7 KB
/
maven.yml
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
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
# This workflow will build a Java project with Maven, and cache/restore any dependencies to improve the workflow execution time
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-java-with-maven
# This workflow uses actions that are not certified by GitHub.
# They are provided by a third-party and are governed by
# separate terms of service, privacy policy, and support
# documentation.
name: NBM CI with Maven
#on:
# push:
# branches: [ "master" ]
# pull_request:
# branches: [ "master" ]
on:
workflow_dispatch:
# Inputs the workflow accepts.
#inputs:
#name:
# Friendly description to be shown in the UI instead of 'name'
#description: 'Person to greet'
# Default value if no value is explicitly provided
#default: 'World'
# Input has to be provided for the workflow to run
#required: false
jobs:
build:
runs-on: ubuntu-latest
permissions: write-all
steps:
- uses: actions/checkout@v3
- name: Set up JDK 11
uses: actions/setup-java@v3
with:
java-version: '11'
distribution: 'temurin'
cache: maven
#Maven Publish to Github
#server-id: github # Value of the distributionManagement/repository/id field of the pom.xml
#settings-path: ${{ github.workspace }} # location for the settings.xml file
#Maven Publish to Central
server-id: ossrh
server-username: MAVEN_USERNAME
server-password: MAVEN_PASSWORD
gpg-private-key: ${{ secrets.OSSRH_GPG_SECRET_KEY }}
gpg-passphrase: MAVEN_GPG_PASSPHRASE
#TODO
- name: Get Next Version
run: |
echo "RELEASE_VERSION=$(mvn help:evaluate -Dproject.version=next.version -Dexpression=next.version -q -DforceStdout)" >> $GITHUB_ENV
echo "RELEASE_DAY=$(date +%d)" >> $GITHUB_ENV
echo "RELEASE_MONTH=$(date +%m)" >> $GITHUB_ENV
echo "RELEASE_YEAR=$(date +%y)" >> $GITHUB_ENV
- name: Get Previous Version
run: |
echo "PREVIOUS_VERSION=$(mvn help:evaluate -Dproject.version=next.version -Dexpression=previous.version -q -DforceStdout)" >> $GITHUB_ENV
- name: Set Spec Version
run: |
sed -i "s/OpenIDE-Module-Specification-Version:.*/OpenIDE-Module-Specification-Version: ${{ env.RELEASE_VERSION }}/" src/main/nbm/manifest.mf
- name: Build with RELEASE130
run: |
mvn -B clean deploy -Dnetbeans.release.version=RELEASE130 -Dnext.version=RELEASE130-${{ env.RELEASE_VERSION }} -DuntaggedName=${{ env.RELEASE_VERSION }} -DfromRef=${{ env.PREVIOUS_VERSION }} -DgitHubToken=${{ env.GITHUB_TOKEN }}
echo "SIZE_13=$(wc -c target/nbm/python-RELEASE130-${{ env.RELEASE_VERSION }}.nbm | awk '{print $1}')" >> $GITHUB_ENV
env:
MAVEN_USERNAME: ${{ secrets.OSSRH_USERNAME }}
MAVEN_PASSWORD: ${{ secrets.OSSRH_TOKEN }}
MAVEN_GPG_PASSPHRASE: ${{ secrets.OSSRH_GPG_SECRET_KEY_PASSWORD }}
GITHUB_TOKEN: ${{ github.token }}
- name: Create Release
uses: actions/create-release@v1
id: create_release
with:
draft: false
prerelease: false
release_name: ${{ github.event.repository.name }} ${{ env.RELEASE_VERSION }}
tag_name: ${{ env.RELEASE_VERSION }}
#TODO
#body_path: CHANGELOG.md
env:
GITHUB_TOKEN: ${{ github.token }}
- name: Attach RELEASE130 NBM
uses: actions/upload-release-asset@v1
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: target/nbm/python-RELEASE130-${{ env.RELEASE_VERSION }}.nbm
asset_name: python-RELEASE130-${{ env.RELEASE_VERSION }}.nbm
asset_content_type: application/gzip
env:
GITHUB_TOKEN: ${{ github.token }}
- name: Build with RELEASE140
run: |
mvn -B clean deploy -Dnetbeans.release.version=RELEASE140 -Dnext.version=RELEASE140-${{ env.RELEASE_VERSION }}
echo "SIZE_14=$(wc -c target/nbm/python-RELEASE140-${{ env.RELEASE_VERSION }}.nbm | awk '{print $1}')" >> $GITHUB_ENV
env:
MAVEN_USERNAME: ${{ secrets.OSSRH_USERNAME }}
MAVEN_PASSWORD: ${{ secrets.OSSRH_TOKEN }}
MAVEN_GPG_PASSPHRASE: ${{ secrets.OSSRH_GPG_SECRET_KEY_PASSWORD }}
- name: Attach RELEASE140 NBM
uses: actions/upload-release-asset@v1
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: target/nbm/python-RELEASE140-${{ env.RELEASE_VERSION }}.nbm
asset_name: python-RELEASE140-${{ env.RELEASE_VERSION }}.nbm
asset_content_type: application/gzip
env:
GITHUB_TOKEN: ${{ github.token }}
- name: Build with RELEASE150
run: |
mvn -B clean deploy -Dnetbeans.release.version=RELEASE150 -Dnext.version=RELEASE150-${{ env.RELEASE_VERSION }}
echo "SIZE_15=$(wc -c target/nbm/python-RELEASE150-${{ env.RELEASE_VERSION }}.nbm | awk '{print $1}')" >> $GITHUB_ENV
env:
MAVEN_USERNAME: ${{ secrets.OSSRH_USERNAME }}
MAVEN_PASSWORD: ${{ secrets.OSSRH_TOKEN }}
MAVEN_GPG_PASSPHRASE: ${{ secrets.OSSRH_GPG_SECRET_KEY_PASSWORD }}
- name: Attach RELEASE150 NBM
uses: actions/upload-release-asset@v1
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: target/nbm/python-RELEASE150-${{ env.RELEASE_VERSION }}.nbm
asset_name: python-RELEASE150-${{ env.RELEASE_VERSION }}.nbm
asset_content_type: application/gzip
env:
GITHUB_TOKEN: ${{ github.token }}
- name: Build with RELEASE160
run: |
mvn -B clean deploy -Dnetbeans.release.version=RELEASE160 -Dnext.version=RELEASE160-${{ env.RELEASE_VERSION }}
echo "SIZE_16=$(wc -c target/nbm/python-RELEASE160-${{ env.RELEASE_VERSION }}.nbm | awk '{print $1}')" >> $GITHUB_ENV
env:
MAVEN_USERNAME: ${{ secrets.OSSRH_USERNAME }}
MAVEN_PASSWORD: ${{ secrets.OSSRH_TOKEN }}
MAVEN_GPG_PASSPHRASE: ${{ secrets.OSSRH_GPG_SECRET_KEY_PASSWORD }}
- name: Attach RELEASE160 NBM
uses: actions/upload-release-asset@v1
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: target/nbm/python-RELEASE160-${{ env.RELEASE_VERSION }}.nbm
asset_name: python-RELEASE160-${{ env.RELEASE_VERSION }}.nbm
asset_content_type: application/gzip
env:
GITHUB_TOKEN: ${{ github.token }}
- name: Build with RELEASE170
run: |
mvn -B clean deploy -Dnetbeans.release.version=RELEASE170 -Dnext.version=RELEASE170-${{ env.RELEASE_VERSION }}
echo "SIZE_17=$(wc -c target/nbm/python-RELEASE170-${{ env.RELEASE_VERSION }}.nbm | awk '{print $1}')" >> $GITHUB_ENV
env:
MAVEN_USERNAME: ${{ secrets.OSSRH_USERNAME }}
MAVEN_PASSWORD: ${{ secrets.OSSRH_TOKEN }}
MAVEN_GPG_PASSPHRASE: ${{ secrets.OSSRH_GPG_SECRET_KEY_PASSWORD }}
- name: Attach RELEASE170 NBM
uses: actions/upload-release-asset@v1
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: target/nbm/python-RELEASE170-${{ env.RELEASE_VERSION }}.nbm
asset_name: python-RELEASE170-${{ env.RELEASE_VERSION }}.nbm
asset_content_type: application/gzip
env:
GITHUB_TOKEN: ${{ github.token }}
- name: Build with RELEASE180
run: |
mvn -B clean deploy -Dnetbeans.release.version=RELEASE180 -Dnext.version=RELEASE180-${{ env.RELEASE_VERSION }}
echo "SIZE_18=$(wc -c target/nbm/python-RELEASE180-${{ env.RELEASE_VERSION }}.nbm | awk '{print $1}')" >> $GITHUB_ENV
env:
MAVEN_USERNAME: ${{ secrets.OSSRH_USERNAME }}
MAVEN_PASSWORD: ${{ secrets.OSSRH_TOKEN }}
MAVEN_GPG_PASSPHRASE: ${{ secrets.OSSRH_GPG_SECRET_KEY_PASSWORD }}
- name: Attach RELEASE180 NBM
uses: actions/upload-release-asset@v1
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: target/nbm/python-RELEASE180-${{ env.RELEASE_VERSION }}.nbm
asset_name: python-RELEASE180-${{ env.RELEASE_VERSION }}.nbm
asset_content_type: application/gzip
env:
GITHUB_TOKEN: ${{ github.token }}
- name: Build with RELEASE190
run: |
mvn -B clean deploy -Dnetbeans.release.version=RELEASE190 -Dnext.version=RELEASE190-${{ env.RELEASE_VERSION }}
echo "SIZE_19=$(wc -c target/nbm/python-RELEASE190-${{ env.RELEASE_VERSION }}.nbm | awk '{print $1}')" >> $GITHUB_ENV
env:
MAVEN_USERNAME: ${{ secrets.OSSRH_USERNAME }}
MAVEN_PASSWORD: ${{ secrets.OSSRH_TOKEN }}
MAVEN_GPG_PASSPHRASE: ${{ secrets.OSSRH_GPG_SECRET_KEY_PASSWORD }}
- name: Attach RELEASE190 NBM
uses: actions/upload-release-asset@v1
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: target/nbm/python-RELEASE190-${{ env.RELEASE_VERSION }}.nbm
asset_name: python-RELEASE190-${{ env.RELEASE_VERSION }}.nbm
asset_content_type: application/gzip
env:
GITHUB_TOKEN: ${{ github.token }}
#TODO
# - name: Update PPUCs
# id: my_string
# run: |
# STRING_13=$(cat << 'EOF'
# <?xml version=\"1.0\" encoding=\"UTF-8\" ?><!DOCTYPE module_updates PUBLIC \"-//NetBeans//DTD Autoupdate Catalog 2.8//EN\" \"http://www.netbeans.org/dtds/autoupdate-catalog-2_8.dtd\">
# <module_updates timestamp=\"00/00/00/${{env.RELEASE_DAY}}/${{env.RELEASE_MONTH}}/${{env.RELEASE_YEAR}}\">
# <module codenamebase=\"io.github.albilu.python\" distribution=\"https://github.com/albilu/netbeansPython/releases/download/${{env.RELEASE_VERSION}}/python-RELEASE130-${{env.RELEASE_VERSION}}.nbm\" downloadsize=\"${{env.SIZE_13}}\" homepage=\"https://github.com/albilu/netbeansPython\" moduleauthor=\"albilu\" needsrestart=\"true\" releasedate=\"20${{env.RELEASE_YEAR}}/${{env.RELEASE_MONTH}}/${{env.RELEASE_DAY}}\">
# <manifest OpenIDE-Module=\"io.github.albilu.python\" AutoUpdate-Show-In-Client=\"true\" OpenIDE-Module-Display-Category=\"Editing\" OpenIDE-Module-Implementation-Version=\"RELEASE130-${{env.RELEASE_VERSION}}\" OpenIDE-Module-Name=\"Python\" OpenIDE-Module-Requires=\"org.openide.windows.WindowManager\" OpenIDE-Module-Short-Description=\"Netbeans Support for Python\" OpenIDE-Module-Specification-Version=\"${{env.RELEASE_VERSION}}\"/>
# </module>
# </module_updates>
# EOF
# )
# STRING_14=$(cat << 'EOF'
# <?xml version=\"1.0\" encoding=\"UTF-8\" ?><!DOCTYPE module_updates PUBLIC \"-//NetBeans//DTD Autoupdate Catalog 2.8//EN\" \"http://www.netbeans.org/dtds/autoupdate-catalog-2_8.dtd\">
# <module_updates timestamp=\"00/00/00/${{env.RELEASE_DAY}}/${{env.RELEASE_MONTH}}/${{env.RELEASE_YEAR}}\">
# <module codenamebase=\"io.github.albilu.python\" distribution=\"https://github.com/albilu/netbeansPython/releases/download/${{env.RELEASE_VERSION}}/python-RELEASE140-${{env.RELEASE_VERSION}}.nbm\" downloadsize=\"${{env.SIZE_14}}\" homepage=\"https://github.com/albilu/netbeansPython\" moduleauthor=\"albilu\" needsrestart=\"true\" releasedate=\"20${{env.RELEASE_YEAR}}/${{env.RELEASE_MONTH}}/${{env.RELEASE_DAY}}\">
# <manifest OpenIDE-Module=\"io.github.albilu.python\" AutoUpdate-Show-In-Client=\"true\" OpenIDE-Module-Display-Category=\"Editing\" OpenIDE-Module-Implementation-Version=\"RELEASE140-${{env.RELEASE_VERSION}}\" OpenIDE-Module-Name=\"Python\" OpenIDE-Module-Requires=\"org.openide.windows.WindowManager\" OpenIDE-Module-Short-Description=\"Netbeans Support for Python\" OpenIDE-Module-Specification-Version=\"${{env.RELEASE_VERSION}}\"/>
# </module>
# </module_updates>
# EOF
# )
# STRING_15=$(cat << 'EOF'
# <?xml version=\"1.0\" encoding=\"UTF-8\" ?><!DOCTYPE module_updates PUBLIC \"-//NetBeans//DTD Autoupdate Catalog 2.8//EN\" \"http://www.netbeans.org/dtds/autoupdate-catalog-2_8.dtd\">
# <module_updates timestamp=\"00/00/00/${{env.RELEASE_DAY}}/${{env.RELEASE_MONTH}}/${{env.RELEASE_YEAR}}\">
# <module codenamebase=\"io.github.albilu.python\" distribution=\"https://github.com/albilu/netbeansPython/releases/download/${{env.RELEASE_VERSION}}/python-RELEASE150-${{env.RELEASE_VERSION}}.nbm\" downloadsize=\"${{env.SIZE_15}}\" homepage=\"https://github.com/albilu/netbeansPython\" moduleauthor=\"albilu\" needsrestart=\"true\" releasedate=\"20${{env.RELEASE_YEAR}}/${{env.RELEASE_MONTH}}/${{env.RELEASE_DAY}}\">
# <manifest OpenIDE-Module=\"io.github.albilu.python\" AutoUpdate-Show-In-Client=\"true\" OpenIDE-Module-Display-Category=\"Editing\" OpenIDE-Module-Implementation-Version=\"RELEASE150-${{env.RELEASE_VERSION}}\" OpenIDE-Module-Name=\"Python\" OpenIDE-Module-Requires=\"org.openide.windows.WindowManager\" OpenIDE-Module-Short-Description=\"Netbeans Support for Python\" OpenIDE-Module-Specification-Version=\"${{env.RELEASE_VERSION}}\"/>
# </module>
# </module_updates>
# EOF
# )
# STRING_16=$(cat << 'EOF'
# <?xml version=\"1.0\" encoding=\"UTF-8\" ?><!DOCTYPE module_updates PUBLIC \"-//NetBeans//DTD Autoupdate Catalog 2.8//EN\" \"http://www.netbeans.org/dtds/autoupdate-catalog-2_8.dtd\">
# <module_updates timestamp=\"00/00/00/${{env.RELEASE_DAY}}/${{env.RELEASE_MONTH}}/${{env.RELEASE_YEAR}}\">
# <module codenamebase=\"io.github.albilu.python\" distribution=\"https://github.com/albilu/netbeansPython/releases/download/${{env.RELEASE_VERSION}}/python-RELEASE160-${{env.RELEASE_VERSION}}.nbm\" downloadsize=\"${{env.SIZE_16}}\" homepage=\"https://github.com/albilu/netbeansPython\" moduleauthor=\"albilu\" needsrestart=\"true\" releasedate=\"20${{env.RELEASE_YEAR}}/${{env.RELEASE_MONTH}}/${{env.RELEASE_DAY}}\">
# <manifest OpenIDE-Module=\"io.github.albilu.python\" AutoUpdate-Show-In-Client=\"true\" OpenIDE-Module-Display-Category=\"Editing\" OpenIDE-Module-Implementation-Version=\"RELEASE160-${{env.RELEASE_VERSION}}\" OpenIDE-Module-Name=\"Python\" OpenIDE-Module-Requires=\"org.openide.windows.WindowManager\" OpenIDE-Module-Short-Description=\"Netbeans Support for Python\" OpenIDE-Module-Specification-Version=\"${{env.RELEASE_VERSION}}\"/>
# </module>
# </module_updates>
# EOF
# )
# STRING_17=$(cat << 'EOF'
# <?xml version=\"1.0\" encoding=\"UTF-8\" ?><!DOCTYPE module_updates PUBLIC \"-//NetBeans//DTD Autoupdate Catalog 2.8//EN\" \"http://www.netbeans.org/dtds/autoupdate-catalog-2_8.dtd\">
# <module_updates timestamp=\"00/00/00/${{env.RELEASE_DAY}}/${{env.RELEASE_MONTH}}/${{env.RELEASE_YEAR}}\">
# <module codenamebase=\"io.github.albilu.python\" distribution=\"https://github.com/albilu/netbeansPython/releases/download/${{env.RELEASE_VERSION}}/python-RELEASE170-${{env.RELEASE_VERSION}}.nbm\" downloadsize=\"${{env.SIZE_17}}\" homepage=\"https://github.com/albilu/netbeansPython\" moduleauthor=\"albilu\" needsrestart=\"true\" releasedate=\"20${{env.RELEASE_YEAR}}/${{env.RELEASE_MONTH}}/${{env.RELEASE_DAY}}\">
# <manifest OpenIDE-Module=\"io.github.albilu.python\" AutoUpdate-Show-In-Client=\"true\" OpenIDE-Module-Display-Category=\"Editing\" OpenIDE-Module-Implementation-Version=\"RELEASE170-${{env.RELEASE_VERSION}}\" OpenIDE-Module-Name=\"Python\" OpenIDE-Module-Requires=\"org.openide.windows.WindowManager\" OpenIDE-Module-Short-Description=\"Netbeans Support for Python\" OpenIDE-Module-Specification-Version=\"${{env.RELEASE_VERSION}}\"/>
# </module>
# </module_updates>
# EOF
# )
# STRING_18=$(cat << 'EOF'
# <?xml version=\"1.0\" encoding=\"UTF-8\" ?><!DOCTYPE module_updates PUBLIC \"-//NetBeans//DTD Autoupdate Catalog 2.8//EN\" \"http://www.netbeans.org/dtds/autoupdate-catalog-2_8.dtd\">
# <module_updates timestamp=\"00/00/00/${{env.RELEASE_DAY}}/${{env.RELEASE_MONTH}}/${{env.RELEASE_YEAR}}\">
# <module codenamebase=\"io.github.albilu.python\" distribution=\"https://github.com/albilu/netbeansPython/releases/download/${{env.RELEASE_VERSION}}/python-RELEASE180-${{env.RELEASE_VERSION}}.nbm\" downloadsize=\"${{env.SIZE_18}}\" homepage=\"https://github.com/albilu/netbeansPython\" moduleauthor=\"albilu\" needsrestart=\"true\" releasedate=\"20${{env.RELEASE_YEAR}}/${{env.RELEASE_MONTH}}/${{env.RELEASE_DAY}}\">
# <manifest OpenIDE-Module=\"io.github.albilu.python\" AutoUpdate-Show-In-Client=\"true\" OpenIDE-Module-Display-Category=\"Editing\" OpenIDE-Module-Implementation-Version=\"RELEASE180-${{env.RELEASE_VERSION}}\" OpenIDE-Module-Name=\"Python\" OpenIDE-Module-Requires=\"org.openide.windows.WindowManager\" OpenIDE-Module-Short-Description=\"Netbeans Support for Python\" OpenIDE-Module-Specification-Version=\"${{env.RELEASE_VERSION}}\"/>
# </module>
# </module_updates>
# EOF
# )
# echo "$STRING_13" > ppuc/13/updates.xml
# echo "$STRING_14" > ppuc/14/updates.xml
# echo "$STRING_15" > ppuc/15/updates.xml
# echo "$STRING_16" > ppuc/16/updates.xml
# echo "$STRING_17" > ppuc/17/updates.xml
# echo "$STRING_18" > ppuc/18/updates.xml
# git config --global user.name "albilu"
# git config --global user.email "[email protected]"
# git add ppuc/\*.*
# git commit -m "Update PPUCs"
# git push --force origin master
#- name: Publish to GitHub Packages Apache Maven
# run: mvn deploy -s $GITHUB_WORKSPACE/settings.xml
# env:
# GITHUB_TOKEN: ${{ github.token }}
# Optional: Uploads the full dependency graph to GitHub to improve the quality of Dependabot alerts this repository can receive
#- name: Update dependency graph
# uses: advanced-security/maven-dependency-submission-action@571e99aab1055c2e71a1e2309b9691de18d6b7d6