forked from Japerz12138/worldlinkd
-
Notifications
You must be signed in to change notification settings - Fork 1
174 lines (146 loc) · 4.33 KB
/
build.yml
File metadata and controls
174 lines (146 loc) · 4.33 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
name: Build & Release
on:
workflow_dispatch:
push:
pull_request_target:
permissions: write-all
jobs:
build_mod:
runs-on: ubuntu-latest
steps:
- name: Check out code
uses: actions/checkout@v3
- name: Setup .NET 8.x
uses: actions/setup-dotnet@v4
with:
dotnet-version: '8.x'
- uses: clansty/checkout@main
with:
repository: 'MewoLab/AquaMai-Build-Assets'
path: "AquaMai-Build-Assets"
token: ${{ secrets.PATGH }}
max-attempts: 50
min-retry-interval: 1
max-retry-interval: 5
- name: Copy Libs
run: cp AquaMai-Build-Assets/WorldLinkLibs/* mod/Libs/
- name: Build .NET Mod
run: |
cd mod
dotnet tool restore
dotnet cake
- name: Rename Artifacts
run: |
mkdir Artifacts
mv mod/bin/Release/net472/WorldLink.dll Artifacts
mv mod/WorldLink.toml Artifacts
- uses: actions/upload-artifact@v4
with:
name: Mod
path: Artifacts
build_deploy_frontend:
runs-on: ubuntu-latest
# Grant GITHUB_TOKEN the permissions required to make a Pages deployment
permissions:
pages: write # to deploy to Pages
id-token: write # to verify the deployment originates from an appropriate source
# Deploy to the github-pages environment
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
steps:
- name: Check out code
uses: actions/checkout@v3
- name: Setup Bun
uses: oven-sh/setup-bun@v2
with:
bun-version: latest
- name: Build frontend
run: |
cd rooms
bun install
bun run build
cp -r dist ../src/main/resources/
rm -rf dist
VITE_WL_BUILD_PROD=true bun run build
- name: Upload pages build
uses: actions/upload-pages-artifact@v3
with:
path: rooms/dist
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4 # or specific "vX.X.X" version tag for this action
build_jar_docker:
runs-on: ubuntu-latest
steps:
- name: Check out code
uses: actions/checkout@v3
- name: Set up JDK 21
uses: actions/setup-java@v3
with:
distribution: temurin
java-version: '21'
- name: Grant Gradle permissions
run: chmod +x gradlew
- name: Build fat JAR
run: ./gradlew clean buildFatJar
- uses: actions/upload-artifact@v4
with:
name: Server
path: build/libs/worldlinkd.jar
- run: cp build/libs/worldlinkd.jar worldlinkd.jar
- name: OCI meta
id: meta
uses: docker/metadata-action@v5
with:
images: ghcr.io/${{ github.repository }}
tags: |
type=ref,event=branch
type=ref,event=pr
type=semver,pattern={{version}}
type=sha
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Login to GHCR
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build and push
uses: docker/build-push-action@v5
with:
context: .
push: ${{ github.actor != 'dependabot[bot]' }}
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
platforms: linux/amd64
cache-from: type=gha
cache-to: type=gha,mode=max
release:
runs-on: ubuntu-latest
if: ${{ startsWith(github.ref, 'refs/tags/v') }}
needs:
- build_mod
- build_jar_docker
steps:
- name: get Mod
uses: actions/download-artifact@v4
with:
name: Mod
- name: get Server
uses: actions/download-artifact@v4
with:
name: Server
- name: Release
uses: softprops/action-gh-release@v2
with:
tag_name: ${{ github.ref_name }}
name: "Release ${{ github.ref_name }}"
draft: false
prerelease: false
files: |
worldlinkd.jar
WorldLink.dll
WorldLink.toml
token: ${{ secrets.GITHUB_TOKEN }}