1- name : Build & Release JAR and EXE
1+ name : Build & Release
22
33on :
4+ workflow_dispatch :
45 push :
5- tags :
6- - ' v*.*.*' # runs only on tags starting with v
6+ pull_request_target :
77
88permissions : write-all
99jobs :
10- build_and_release :
10+ build_mod :
1111 runs-on : ubuntu-latest
12+ steps :
13+ - name : Check out code
14+ uses : actions/checkout@v3
15+
16+ - name : Setup .NET 8.x
17+ uses : actions/setup-dotnet@v4
18+ with :
19+ dotnet-version : ' 8.x'
20+
21+ - uses : clansty/checkout@main
22+ with :
23+ repository : ' MewoLab/AquaMai-Build-Assets'
24+ path : " AquaMai-Build-Assets"
25+ token : ${{ secrets.PATGH }}
26+ max-attempts : 50
27+ min-retry-interval : 1
28+ max-retry-interval : 5
29+
30+ - name : Copy Libs
31+ run : cp AquaMai-Build-Assets/WorldLinkLibs/* mod/Libs/
32+
33+ - name : Build .NET Mod
34+ run : cd mod && dotnet build -c Release
35+
36+ - name : Rename Artifacts
37+ run : |
38+ mkdir Artifacts
39+ mv mod/bin/Release/net472/WorldLink.dll Artifacts
40+ mv mod/WorldLink.toml Artifacts
41+
42+ - uses : actions/upload-artifact@v4
43+ with :
44+ name : Mod
45+ path : Artifacts
46+
47+ build_deploy_frontend :
48+ runs-on : ubuntu-latest
49+ # Grant GITHUB_TOKEN the permissions required to make a Pages deployment
50+ permissions :
51+ pages : write # to deploy to Pages
52+ id-token : write # to verify the deployment originates from an appropriate source
53+
54+ # Deploy to the github-pages environment
55+ environment :
56+ name : github-pages
57+ url : ${{ steps.deployment.outputs.page_url }}
58+
1259 steps :
1360 - name : Check out code
1461 uses : actions/checkout@v3
@@ -32,22 +79,15 @@ jobs:
3279 with :
3380 path : rooms/dist
3481
35- - name : Setup .NET 8.x
36- uses : actions/setup-dotnet@v4
37- with :
38- dotnet-version : ' 8.x'
39-
40- - uses : actions/checkout@v4
41- with :
42- repository : ' MewoLab/AquaMai-Build-Assets'
43- path : " AquaMai-Build-Assets"
44- token : ${{ secrets.PATGH }}
45-
46- - name : Copy Libs
47- run : cp AquaMai-Build-Assets/WorldLinkLibs/* mod/Libs/
82+ - name : Deploy to GitHub Pages
83+ id : deployment
84+ uses : actions/deploy-pages@v4 # or specific "vX.X.X" version tag for this action
4885
49- - name : Build .NET Mod
50- run : cd mod && dotnet build -c Release
86+ build_jar_docker :
87+ runs-on : ubuntu-latest
88+ steps :
89+ - name : Check out code
90+ uses : actions/checkout@v3
5191
5292 - name : Set up JDK 21
5393 uses : actions/setup-java@v3
@@ -61,38 +101,71 @@ jobs:
61101 - name : Build fat JAR
62102 run : ./gradlew clean buildFatJar
63103
104+ - uses : actions/upload-artifact@v4
105+ with :
106+ name : Server
107+ path : build/libs/worldlinkd.jar
108+
109+ - run : cp build/libs/worldlinkd.jar worldlinkd.jar
110+
111+ - name : OCI meta
112+ id : meta
113+ uses : docker/metadata-action@v5
114+ with :
115+ images : ghcr.io/${{ github.repository }}
116+ tags : |
117+ type=ref,event=branch
118+ type=ref,event=pr
119+ type=semver,pattern={{version}}
120+ type=sha
121+
122+ - name : Set up Docker Buildx
123+ uses : docker/setup-buildx-action@v3
124+
125+ - name : Login to GHCR
126+ uses : docker/login-action@v3
127+ with :
128+ registry : ghcr.io
129+ username : ${{ github.actor }}
130+ password : ${{ secrets.GITHUB_TOKEN }}
131+
132+ - name : Build and push
133+ uses : docker/build-push-action@v5
134+ with :
135+ context : .
136+ push : ${{ github.actor != 'dependabot[bot]' }}
137+ tags : ${{ steps.meta.outputs.tags }}
138+ labels : ${{ steps.meta.outputs.labels }}
139+ platforms : linux/amd64
140+ cache-from : type=gha
141+ cache-to : type=gha,mode=max
142+
143+ release :
144+ runs-on : ubuntu-latest
145+ if : ${{ startsWith(github.ref, 'refs/tags/v') }}
146+ needs :
147+ - build_mod
148+ - build_jar_docker
149+ steps :
150+ - name : get Mod
151+ uses : actions/download-artifact@v4
152+ with :
153+ name : Mod
154+
155+ - name : get Server
156+ uses : actions/download-artifact@v4
157+ with :
158+ name : Server
159+
64160 - name : Release
65161 uses : softprops/action-gh-release@v2
66162 with :
67163 tag_name : ${{ github.ref_name }}
68164 name : " Release ${{ github.ref_name }}"
69- body : " CI Build Release"
70165 draft : false
71166 prerelease : false
72167 files : |
73- build/libs/ worldlinkd.jar
74- mod/bin/Release/net472/ WorldLink.dll
75- mod/ WorldLink.toml
168+ worldlinkd.jar
169+ WorldLink.dll
170+ WorldLink.toml
76171 token : ${{ secrets.GITHUB_TOKEN }}
77-
78- # Deploy job
79- deploy :
80- # Add a dependency to the build job
81- needs : build_and_release
82-
83- # Grant GITHUB_TOKEN the permissions required to make a Pages deployment
84- permissions :
85- pages : write # to deploy to Pages
86- id-token : write # to verify the deployment originates from an appropriate source
87-
88- # Deploy to the github-pages environment
89- environment :
90- name : github-pages
91- url : ${{ steps.deployment.outputs.page_url }}
92-
93- # Specify runner + deployment step
94- runs-on : ubuntu-latest
95- steps :
96- - name : Deploy to GitHub Pages
97- id : deployment
98- uses : actions/deploy-pages@v4 # or specific "vX.X.X" version tag for this action
0 commit comments