Skip to content

Commit eeb8a6c

Browse files
committed
Fix CICD
1 parent cefe2ae commit eeb8a6c

File tree

5 files changed

+194
-127
lines changed

5 files changed

+194
-127
lines changed

.github/workflows/preview.yml

Lines changed: 0 additions & 127 deletions
This file was deleted.

.github/workflows/preview/deploy.yml

Lines changed: 73 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
1+
name: Deploy preview modpack
2+
3+
permissions:
4+
contents: write
5+
deployments: write
6+
7+
on:
8+
workflow_dispatch:
9+
inputs:
10+
version:
11+
description: 'Modpack version'
12+
required: true
13+
preview_version:
14+
description: 'Preview version'
15+
required: true
16+
17+
env:
18+
VERSION_LWJGL3: "v${{ github.event.inputs.version }}-lwjgl3-${{ github.event.inputs.preview_version }}"
19+
VERSION_NORMAL: "v${{ github.event.inputs.version }}-pr-${{ github.event.inputs.preview_version }}"
20+
NAME: "GTExpert2"
21+
22+
jobs:
23+
deploy_lwjgl3:
24+
runs-on: ubuntu-latest
25+
steps:
26+
- name: Trigger LWJGL3 Deployment
27+
uses: actions/github-script@v4
28+
with:
29+
script: |
30+
github.actions.createWorkflowDispatch({
31+
owner: context.repo.owner,
32+
repo: context.repo.repo,
33+
workflow_id: 'deploy_lwjgl3.yml',
34+
ref: context.ref,
35+
inputs: {
36+
version: context.payload.inputs.version,
37+
preview_version: context.payload.inputs.preview_version
38+
}
39+
})
40+
41+
deploy_normal:
42+
runs-on: ubuntu-latest
43+
steps:
44+
- name: Trigger NORMAL Deployment
45+
uses: actions/github-script@v4
46+
with:
47+
script: |
48+
github.actions.createWorkflowDispatch({
49+
owner: context.repo.owner,
50+
repo: context.repo.repo,
51+
workflow_id: 'deploy_normal.yml',
52+
ref: context.ref,
53+
inputs: {
54+
version: context.payload.inputs.version,
55+
preview_version: context.payload.inputs.preview_version
56+
}
57+
})
58+
59+
create_release:
60+
runs-on: ubuntu-latest
61+
needs: [deploy_lwjgl3, deploy_normal]
62+
steps:
63+
- name: Create GitHub Release
64+
uses: softprops/action-gh-release@v2
65+
with:
66+
tag_name: ${{ env.VERSION_NORMAL }}
67+
prerelease: true
68+
generate_release_notes: true
69+
files: |
70+
./${{ env.NAME }}-${{ env.VERSION_NORMAL }}-cf.zip
71+
./${{ env.NAME }}-${{ env.VERSION_NORMAL }}-mmc.zip
72+
./${{ env.NAME }}-${{ env.VERSION_NORMAL }}-server.zip
73+
./${{ env.NAME }}-${{ env.VERSION_LWJGL3 }}-cmmc.zip
Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
name: Deploy LWJGL3 modpack
2+
3+
permissions:
4+
contents: write
5+
deployments: write
6+
7+
on:
8+
workflow_dispatch:
9+
10+
env:
11+
VERSION_LWJGL3: "v${{ github.event.inputs.version }}-lwjgl3-${{ github.event.inputs.preview_version }}"
12+
NAME: "GTExpert2"
13+
14+
jobs:
15+
deploy:
16+
runs-on: ubuntu-latest
17+
18+
steps:
19+
- name: Checkout
20+
uses: actions/checkout@v4
21+
22+
- name: Setup Build
23+
uses: ./.github/actions/build_setup
24+
25+
- name: Download Resource Packs zip
26+
run: |
27+
GITHUB_RELEASE=$(curl -s https://api.github.com/repos/GTModpackTeam/GTE2-Translations/releases)
28+
ASSET_URL=$(echo $GITHUB_RELEASE | jq -r '.[]."assets"[]."browser_download_url"' | grep "resourcepack" | head -1)
29+
ASSET_NAME=$(echo $ASSET_URL | awk -F'/' '{print $NF}')
30+
wget -O ./overrides/resourcepacks/$ASSET_NAME $ASSET_URL
31+
32+
- name: Set the version
33+
run: |
34+
echo "[CleanroomMMC] GregTech Expert 2 ${{ env.VERSION_LWJGL3 }}" > ./overrides/config/txloader/load/custommainmenu/version.txt
35+
sed -i -e "s/MODPACKVERSION/${{ env.VERSION_LWJGL3 }}/g" ./manifest.json
36+
sed -i -e "s/MODPACKVERSION/${{ env.VERSION_LWJGL3 }}/g" ./instance.cfg
37+
sed -i -e "s/MODPACKVERSION/${{ env.VERSION_LWJGL3 }}/g" ./overrides/config/craftpresence.json
38+
39+
- name: Remove lwjgl3 not supported mods
40+
run: |
41+
python buildtools/gen-lwjgl3-manifest.py
42+
cp -vf ./cmmc/manifest.json ./manifest.json
43+
44+
- name: Run Python
45+
env:
46+
CF_API_TOKEN: ${{ secrets.CF_API_TOKEN }}
47+
run: python buildtools/mod-install.py
48+
49+
- name: Archive Release MMC
50+
run: |
51+
cp -rvf ./cmmc/bansoukou/ ./overrides/
52+
rm -Rf ./cmmc/bansoukou/
53+
mv -vf ./overrides/ .minecraft/
54+
cp -vf ./icon.png .minecraft/
55+
cp -rvf ./cmmc/* ./
56+
rm -rf .minecraft/mods/.gitkeep
57+
rm -rf .minecraft/resourcepacks/.gitkeep
58+
zip -r ./${{ env.NAME }}-${{ env.VERSION_LWJGL3 }}-cmmc.zip ./libraries/ ./patches/ ./mmc-pack.json ./instance.cfg .minecraft/
Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
name: Deploy NORMAL modpack
2+
3+
permissions:
4+
contents: write
5+
deployments: write
6+
7+
on:
8+
workflow_dispatch:
9+
10+
env:
11+
VERSION_NORMAL: "v${{ github.event.inputs.version }}-pr-${{ github.event.inputs.preview_version }}"
12+
NAME: "GTExpert2"
13+
14+
jobs:
15+
deploy:
16+
runs-on: ubuntu-latest
17+
18+
steps:
19+
- name: Checkout
20+
uses: actions/checkout@v4
21+
22+
- name: Setup Build
23+
uses: ./.github/actions/build_setup
24+
25+
- name: Download Resource Packs zip
26+
run: |
27+
GITHUB_RELEASE=$(curl -s https://api.github.com/repos/GTModpackTeam/GTE2-Translations/releases)
28+
ASSET_URL=$(echo $GITHUB_RELEASE | jq -r '.[]."assets"[]."browser_download_url"' | grep "resourcepack" | head -1)
29+
ASSET_NAME=$(echo $ASSET_URL | awk -F'/' '{print $NF}')
30+
wget -O ./overrides/resourcepacks/$ASSET_NAME $ASSET_URL
31+
32+
- name: Set the version
33+
run: |
34+
echo "GregTech Expert 2 ${{ env.VERSION_NORMAL }}" > ./overrides/config/txloader/load/custommainmenu/version.txt
35+
sed -i -e "s/MODPACKVERSION/${{ env.VERSION_NORMAL }}/g" ./manifest.json
36+
sed -i -e "s/MODPACKVERSION/${{ env.VERSION_NORMAL }}/g" ./instance.cfg
37+
sed -i -e "s/MODPACKVERSION/${{ env.VERSION_NORMAL }}/g" ./overrides/config/craftpresence.json
38+
39+
- name: Run Python
40+
env:
41+
CF_API_TOKEN: ${{ secrets.CF_API_TOKEN }}
42+
run: python buildtools/mod-install.py
43+
44+
- name: Archive Release CF
45+
run: |
46+
rm -rf ./overrides/resourcepacks/.gitkeep
47+
zip -r ./${{ env.NAME }}-${{ env.VERSION_NORMAL }}-cf.zip ./manifest.json ./modlist.html ./overrides/bansoukou/ ./overrides/config/ ./overrides/local/ ./overrides/resourcepacks/ ./overrides/scripts/
48+
49+
- name: Archive Release MMC
50+
run: |
51+
mv -vf ./overrides/ .minecraft/
52+
cp -vf ./icon.png .minecraft/
53+
rm -rf .minecraft/mods/.gitkeep
54+
zip -r ./${{ env.NAME }}-${{ env.VERSION_NORMAL }}-mmc.zip ./mmc-pack.json ./instance.cfg .minecraft/
55+
56+
- name: Move Server Files
57+
run: |
58+
mv -vf ./serverfiles/* ./
59+
60+
- name: Archive Release Server
61+
run: |
62+
mv -vf .minecraft/* ./
63+
zip -r ./${{ env.NAME }}-${{ env.VERSION_NORMAL }}-server.zip ./docker-compose.yml ./PleaseRead.txt ./log4j2_112-116.xml ./Install.bat ./Install.sh ./ServerStart.bat ./ServerStart.sh ./settings.bat ./settings.sh ./TmuxServer.sh ./bansoukou/ ./config/ ./local/ ./mods/ ./resources/ ./scripts/
File renamed without changes.

0 commit comments

Comments
 (0)