mirror of
https://github.com/TagStudioDev/TagStudio.git
synced 2026-07-10 16:01:58 +02:00
feat(ci)!: rework workflows and build processes
All Python setups route through one local action, and checks are much more conditional. There is more to be done, but this is a significant improvement in processing time and redundancy. As well, nightly builds are made (though not made as GitHub releases.. yet).
This commit is contained in:
Executable
+14
@@ -0,0 +1,14 @@
|
||||
#!/usr/bin/env perl
|
||||
# SPDX-FileCopyrightText: (c) TagStudio Contributors
|
||||
# SPDX-License-Identifier: CC0-1.0
|
||||
|
||||
use strict;
|
||||
use warnings;
|
||||
use feature 'say';
|
||||
|
||||
# From: https://regex101.com/r/vkijKf/1
|
||||
if (($ARGV[0] // <STDIN>) =~ /^(0|[1-9]\d*)\.(0|[1-9]\d*)\.(0|[1-9]\d*)(?:-((?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\.(?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?(?:\+([0-9a-zA-Z-]+(?:\.[0-9a-zA-Z-]+)*))?$/) {
|
||||
foreach my $index (0 .. $#{^CAPTURE}) {
|
||||
say ${^CAPTURE}[$index] // "";
|
||||
}
|
||||
}
|
||||
Regular → Executable
+14
-8
@@ -1,17 +1,22 @@
|
||||
#!/usr/bin/env -S python -m PyInstaller
|
||||
# vi: ft=python
|
||||
# SPDX-FileCopyrightText: (c) TagStudio Contributors
|
||||
# SPDX-License-Identifier: GPL-3.0-only
|
||||
|
||||
|
||||
import argparse
|
||||
import platform
|
||||
from argparse import ArgumentParser
|
||||
from pathlib import Path
|
||||
from tomllib import load
|
||||
|
||||
from PyInstaller.building.api import COLLECT, EXE, PYZ
|
||||
from PyInstaller.building.build_main import Analysis
|
||||
from PyInstaller.building.osx import BUNDLE
|
||||
from tomllib import load
|
||||
|
||||
parser = ArgumentParser()
|
||||
# HACK: Without this, the script will fail if empty arguments are passed.
|
||||
parser.add_argument("_", nargs="*", help=argparse.SUPPRESS)
|
||||
parser.add_argument("--portable", action="store_true")
|
||||
options = parser.parse_args()
|
||||
|
||||
@@ -20,23 +25,24 @@ with open("pyproject.toml", "rb") as file:
|
||||
|
||||
system = platform.system()
|
||||
|
||||
project_root = Path("..", "src/tagstudio")
|
||||
name = pyproject["name"] if system == "Windows" else "tagstudio"
|
||||
icon = None
|
||||
if system == "Windows":
|
||||
icon = "src/tagstudio/resources/icon.ico"
|
||||
icon = Path(project_root, "resources/icon.ico")
|
||||
elif system == "Darwin":
|
||||
icon = "src/tagstudio/resources/icon.icns"
|
||||
icon = Path(project_root, "resources/icon.icns")
|
||||
|
||||
|
||||
datafiles = [
|
||||
("src/tagstudio/qt/*.json", "tagstudio/qt"),
|
||||
("src/tagstudio/qt/*.qrc", "tagstudio/qt"),
|
||||
("src/tagstudio/resources", "tagstudio/resources"),
|
||||
(f"{project_root}/qt/*.json", "tagstudio/qt"),
|
||||
(f"{project_root}/qt/*.qrc", "tagstudio/qt"),
|
||||
(f"{project_root}/resources", "tagstudio/resources"),
|
||||
]
|
||||
|
||||
a = Analysis(
|
||||
["src/tagstudio/main.py"],
|
||||
pathex=["src"],
|
||||
[Path(project_root, "main.py")],
|
||||
pathex=[],
|
||||
binaries=[],
|
||||
datas=datafiles,
|
||||
hiddenimports=[],
|
||||
|
||||
Reference in New Issue
Block a user