forked from ReaJason/MemShellParty
-
Notifications
You must be signed in to change notification settings - Fork 0
188 lines (162 loc) · 5.71 KB
/
release.yaml
File metadata and controls
188 lines (162 loc) · 5.71 KB
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
name: Release
on:
push:
tags:
- 'v*'
jobs:
info:
name: Parse release info
runs-on: ubuntu-latest
outputs:
version: ${{ steps.get_version.outputs.version }}
version-without-v: ${{ steps.get_version.outputs.version-without-v }}
changelog: ${{ steps.get_changelog.outputs.changelog }}
steps:
- uses: actions/checkout@v4
- name: Get Version
id: get_version
run: |
VERSION=${GITHUB_REF#refs/tags/}
VERSION_WITHOUT_V=${VERSION#v}
echo "version=$VERSION" >> $GITHUB_OUTPUT
echo "version-without-v=$VERSION_WITHOUT_V" >> $GITHUB_OUTPUT
- name: Get ChangeLog
id: get_changelog
working-directory: .github/scripts
run: |
echo "changelog<<EOF" >> $GITHUB_OUTPUT
echo "$(python parse_changelog_of_version.py ${{ steps.get_version.outputs.version }})" >> $GITHUB_OUTPUT
echo "EOF" >> $GITHUB_OUTPUT
build-jar:
name: Build Jar
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Setup Java
uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: 17
- name: Setup Gradle
uses: gradle/actions/setup-gradle@v4
- name: Setup Node
uses: actions/setup-node@v6
with:
node-version: 22
- name: Setup Bun
uses: oven-sh/setup-bun@v2
with:
bun-version: latest
- name: Build Web with Bun
working-directory: web
run: bun install --frozen-lockfile && bun run build
- name: Build Boot with Gradle
run: ./gradlew :boot:bootjar -x test
- name: Upload Boot Jar
uses: actions/upload-artifact@v4
with:
name: boot
path: boot/build/libs/*.jar
docker-push:
name: Docker Push
needs: [ info, build-jar ]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Download Boot Jar
uses: actions/download-artifact@v4
with:
name: boot
path: boot/build/libs
- name: Login to GitHub Container Registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Login to Docker Hub
uses: docker/login-action@v3
with:
registry: docker.io
username: ${{ vars.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Build and push
uses: docker/build-push-action@v6
with:
context: boot
platforms: linux/amd64,linux/arm64
push: true
tags: |
docker.io/reajason/memshell-party:${{ needs.info.outputs.version-without-v }}
docker.io/reajason/memshell-party:latest
ghcr.io/reajason/memshell-party:${{ needs.info.outputs.version-without-v }}
ghcr.io/reajason/memshell-party:latest
- name: Build and push RedQueen
uses: docker/build-push-action@v6
with:
context: .
platforms: linux/amd64,linux/arm64
build-args: |
ROUTE_ROOT_PATH=/redqueen-memshell-party
CONTEXT_PATH=/redqueen-memshell-party
push: true
tags: |
docker.io/reajason/memshell-party:redqueen
deploy-maven:
name: Deploy to Maven Central
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Setup Java
uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: 17
- name: Setup Gradle
uses: gradle/actions/setup-gradle@v4
- name: Publish with Gradle
env:
ORG_GRADLE_PROJECT_mavenCentralUsername: ${{ secrets.ORG_GRADLE_PROJECT_mavenCentralUsername }}
ORG_GRADLE_PROJECT_mavenCentralPassword: ${{ secrets.ORG_GRADLE_PROJECT_mavenCentralPassword }}
ORG_GRADLE_PROJECT_signingInMemoryKey: ${{ secrets.ORG_GRADLE_PROJECT_signingInMemoryKey }}
ORG_GRADLE_PROJECT_signingInMemoryKeyId: ${{ secrets.ORG_GRADLE_PROJECT_signingInMemoryKeyId }}
ORG_GRADLE_PROJECT_signingInMemoryKeyPassword: ${{ secrets.ORG_GRADLE_PROJECT_signingInMemoryKeyPassword }}
run: ./gradlew publishAllToMavenCentral
create-release:
name: Create Release
needs: [ info, docker-push ]
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- uses: actions/checkout@v4
- name: Download Boot Jar
uses: actions/download-artifact@v4
with:
name: boot
path: boot/build/libs
- name: Release
uses: ncipollo/release-action@v1
with:
name: ${{ needs.info.outputs.version }}
tag: ${{ needs.info.outputs.version }}
body: ${{ needs.info.outputs.changelog }}
artifacts: boot/build/libs/boot-${{ needs.info.outputs.version-without-v }}.jar
deploy-northflank:
name: Deploy to Northflank
needs: [ docker-push ]
runs-on: ubuntu-latest
env:
NORTHFLANK_API_KEY: ${{ secrets.NORTHFLANK_API_KEY }}
steps:
- name: Update Deployment
run: |
curl --header "Content-Type: application/json" \
--header "Authorization: Bearer $NORTHFLANK_API_KEY" \
--request POST \
--data '{"external":{"imagePath":"docker.io/reajason/memshell-party:latest","credentials":"docker-hub"},"docker":{"configType":"default"}}' \
https://api.northflank.com/v1/projects/memshellparty/services/memshellparty/deployment