Skip to content

Pack LeviLamina

Pack LeviLamina #60

Workflow file for this run

name: Pack LeviLamina
on:
workflow_dispatch:
inputs:
LL_VER:
description: 'LeviLamina version'
required: true
default: '0.1.0'
LSE:
description: 'If include LegacyScriptEngine'
required: false
default: 'false'
RUNTIME:
description: 'If include runtime for LeviLamina'
required: false
default: 'false'
SCRIPTS:
description: 'Use user_scripts.bat'
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
cd .\scripts
Invoke-WebRequest -Uri https://github.com/lippkg/lip/releases/latest/download/lip-windows-amd64.zip -Outfile .\lip.zip
Invoke-WebRequest -Uri https://www.7-zip.org/a/7z2401-x64.exe -Outfile .\7z_installer.exe
.\7z_installer.exe
unzip lip.zip
"$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: |
# alias lip.exe install -y -> lipin
user_scripts.ps1
- name: πŸ“‚ Remove BDS
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=$(echo $get_version.ps1)" | 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_packed.zip .\ll\
- name: Upload Artifact
uses: actions/upload-artifact@v4
with:
name: ll_packed
path: 'll_packed.zip'
Release:
permissions: write-all
runs-on: ubuntu-latest
steps:
- name: Download Artifact
uses: actions/download-artifact@v3
with:
name: ll_packed
- name: Unzip Artifact
run: |
sudo apt install unzip tree
ls
unzip ll_packed.zip
tree
- name: Get version
uses: FTS427/get_bds_version@main
id: get_version
with:
dotlip_dir: 'll/.lip'
- name: Rename
run: |
mv ll_packed.zip ll_${{ github.event.inputs.LL_VER }}-bds_${{ steps.get_version.outputs.version }}.zip
- name: πŸŽ‰ Upload Release
uses: softprops/action-gh-release@v1
with:
files: ll_${{ github.event.inputs.LL_VER }}-bds_${{ steps.get_version.outputs.version }}.zip
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_version.outputs.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 }}