Skip to content

Commit f6a571c

Browse files
committed
feat: füge setup.py hinzu, um den TAG in installer.py zu ersetzen und aktualisiere den Build-Prozess im Release-Workflow
1 parent bc13590 commit f6a571c

3 files changed

Lines changed: 12 additions & 2 deletions

File tree

.github/workflows/release.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,8 @@ jobs:
2626
2727
- name: Run build step (example)
2828
run: |
29-
pyinstaller --onefile installer.py ${{ github.event.release.tag_name }}
29+
python setup.py ${{ github.event.release.tag_name }}
30+
pyinstaller --onefile installer.py
3031
3132
- name: Upload Asset to Release
3233
uses: softprops/action-gh-release@v1

installer.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99

1010
# === CONFIGURATION ===
1111
TARGET_DIR = os.path.expanduser("~/Documents/mc")
12-
TAG = sys.argv[1] if len(sys.argv) > 1 else "1.1.0"
12+
TAG = "!$!TAG!$!"
1313
ZIP_URL = "https://github.com/StoppedwummPython/minecraft-launcher/archive/refs/tags/" + TAG + ".zip"
1414

1515
def download_zip(url, dest_path):

setup.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
import sys
2+
content = ""
3+
with open("installer.py", "r") as f:
4+
content = f.read()
5+
6+
content = content.replace("!$!TAG!$!", sys.argv[1])
7+
8+
with open("installer.py", "w") as f:
9+
f.write(content)

0 commit comments

Comments
 (0)