mirror of
https://github.com/SideStore/SideStore.git
synced 2026-02-27 23:47:39 +01:00
CI: improve more ci worflow
This commit is contained in:
10
.github/workflows/nightly.yml
vendored
10
.github/workflows/nightly.yml
vendored
@@ -14,6 +14,10 @@ concurrency:
|
||||
jobs:
|
||||
build:
|
||||
runs-on: macos-26
|
||||
strategy:
|
||||
fail-fast: true
|
||||
matrix:
|
||||
xcode-version: ['26.2']
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
@@ -27,7 +31,6 @@ jobs:
|
||||
# runtime env setup
|
||||
# --------------------------------------------------
|
||||
- uses: actions/checkout@v4
|
||||
if: ${{ inputs.is_beta }}
|
||||
with:
|
||||
repository: 'SideStore/beta-build-num'
|
||||
ref: ${{ env.ref }}
|
||||
@@ -52,6 +55,11 @@ jobs:
|
||||
echo "SHORT_COMMIT=$SHORT_COMMIT" >> $GITHUB_ENV
|
||||
echo "VERSION=$QUALIFIED_VERSION" >> $GITHUB_ENV
|
||||
|
||||
- name: Setup Xcode
|
||||
uses: maxim-lobanov/setup-xcode@v1.6.0
|
||||
with:
|
||||
xcode-version: ${{ matrix.xcode-version }}
|
||||
|
||||
- name: Restore Cache
|
||||
id: xcode-cache
|
||||
uses: actions/cache/restore@v3
|
||||
|
||||
@@ -328,21 +328,32 @@ COMMANDS = {
|
||||
}
|
||||
|
||||
def main():
|
||||
def usage():
|
||||
lines = ["Available commands:"]
|
||||
for name, (_, argc, arg_usage) in COMMANDS.items():
|
||||
suffix = f" {arg_usage}" if arg_usage else ""
|
||||
lines.append(f" - {name}{suffix}")
|
||||
return "\n".join(lines)
|
||||
|
||||
if len(sys.argv) < 2:
|
||||
raise SystemExit("No command")
|
||||
raise SystemExit(usage())
|
||||
|
||||
cmd = sys.argv[1]
|
||||
|
||||
if cmd not in COMMANDS:
|
||||
raise SystemExit(f"Unknown command '{cmd}'")
|
||||
raise SystemExit(
|
||||
f"Unknown command '{cmd}'.\n\n{usage()}"
|
||||
)
|
||||
|
||||
func, argc, _ = COMMANDS[cmd]
|
||||
func, argc, arg_usage = COMMANDS[cmd]
|
||||
|
||||
if len(sys.argv) - 2 < argc:
|
||||
suffix = f" {arg_usage}" if arg_usage else ""
|
||||
raise SystemExit(f"Usage: workflow.py {cmd}{suffix}")
|
||||
|
||||
args = sys.argv[2:2 + argc]
|
||||
result = func(*args) if argc else func()
|
||||
func(*args) if argc else func()
|
||||
|
||||
if result is not None:
|
||||
print(result)
|
||||
|
||||
if __name__ == "__main__":
|
||||
main()
|
||||
Reference in New Issue
Block a user