Skip to content

U | sync to legacy

U | sync to legacy #7

Workflow file for this run

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 }}