Pack LeviLamina&LegacyScriptEngine #20
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&LegacyScriptEngine | |
on: | |
workflow_dispatch: | |
inputs: | |
LeviLamina: | |
description: 'LeviLamina version' | |
required: true | |
default: '0.13.5' | |
LSE: | |
description: 'LegacyScriptEngine version' | |
required: true | |
default: '0.8.20' | |
jobs: | |
build: | |
if: github.event.repository.owner.id == github.event.sender.id | |
permissions: | |
contents: write | |
runs-on: windows-latest | |
steps: | |
- name: Check Out | |
uses: actions/checkout@v4 | |
- name: Download Lip | |
run: | | |
Invoke-WebRequest -Uri https://github.com/futrime/lip/releases/download/v0.24.0/lip-windows-amd64.zip -OutFile ./lip.zip | |
Expand-Archive -Path .\lip.zip -DestinationPath .\lip | |
mv -Path .\lip\lip.exe -Destination .\lip.exe | |
del lip.zip | |
del -Path .\lip -Recurse | |
mkdir LeviLamina | |
- name: Download LeviLamina & Delete BDS | |
working-directory: LeviLamina | |
run: | | |
..\lip.exe install -y github.com/LiteLDev/LeviLamina@${{ github.event.inputs.LeviLamina }} | |
copy .\.lip\metadata\github.com%2FLiteLDev%2Fbds.json .\bds.json | |
..\lip.exe uninstall -y github.com/LiteLDev/bds | |
mv -Path .\bds.json -Destination .\.lip\metadata\github.com%2FLiteLDev%2Fbds.json | |
del allowlist.json | |
del bedrock_server_mod.exe | |
del permissions.json | |
del server.properties | |
del -Path .\.cache -Recurse | |
- name: Download LSE & Get BDS Version | |
working-directory: LeviLamina | |
id: get_bds_core_version | |
run: | | |
../lip install -y gitea.litebds.com/LiteLDev/legacy-script-engine-lua@${{ github.event.inputs.LSE }} | |
../lip install -y gitea.litebds.com/LiteLDev/legacy-script-engine-quickjs@${{ github.event.inputs.LSE }} | |
../lip install -y gitea.litebds.com/LiteLDev/legacy-script-engine-nodejs@${{ github.event.inputs.LSE }} | |
../lip install -y gitea.litebds.com/LiteLDev/legacy-script-engine-python@${{ github.event.inputs.LSE }} | |
../lip install -y github.com/LiteLDev/LegacyScriptEngine@${{ github.event.inputs.LSE }} | |
$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 | |
- name: Pack files | |
working-directory: LeviLamina | |
run: | | |
Compress-Archive -Path * -DestinationPath "LeviLamina-${{ github.event.inputs.LeviLamina }} with LSE-${{ github.event.inputs.LSE }}.zip" | |
copy "LeviLamina-${{ github.event.inputs.LeviLamina }} with LSE-${{ github.event.inputs.LSE }}.zip" ..\ | |
- name: Upload to Release | |
uses: softprops/action-gh-release@v1 | |
with: | |
files: "LeviLamina-${{ github.event.inputs.LeviLamina }} with LSE-${{ github.event.inputs.LSE }}.zip" | |
name: LeviLamina-${{ github.event.inputs.LeviLamina }}&LSE-${{ github.event.inputs.LSE }} | |
tag_name: ${{ github.event.inputs.LeviLamina }}&${{ github.event.inputs.LSE }} | |
body: | | |
LeviLamina版本: ${{ github.event.inputs.LeviLamina }} | |
LSE版本: ${{ github.event.inputs.LSE }} | |
适用的BDS版本(仅供参考): ${{ steps.get_bds_core_version.outputs.bds_core_version }} | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |