From aa224f68c7802ab2e1f6d39a21d667a5dc16f83d Mon Sep 17 00:00:00 2001 From: mahee96 <47920326+mahee96@users.noreply.github.com> Date: Tue, 24 Feb 2026 09:13:09 +0530 Subject: [PATCH] ci: more fixes --- .github/workflows/alpha.yml | 35 +++++++++++------------ .github/workflows/nightly.yml | 39 +++++++++++++------------- scripts/ci/generate_source_metadata.py | 3 +- scripts/ci/workflow.py | 18 ++++++------ 4 files changed, 46 insertions(+), 49 deletions(-) diff --git a/.github/workflows/alpha.yml b/.github/workflows/alpha.yml index bea83761..f57d73be 100644 --- a/.github/workflows/alpha.yml +++ b/.github/workflows/alpha.yml @@ -30,10 +30,10 @@ jobs: # -------------------------------------------------- - uses: actions/checkout@v4 with: - repository: 'SideStore/beta-build-num' + repository: "SideStore/beta-build-num" ref: ${{ env.CHANNEL }} token: ${{ secrets.CROSS_REPO_PUSH_KEY }} - path: 'Dependencies/beta-build-num' + path: "Dependencies/beta-build-num" fetch-depth: 1 - name: Setup Env @@ -48,15 +48,16 @@ jobs: "${{ env.CHANNEL }}" \ "$SHORT_COMMIT") + python3 scripts/ci/workflow.py set-marketing-version "$QUALIFIED_VERSION" + echo "BUILD_NUM=$BUILD_NUM" | tee -a $GITHUB_ENV - echo "MARKETING_VERSION=$MARKETING_VERSION" | tee -a $GITHUB_ENV echo "SHORT_COMMIT=$SHORT_COMMIT" | tee -a $GITHUB_ENV - echo "VERSION=$QUALIFIED_VERSION" | tee -a $GITHUB_ENV + echo "MARKETING_VERSION=$QUALIFIED_VERSION" | tee -a $GITHUB_ENV - name: Setup Xcode uses: maxim-lobanov/setup-xcode@v1.6.0 with: - xcode-version: '26.2' + xcode-version: "26.2" - name: Restore Cache (exact) id: xcode-cache-exact @@ -77,7 +78,7 @@ jobs: ~/Library/Caches/org.swift.swiftpm key: xcode-build-cache-${{ github.ref_name }}- - # -------------------------------------------------- + # -------------------------------------------------- # build and test # -------------------------------------------------- - name: Clean @@ -133,11 +134,11 @@ jobs: exit $STATUS # -------------------------------------------------- - # artifacts + # artifacts # -------------------------------------------------- - uses: actions/upload-artifact@v4 with: - name: encrypted-build-logs-${{ env.VERSION }}.zip + name: encrypted-build-logs-${{ env.MARKETING_VERSION }}.zip path: encrypted-build-logs.zip - uses: actions/upload-artifact@v4 @@ -154,22 +155,22 @@ jobs: - uses: actions/upload-artifact@v4 with: - name: SideStore-${{ env.VERSION }}.ipa + name: SideStore-${{ env.MARKETING_VERSION }}.ipa path: SideStore.ipa - uses: actions/upload-artifact@v4 with: - name: SideStore-${{ env.VERSION }}-dSYMs.zip + name: SideStore-${{ env.MARKETING_VERSION }}-dSYMs.zip path: SideStore.dSYMs.zip - uses: actions/checkout@v4 with: - repository: 'SideStore/apps-v2.json' - ref: 'main' + repository: "SideStore/apps-v2.json" + ref: "main" token: ${{ secrets.CROSS_REPO_PUSH_KEY }} - path: 'SideStore/apps-v2.json' + path: "SideStore/apps-v2.json" # -------------------------------------------------- - # deploy + # deploy # -------------------------------------------------- - name: Deploy env: @@ -189,18 +190,16 @@ jobs: "$CHANNEL" \ "$SHORT_COMMIT" \ "$MARKETING_VERSION" \ - "$VERSION" \ "$CHANNEL" \ "$BUNDLE_ID" \ "$IPA_NAME" \ "$LAST_SUCCESSFUL_COMMIT" RELEASE_NOTES=$(python3 scripts/ci/workflow.py retrieve-release-notes "$CHANNEL") - + python3 scripts/ci/workflow.py upload-release \ "$RELEASE_NAME" \ "$CHANNEL" \ - "$VERSION" \ "$GITHUB_SHA" \ "$GITHUB_REPOSITORY" \ - "$UPSTREAM_CHANNEL" \ No newline at end of file + "$UPSTREAM_CHANNEL" diff --git a/.github/workflows/nightly.yml b/.github/workflows/nightly.yml index 41e0764a..9f5db6f5 100644 --- a/.github/workflows/nightly.yml +++ b/.github/workflows/nightly.yml @@ -4,7 +4,7 @@ on: push: branches: [develop] schedule: - - cron: '0 0 * * *' + - cron: "0 0 * * *" workflow_dispatch: concurrency: @@ -17,7 +17,7 @@ jobs: env: RELEASE_NAME: Nightly CHANNEL: nightly - UPSTREAM_CHANNEL: '' + UPSTREAM_CHANNEL: "" steps: - uses: actions/checkout@v4 @@ -32,10 +32,10 @@ jobs: # -------------------------------------------------- - uses: actions/checkout@v4 with: - repository: 'SideStore/beta-build-num' + repository: "SideStore/beta-build-num" ref: ${{ env.CHANNEL }} token: ${{ secrets.CROSS_REPO_PUSH_KEY }} - path: 'Dependencies/beta-build-num' + path: "Dependencies/beta-build-num" fetch-depth: 1 - name: Setup Env @@ -50,15 +50,16 @@ jobs: "${{ env.CHANNEL }}" \ "$SHORT_COMMIT") + python3 scripts/ci/workflow.py set-marketing-version "$QUALIFIED_VERSION" + echo "BUILD_NUM=$BUILD_NUM" | tee -a $GITHUB_ENV - echo "MARKETING_VERSION=$MARKETING_VERSION" | tee -a $GITHUB_ENV echo "SHORT_COMMIT=$SHORT_COMMIT" | tee -a $GITHUB_ENV - echo "VERSION=$QUALIFIED_VERSION" | tee -a $GITHUB_ENV + echo "MARKETING_VERSION=$QUALIFIED_VERSION" | tee -a $GITHUB_ENV - name: Setup Xcode uses: maxim-lobanov/setup-xcode@v1.6.0 with: - xcode-version: '26.2' + xcode-version: "26.2" - name: Restore Cache (exact) id: xcode-cache-exact @@ -79,7 +80,7 @@ jobs: ~/Library/Caches/org.swift.swiftpm key: xcode-build-cache-${{ github.ref_name }}- - # -------------------------------------------------- + # -------------------------------------------------- # build and test # -------------------------------------------------- - name: Clean @@ -135,11 +136,11 @@ jobs: exit $STATUS # -------------------------------------------------- - # artifacts + # artifacts # -------------------------------------------------- - uses: actions/upload-artifact@v4 with: - name: encrypted-build-logs-${{ env.VERSION }}.zip + name: encrypted-build-logs-${{ env.MARKETING_VERSION }}.zip path: encrypted-build-logs.zip - uses: actions/upload-artifact@v4 @@ -156,22 +157,22 @@ jobs: - uses: actions/upload-artifact@v4 with: - name: SideStore-${{ env.VERSION }}.ipa + name: SideStore-${{ env.MARKETING_VERSION }}.ipa path: SideStore.ipa - uses: actions/upload-artifact@v4 with: - name: SideStore-${{ env.VERSION }}-dSYMs.zip + name: SideStore-${{ env.MARKETING_VERSION }}-dSYMs.zip path: SideStore.dSYMs.zip - uses: actions/checkout@v4 with: - repository: 'SideStore/apps-v2.json' - ref: 'main' + repository: "SideStore/apps-v2.json" + ref: "main" token: ${{ secrets.CROSS_REPO_PUSH_KEY }} - path: 'SideStore/apps-v2.json' + path: "SideStore/apps-v2.json" # -------------------------------------------------- - # deploy + # deploy # -------------------------------------------------- - name: Deploy env: @@ -191,18 +192,16 @@ jobs: "$CHANNEL" \ "$SHORT_COMMIT" \ "$MARKETING_VERSION" \ - "$VERSION" \ "$CHANNEL" \ "$BUNDLE_ID" \ "$IPA_NAME" \ "$LAST_SUCCESSFUL_COMMIT" RELEASE_NOTES=$(python3 scripts/ci/workflow.py retrieve-release-notes "$CHANNEL") - + python3 scripts/ci/workflow.py upload-release \ "$RELEASE_NAME" \ "$CHANNEL" \ - "$VERSION" \ "$GITHUB_SHA" \ "$GITHUB_REPOSITORY" \ - "$UPSTREAM_CHANNEL" \ No newline at end of file + "$UPSTREAM_CHANNEL" diff --git a/scripts/ci/generate_source_metadata.py b/scripts/ci/generate_source_metadata.py index c65d2323..61cbfa12 100644 --- a/scripts/ci/generate_source_metadata.py +++ b/scripts/ci/generate_source_metadata.py @@ -68,7 +68,6 @@ def main(): p.add_argument("--release-notes-dir", required=True) p.add_argument("--release-tag", required=True) - p.add_argument("--version", required=True) p.add_argument("--marketing-version", required=True) p.add_argument("--short-commit", required=True) p.add_argument("--release-channel", required=True) @@ -143,7 +142,7 @@ def main(): localized_description = textwrap.dedent(f""" This is release for: - - version: "{args.version}" + - version: "{args.marketing_version}" - revision: "{args.short_commit}" - timestamp: "{human}" diff --git a/scripts/ci/workflow.py b/scripts/ci/workflow.py index 28b88c05..2b65e3c7 100644 --- a/scripts/ci/workflow.py +++ b/scripts/ci/workflow.py @@ -140,7 +140,7 @@ def get_bundle_id(): ) def get_marketing_version(): - return runAndGet("grep MARKETING_VERSION Build.xcconfig | sed -e 's/MARKETING_VERSION = //g'") + return runAndGet(f"grep MARKETING_VERSION {ROOT}/Build.xcconfig | sed -e 's/MARKETING_VERSION = //g'") def set_marketing_version(qualified): run( @@ -277,7 +277,7 @@ def retrieve_release_notes(tag): # DEPLOY SOURCE.JSON # ---------------------------------------------------------- -def deploy(repo, source_json, release_tag, short_commit, marketing_version, version, channel, bundle_id, ipa_name, last_successful_commit=None): +def deploy(repo, source_json, release_tag, short_commit, marketing_version, channel, bundle_id, ipa_name, last_successful_commit=None): repo = (ROOT / repo).resolve() ipa_path = ROOT / ipa_name source_json_path = repo / source_json @@ -300,7 +300,6 @@ def deploy(repo, source_json, release_tag, short_commit, marketing_version, vers f"--output-name {metadata} " f"--release-notes-dir {ROOT} " f"--release-tag {release_tag} " - f"--version {version} " f"--marketing-version {marketing_version} " f"--short-commit {short_commit} " f"--release-channel {channel} " @@ -331,7 +330,7 @@ def deploy(repo, source_json, release_tag, short_commit, marketing_version, vers # regenerate after reset so we don't lose changes run(f"python3 {SCRIPTS}/update_source_metadata.py '{ROOT}/{metadata}' '{source_json_path}'", cwd=repo) run(f"git add --verbose {source_json}", cwd=repo) - run(f"git commit -m '{release_tag} - deployed {version}' || true", cwd=repo) + run(f"git commit -m '{release_tag} - deployed {marketing_version}' || true", cwd=repo) rc = subprocess.call("git push", shell=True, cwd=repo) @@ -365,7 +364,7 @@ def last_successful_commit(workflow, branch): return None -def upload_release(release_name, release_tag, version, commit_sha, repo, upstream_recommendation): +def upload_release(release_name, release_tag, commit_sha, repo, upstream_recommendation): token = getenv("GH_TOKEN") if token: os.environ["GH_TOKEN"] = token @@ -377,6 +376,7 @@ def upload_release(release_name, release_tag, version, commit_sha, repo, upstrea meta = json.loads(metadata_path.read_text()) + marketing_version = bool(meta.get("version_ipa")) is_beta = bool(meta.get("is_beta")) build_datetime = meta.get("version_date") @@ -406,7 +406,7 @@ def upload_release(release_name, release_tag, version, commit_sha, repo, upstrea Built at (UTC): `{built_time}` Built at (UTC date): `{built_date}` Commit SHA: `{commit_sha}` - Version: `{version}` + Version: `{marketing_version}` """ header = inspect.cleandoc(raw_body) @@ -483,9 +483,9 @@ COMMANDS = { "last-successful-commit" : (last_successful_commit, 2, " "), "release-notes" : (release_notes, 1, ""), "retrieve-release-notes" : (retrieve_release_notes, 1, ""), - "deploy" : (deploy, 10, - " [last_successful_commit]"), - "upload-release" : (upload_release, 6, " "), + "deploy" : (deploy, 9, + " [last_successful_commit]"), + "upload-release" : (upload_release, 5, " "), } def main():