-
Notifications
You must be signed in to change notification settings - Fork 93
237 lines (185 loc) · 8 KB
/
release.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
name: Release
on:
workflow_dispatch:
inputs:
releaseVersion:
description: Release Version
required: true
default: 10.0.0
snapshotVersion:
description: Snapshot Version
required: true
default: 11.0.0-SNAPSHOT
run-name: 'version set to ${{ github.event.inputs.releaseVersion }} for release'
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
token: ${{ secrets.GITHUB_TOKEN }}
fetch-depth: 0
- name: Cache local Maven repository
uses: actions/cache@v4
with:
path: ~/.m2/repository
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
restore-keys: ${{ runner.os }}-maven-
- name: Set up JDK Corretto 21
uses: actions/setup-java@v4
with:
distribution: 'corretto'
java-version: '21'
server-id: ossrh
server-username: MAVEN_USERNAME
server-password: MAVEN_PASSWORD
gpg-private-key: ${{ secrets.MAVEN_GPG_PRIVATE_KEY }}
gpg-passphrase: GPG_PASSPHRASE
architecture: x64
- name: Install NodeJS
uses: actions/setup-node@v4
with:
node-version: 18
- name: Install esbuild
run: npm i -g esbuild
- name: Install TypeScript compiler
run: npm i -g typescript
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
with:
install: true
- name: Setup Docker Buildx
run: |
docker buildx create --name dirigible-builder
docker buildx use dirigible-builder
- name: "Configure Git"
run: |
git fetch
git checkout ${{ github.event.inputs.branch }}
git config user.name "$GITHUB_ACTOR"
git config user.email "$GITHUB_ACTOR@users.noreply.github.com"
- name: "Maven: Set Release Version"
run: mvn versions:set -DnewVersion=${{ github.event.inputs.releaseVersion }}
- name: Build Dirigible
run: mvn clean install -Dmaven.javadoc.skip=false
#-----------------Publish to DockerHub-------------------#
- name: Docker Login
run: docker login -u ${{secrets.DOCKER_USER}} -p ${{secrets.DOCKER_PASSWORD}}
- name: Push Dirigible (Spring)
run: |
cd build/application
docker buildx build --push --tag dirigiblelabs/dirigible:${{ github.event.inputs.releaseVersion }} -o type=image --platform=linux/arm64,linux/amd64 .
#-----------------Publish to DockerHub-------------------#
#---------------Publish to Maven Central-----------------#
- name: Publish packages to Maven Central
run: |
mvn javadoc:jar
mvn deploy -P release -DskipTests -Dmaven.test.skip=true
env:
MAVEN_USERNAME: ${{ secrets.MAVEN_USERNAME }}
MAVEN_PASSWORD: ${{ secrets.MAVEN_PASSWORD }}
GPG_PASSPHRASE: ${{ secrets.MAVEN_GPG_PASS_PHRASE }}
- name: "Git: Commit Release Version"
run: |
git add '**pom.xml'
git commit -m "version set to ${{ github.event.inputs.releaseVersion }} for release"
- name: "Maven: Set Snapshot Version"
run: mvn versions:set -DnewVersion=${{ github.event.inputs.snapshotVersion }}
- name: "Git: Commit Snapshot Version"
run: |
git add '**pom.xml'
git commit -m "version set to ${{ github.event.inputs.snapshotVersion }} for development"
#---------------Publish to Maven Central-----------------#
#----------------Publish GitHub Release------------------#
- name: Package WAR files
run: |
zip --junk-paths application-all build/application/target/dirigible-application-${{ github.event.inputs.releaseVersion }}-executable.jar
- name: Create Release
id: create_release
uses: softprops/action-gh-release@v2
with:
token: ${{ secrets.GITHUB_TOKEN }}
tag_name: v${{ github.event.inputs.releaseVersion }}
name: ${{ github.event.inputs.releaseVersion }}
draft: false
prerelease: false
files: |
./application-all.zip
body: |
## Eclipse Dirigible - ${{ github.event.inputs.releaseVersion }}
#### Release:
The lates release notes are available [here](https://www.dirigible.io/releases/).
> _**Note:** All released versions can be found [here](https://github.com/eclipse/dirigible/releases/)._
#### Maven:
250+ Maven dependencies can be found [here]( https://search.maven.org/#search%7Cga%7C1%7Corg.eclipse.dirigible).
```xml
<dependency>
<groupId>org.eclipse.dirigible</groupId>
<artifactId>dirigible-components-group-core</artifactId>
<version>${{ github.event.inputs.releaseVersion }}</version>
</dependency>
```
#### Helm:
To install Eclipse Dirigible with Helm go to the [Setup with Helm](https://www.dirigible.io/help/setup/helm/) page.
All Helm charts, with detailed explanation, setup and configurations, can be found [here](https://artifacthub.io/packages/search?org=dirigiblelabs).
```
helm repo add dirigible https://eclipse.github.io/dirigible
helm repo update
helm install dirigible dirigible/dirigible --version ${{ github.event.inputs.releaseVersion }}
```
#### Docker images:
- [dirigiblelabs/dirigible](https://hub.docker.com/r/dirigiblelabs/dirigible/tags?page=1&ordering=last_updated) - All-in-one docker image - recommended for local test & development.
> _**Note:** All Docker images are availalbe [here](https://hub.docker.com/u/dirigiblelabs)_
#### Available for download `*.war` packages:
- _**[application-all](https://github.com/eclipse/dirigible/releases/download/v${{ github.event.inputs.releaseVersion }}/application-all.zip) - All-in-one package - recommended for local test & development.**_
> _**Note:** Unzip the downloaded file to extract the `application-all-XXX.jar` binary._
For more information go to [https://www.dirigible.io/help/setup/](https://www.dirigible.io/help/setup/).
#----------------Publish GitHub Release------------------#
- name: "Git: Push Changes"
run: |
git checkout -B ${{ github.event.inputs.releaseVersion }}
git push --set-upstream origin ${{ github.event.inputs.releaseVersion }}
git checkout -B master
git push --set-upstream origin master
#----------------Publish Helm Release------------------#
- name: Helm tool installer
uses: Azure/setup-helm@v4
- name: Helm Charts Release - Checkout gh-pages
run: |
mkdir charts-temp
cp -r build/helm-charts/ charts-temp/
#### Git Checkout Workaround
git add .github/
git add .reuse/
git add LICENSES/
git add logo/
git add components/
git reset --hard
####
git fetch
git checkout gh-pages
cp charts/* .
- name: Helm Charts Release - Set Chart Version - Dirigible
run: |
cd charts-temp/helm-charts/dirigible/
find *.yaml -type f -exec sed -i ''s/#{DirigibleVersion}#/${{ github.event.inputs.releaseVersion }}/g'' {} \;
- name: Helm Charts Release
run: |
cp charts/* charts-temp/helm-charts/
cd charts-temp/helm-charts/
helm package dirigible
cd ..
helm repo index helm-charts/ --url https://eclipse.github.io/dirigible/charts
cp helm-charts/index.yaml ../.
cp helm-charts/dirigible-${{ github.event.inputs.releaseVersion }}.tgz ../charts/
cd ..
git config user.name "$GITHUB_ACTOR"
git config user.email "$GITHUB_ACTOR@users.noreply.github.com"
git add index.yaml
git add charts/
git commit -m "Updates Helm Charts - Release ${{ github.event.inputs.releaseVersion }}"
git push origin gh-pages
git add .
git reset --hard
git checkout ${{ github.event.inputs.branch }}
#----------------Publish Helm Release------------------#