forked from finos/symphony-wdk
-
Notifications
You must be signed in to change notification settings - Fork 0
148 lines (125 loc) · 4.5 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
# Release any branch to Maven Central.
# This workflow currently assumes that the target branch is ready to be release (i.e. version is correct)
name: Release
on:
release:
types: [ published ]
jobs:
build:
name: "Release"
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-java@v3
with:
distribution: 'temurin'
java-version: 17
- uses: actions/setup-node@v3
with:
node-version: 18
cache: 'yarn'
cache-dependency-path: studio/web/yarn.lock
- run: cd studio/web && yarn install && yarn build && cp -r dist ../src/main/resources/static/
- name: Configure signing
run: |
printf "$GPG_KEY_BASE64" | base64 --decode > secring.gpg
env:
GPG_KEY_BASE64: ${{ secrets.GPG_KEY_BASE64 }}
- name: Cache Gradle packages
uses: actions/cache@v3
with:
path: |
~/.gradle/caches
~/.gradle/wrapper
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }}
restore-keys: |
${{ runner.os }}-gradle-
- name: Build with Gradle
run: |
mkdir -p ~/.gnupg/
printf "$GPG_KEY_BASE64" | base64 --decode > ~/.gnupg/secring.gpg
./gradlew build -x test
./gradlew -PmavenRepoUsername=${{ secrets.MAVEN_USERNAME }} -PmavenRepoPassword=${{ secrets.MAVEN_PASSWORD }} -Psigning.keyId=${{ secrets.GPG_KEY_ID }} -Psigning.secretKeyRingFile=${{ github.workspace }}/secring.gpg -Psigning.password=${{ secrets.GPG_KEY_PASSPHRASE }} publishToSonatype closeAndReleaseStagingRepository
- name: Upload fatJar artifact
uses: actions/[email protected]
with:
path: workflow-bot-app/build/libs/*boot*jar
if-no-files-found: error
retention-days: 1
- name: Upload studio artifact
uses: actions/[email protected]
with:
name: lib
path: studio/lib/*.jar
if-no-files-found: error
retention-days: 1
build-federation:
name: "Build Federation JAR"
needs: build
runs-on: ubuntu-latest
env:
VERSION: 1.0.5
steps:
- uses: actions/checkout@v3
with:
repository: symphonyplatformsolutions/wdk-federation-client
ref: ${{ env.VERSION }}
- uses: gradle/gradle-build-action@v2
with:
arguments: build
- name: Rename Federation JAR
run: mv lib/symphony-wdk.jar lib/wdk-federation-client-${VERSION}.jar
- name: Upload artifact
uses: actions/[email protected]
with:
name: federation
path: lib/*.jar
if-no-files-found: error
retention-days: 1
build-and-push-image:
name: "Push Docker Image"
needs: build-federation
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Download artifacts
uses: actions/download-artifact@v3
with:
path: .
- run: mkdir studio/lib && cp federation/*.jar studio/lib/ && cp lib/*.jar studio/lib/
- name: Log in to the Container registry
uses: docker/login-action@v2
with:
username: finos
password: ${{ secrets.DOCKER_PASSWORD }}
- name: Extract metadata (tags, labels) for Docker
id: meta
uses: docker/metadata-action@v4
with:
images: finos/symphony-wdk
- name: Build and push WDK Docker image
uses: docker/build-push-action@v4
with:
context: .
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
- name: Extract metadata (tags, labels) for Docker
id: meta_studio
uses: docker/metadata-action@v4
with:
images: finos/symphony-wdk-studio
- name: Build and push Studio Docker image
uses: docker/build-push-action@v4
with:
context: studio
push: true
tags: ${{ steps.meta_studio.outputs.tags }}
labels: ${{ steps.meta_studio.outputs.labels }}
- name: Cleanup Gradle Cache
# Remove some files from the Gradle cache, so they aren't cached by GitHub Actions.
# Restoring these files from a GitHub Actions cache might cause problems for future builds.
run: |
rm -f ~/.gradle/caches/modules-2/modules-2.lock
rm -f ~/.gradle/caches/modules-2/gc.properties