Pack LeviLamina #63
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Pack LeviLamina | |
on: | |
workflow_dispatch: | |
inputs: | |
LL_VER: | |
description: 'LeviLamina version' | |
required: true | |
default: '0.1.0' | |
LSE: | |
description: 'If include LSE' | |
required: false | |
default: 'false' | |
RUNTIME: | |
description: 'If include runtime for LeviLamina' | |
required: false | |
default: 'false' | |
SCRIPTS: | |
description: '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 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 | |
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: | | |
#$file = Get-ChildItem -Path .\.cache\bdsdown\ -File | Select-Object -First 1 | |
#"bds_core_version=$(echo $file.Name)" | Out-File -FilePath $env:GITHUB_OUTPUT -Append | |
#Remove-Item -Path $file.FullName | |
"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_${{ github.event.inputs.LL_VER }}-bds_${{ steps.get_bds_core_version.outputs.bds_core_version }} .\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 }} | |
name: LeviLamina Packed - ${{ github.event.inputs.LL_VER }} | |
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 }} | |