-
Notifications
You must be signed in to change notification settings - Fork 6
147 lines (128 loc) Β· 5.32 KB
/
auto_pack.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
name: Auto Pack LeviLamina
on:
workflow_dispatch:
push:
branches: ["auto"]
schedule:
- cron: '0 16 * * *'
jobs:
Read-configuration:
name: π Parse json
runs-on: ubuntu-latest
outputs:
CONFIGS: ${{ steps.generate-matrix.outputs.CONFIGS }}
steps:
# This action checks-out your CONFIGSitory under $GITHUB_WORKSPACE, so your workflow can access it.
- name: π Checkout
uses: actions/checkout@v4
# Match the configuration files in the CONFIGS directory, read the contents and merge them into an array.
- name: π Generate Matrix
id: generate-matrix
run: |
echo "CONFIGS<<EOF" >> $GITHUB_OUTPUT
jq -s '[.[][]]' auto_pack_config.json >> $GITHUB_OUTPUT
echo "EOF" >> $GITHUB_OUTPUT
Pack:
permissions:
contents: write
runs-on: windows-latest
defaults:
run:
shell: pwsh
needs:
- Read-configuration
strategy:
max-parallel: 4
fail-fast: false
matrix:
CONFIG: ${{ fromJSON(needs.Read-configuration.outputs.CONFIGS) }}
env:
LL_VER: ${{ matrix.CONFIG.LeviLaminaVersion }}
ENABLE_LSE: ${{ matrix.CONFIG.includeLSE }}
ENABLE_RUNTIME: ${{ matrix.CONFIG.includeRuntime }}
ENABLE_SCRIPTS: ${{ matrix.CONFIG.useUserScripts }}
steps:
- name: π‘ Check Out Repo
uses: actions/checkout@v3
- name: π οΈ Install Lip & Prepare Environment
run: |
mkdir ll
mv .\LICENSE .\ll\LL_Easier_LICENSE
Invoke-WebRequest -Uri https://github.com/lippkg/lip/releases/latest/download/lip-windows-amd64.zip -Outfile .\scripts\lip.zip
Invoke-WebRequest -Uri https://www.7-zip.org/a/7z2401-x64.exe -Outfile .\scripts\7z_installer.exe
"$env:GITHUB_WORKSPACE\scripts" | Out-File -FilePath $env:GITHUB_PATH -Append
.\scripts\7z_installer.exe
unzip .\scripts\lip.zip -d .\scripts\
- name: π§ Get Latest LeviLamina Version
if: ${{ env.LL_VER == 'latest' }}
id: latest_version
uses: pozetroninc/github-action-get-latest-release@master
with:
owner: LiteLDev
repo: LeviLamina
- name: π Format The Version Geted
if: ${{ env.LL_VER == 'latest' }}
run: |
echo $(echo ${{ steps.latest_version.outputs.release }} | cut -c 2-) > .version
- name: π Format The Custom Version
if: ${{ env.LL_VER != 'latest' }}
run: |
echo ${{ env.LL_VER }} > .version
- name: π Put Version Value In Var
id: formated_ver
run: |
"ll_version=$(cat .version)" | Out-File -FilePath $env:GITHUB_OUTPUT -Append
- name: π§° Install LeviLamina
working-directory: ll
run: |
lip.exe install -y github.com/LiteLDev/LeviLamina@${{ steps.formated_ver.outputs.ll_version }}
- name: βοΈ Install LSE
if: ${{ env.ENABLE_LSE == 'true' }}
working-directory: ll
run: |
lip.exe install -y github.com/LiteLDev/LegacyScriptEngine
lip.exe install -y gitea.litebds.com/LiteLDev/legacy-script-engine-nodejs
lip.exe install -y gitea.litebds.com/LiteLDev/legacy-script-engine-python
- name: π§ Install Runtime
if: ${{ env.ENABLE_RUNTIME == 'true' }}
working-directory: ll
run: |
Invoke-WebRequest -Uri https://aka.ms/vs/17/release/vc_redist.x64.exe -Outfile .\runtime_for_levilamina.exe
- name: π Run User's Scripts
if: ${{ env.ENABLE_SCRIPTS == 'true' }}
working-directory: ll
run: |
user_scripts.ps1
- name: π Get BDS core version & Remove BDS
id: get_bds_core_version
working-directory: ll
run: |
"bds_core_version=$(python ..\scripts\get_bds_version.py)" | Out-File -FilePath $env:GITHUB_OUTPUT -Append
rm .\behavior_packs -Force -Recurse
rm .\definitions -Force -Recurse
rm .\resource_packs -Force -Recurse
rm .\bedrock_* -Force -Recurse
rm .\config -Force -Recurse
rm .\.cache -Force -Recurse
rm .\allowlist.json -Force
rm .\bdsdown.exe -Force
rm .\permissions.json -Force
rm .\release-notes.txt -Force
rm .\server.properties -Force
- name: π¦ Pack Files
run: |
7z a ll_${{ steps.formated_ver.outputs.ll_version }}-bds_${{ steps.get_bds_core_version.outputs.bds_core_version }}.zip .\ll\
- name: π Upload Release
uses: softprops/action-gh-release@v1
with:
files: ll_${{ steps.formated_ver.outputs.ll_version }}-bds_${{ steps.get_bds_core_version.outputs.bds_core_version }}.zip
name: LeviLamina Packed - ${{ steps.formated_ver.outputs.ll_version }} (auto)
tag_name: auto-${{ steps.formated_ver.outputs.ll_version }}
body: |
LeviLamina version: ${{ steps.formated_ver.outputs.ll_version }}
BDS core needed version: ${{ steps.get_bds_core_version.outputs.bds_core_version }}
Include LSE: ${{ env.ENABLE_LSE }}
Include Runtime: ${{ env.ENABLE_RUNTIME }}
Use user_scripts.bat: ${{ env.ENABLE_SCRIPTS }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}