diff --git a/.github/workflows/auto_pack.yml b/.github/workflows/auto_pack.yml index 93f7999..a1a1856 100644 --- a/.github/workflows/auto_pack.yml +++ b/.github/workflows/auto_pack.yml @@ -114,8 +114,7 @@ jobs: 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 + "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 @@ -130,12 +129,12 @@ jobs: - name: 📦 Pack Files run: | - 7z a ll_${{ steps.formated_ver.outputs.ll_version }}-bds_${{ steps.get_bds_core_version.outputs.bds_core_version }} .\ll\ + 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 }} + 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: | diff --git a/scripts/get_bds_version.py b/scripts/get_bds_version.py new file mode 100644 index 0000000..87f27c8 --- /dev/null +++ b/scripts/get_bds_version.py @@ -0,0 +1,23 @@ +import json +import re +try: + + with open(".\\.lip\\metadata\\github.com%2FLiteLDev%2Fbds.json") as file: + json_data = file.read() +except FileNotFoundError: + print("File not found") + raise SystemExit +except Exception as e: + print(e) + raise SystemExit +data = json.loads(json_data) + +post_install_command = data['commands']['post_install'][0] +match = re.search(r'version://windows/([^\\]+)', post_install_command) + +if match: + version_number = match.group(1) + print(version_number) +else: + print("???") + \ No newline at end of file