From 84215f04dad6f685b3aa99978850dfb9497334b8 Mon Sep 17 00:00:00 2001 From: Balazs Perlaki-Horvath Date: Sat, 1 Feb 2025 17:55:03 +0100 Subject: [PATCH] Add dynamic team id --- .github/workflows/cd.yml | 9 ++++++--- src/info_parser.py | 1 + src/tag_validator.py | 1 + 3 files changed, 8 insertions(+), 3 deletions(-) diff --git a/.github/workflows/cd.yml b/.github/workflows/cd.yml index 98f0db3..78d4575 100644 --- a/.github/workflows/cd.yml +++ b/.github/workflows/cd.yml @@ -83,7 +83,7 @@ jobs: ls -la - - name: Set up scheme, version, build_number from files + - name: Set up scheme, version, build_number, and team-id from files run: | # move the checked out github actions to root folder: mv apple/.github/ . @@ -94,6 +94,9 @@ jobs: VERSION=$(<./apple/custom/.version_number) echo "VERSION=$VERSION" >> $GITHUB_ENV + TEAM_ID=$(<./apple/custom/.team_id) + echo "TEAM_ID=$TEAM_ID" >> $GITHUB_ENV + # taken from: kiwix/kiwix-apple .github/workflows/cd.yml - name: Set up variables for build env: @@ -159,14 +162,14 @@ jobs: env: APPLE_SIGNING_ALTOOL_USERNAME: ${{ secrets.APPLE_SIGNING_ALTOOL_USERNAME }} APPLE_SIGNING_ALTOOL_PASSWORD: ${{ secrets.APPLE_SIGNING_ALTOOL_PASSWORD }} - APPLE_SIGNING_TEAM: ${{ secrets.APPLE_SIGNING_TEAM }} + TEAM_ID: ${{ env.TEAM_ID }} run: | security find-identity -v $KEYCHAIN security unlock-keychain -p $KEYCHAIN_PASSWORD $KEYCHAIN xcrun notarytool store-credentials \ --apple-id "${APPLE_SIGNING_ALTOOL_USERNAME}" \ --password "${APPLE_SIGNING_ALTOOL_PASSWORD}" \ - --team-id "${APPLE_SIGNING_TEAM}" \ + --team-id "${TEAM_ID}" \ --validate \ --keychain $KEYCHAIN \ $KEYCHAIN_PROFILE diff --git a/src/info_parser.py b/src/info_parser.py index 1ed2ad9..65fed31 100644 --- a/src/info_parser.py +++ b/src/info_parser.py @@ -42,6 +42,7 @@ class InfoParser: self.data[JSON_KEY_ZIM_URL]) self.version = Version.from_file_name(file_name=self.zim_file_name, build_number=build_number) + self.development_team_id = self._development_team() def create_plist(self, based_on_plist_file): with based_on_plist_file.open(mode="rb") as file: diff --git a/src/tag_validator.py b/src/tag_validator.py index 55decd2..6406547 100644 --- a/src/tag_validator.py +++ b/src/tag_validator.py @@ -43,6 +43,7 @@ def _is_valid(tag): Path('.brand_name').write_text(f"{brand.name}") Path('.build_number').write_text(f"{version.build_number}") Path('.version_number').write_text(f"{version.semantic}") + Path('.team_id').write_text(f"{parser.development_team_id}") # required as an output, we can pipe on: print(f"{brand.name} {version.build_number}")