forked from ZH-Server/ll_easier
-
Notifications
You must be signed in to change notification settings - Fork 0
106 lines (95 loc) · 3.74 KB
/
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
name: Pack LeviLamina
on:
workflow_dispatch:
inputs:
LL_VER:
description: 'LeviLamina version'
required: true
default: '0.13.5'
LSE:
description: 'If include LSE'
required: false
default: 'false'
RUNTIME:
description: 'If include runtime for LeviLamina'
required: false
default: 'false'
SCRIPTS:
description: 'If use user_scripts'
required: false
default: 'false'
jobs:
Pack:
permissions:
contents: write
runs-on: windows-latest
defaults:
run:
shell: pwsh
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/futrime/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
.\scripts\7z_installer.exe
unzip .\scripts\lip.zip -d .\scripts\
"$env:GITHUB_WORKSPACE\scripts" | Out-File -FilePath $env:GITHUB_PATH -Append
- name: 🧰 Install LeviLamina
working-directory: ll
run: |
lip.exe install -y github.com/LiteLDev/LeviLamina@${{ github.event.inputs.LL_VER }}
- name: ⚙️ Install LSE
working-directory: ll
if: github.event.inputs.LSE == 'true'
run: |
lip.exe install -y gitea.litebds.com/LiteLDev/legacy-script-engine-python
lip.exe install -y gitea.litebds.com/LiteLDev/legacy-script-engine-lua
lip.exe install -y gitea.litebds.com/LiteLDev/legacy-script-engine-quickjs
- name: 🔧 Install Runtime
working-directory: ll
if: github.event.inputs.RUNTIME == 'true'
run: |
Invoke-WebRequest -Uri https://aka.ms/vs/17/release/vc_redist.x64.exe -Outfile .\runtime_for_levilamina.exe
- name: 📜 Run User's Scripts
working-directory: ll
if: github.event.inputs.SCRIPTS == 'true'
run: |
user_scripts.ps1
- name: 📂 Remove BDS & Get BDS Version
id: get_bds_core_version
working-directory: ll
run: |
$res = Get-content -Raw -Path "./.lip/metadata/github.com%2FLiteLDev%2Fbds.json" |ConvertFrom-Json
"bds_core_version=$($res.version)" | 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_${{ github.event.inputs.LL_VER }}-bds_${{ steps.get_bds_core_version.outputs.bds_core_version }}.zip .\ll\
- name: 🎉 Upload Release
uses: softprops/action-gh-release@v1
with:
files: ll_${{ github.event.inputs.LL_VER }}-bds_${{ steps.get_bds_core_version.outputs.bds_core_version }}.zip
name: LeviLamina Packed - ${{ github.event.inputs.LL_VER }} (Legacy)
tag_name: ${{ github.event.inputs.LL_VER }}
body: |
LeviLamina version: ${{ github.event.inputs.LL_VER }}
BDS core needed version: ${{ steps.get_bds_core_version.outputs.bds_core_version }}
Include LSE: ${{ github.event.inputs.LSE }}
Include Runtime: ${{ github.event.inputs.RUNTIME }}
Use user_scripts.bat: ${{ github.event.inputs.SCRIPTS }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}