From 56891e9e786577e735f796d065207af9b430187f Mon Sep 17 00:00:00 2001 From: MarkG Date: Tue, 26 Dec 2023 09:38:24 +0700 Subject: [PATCH] test --- .github/workflows/test_add_device_profile.yml | 7 ++++--- fastlane/Constants/Secret.swift | 4 ++++ fastlane/Fastfile.swift | 9 +++------ 3 files changed, 11 insertions(+), 9 deletions(-) diff --git a/.github/workflows/test_add_device_profile.yml b/.github/workflows/test_add_device_profile.yml index 6a2adaf7..fdc6e972 100644 --- a/.github/workflows/test_add_device_profile.yml +++ b/.github/workflows/test_add_device_profile.yml @@ -5,6 +5,7 @@ name: Test Add device and regenerate profiles with fastlane match ### MATCH_PASSWORD on: + pull_request: workflow_dispatch: inputs: devices: @@ -23,7 +24,7 @@ on: jobs: create_files: name: Create certificates and profiles - runs-on: [self-hosted, macOS] + runs-on: macOS-latest steps: - name: Checkout the repository uses: actions/checkout@v2 @@ -42,8 +43,8 @@ jobs: run: bundle exec fastlane addDevicesGenerateProfiles env: MATCH_PASSWORD: ${{ secrets.MATCH_PASS }} - DEVICES: ${{ inputs.devices }} - PLATFORM: ${{ inputs.platform }} + DEVICES: '{"Luka iPhone 6": "1234567890123456789012345678901234567890","Felix iPad Air 2": "abcdefghijklmnopqrstvuwxyzabcdefghijklmn"}' + PLATFORM: "ios" - name: Clean up keychain if: ${{ always() }} diff --git a/fastlane/Constants/Secret.swift b/fastlane/Constants/Secret.swift index 12f37911..6bc1ed25 100644 --- a/fastlane/Constants/Secret.swift +++ b/fastlane/Constants/Secret.swift @@ -18,4 +18,8 @@ enum Secret { static let appStoreIssuerIdKey = EnvironmentParser.string(key: "ISSUER_ID") static let bumpAppStoreBuildNumber = EnvironmentParser.bool(key: "BUMP_APP_STORE_BUILD_NUMBER") + + static let devices = EnvironmentParser.string(key: "DEVICES") + + static let platform = EnvironmentParser.string(key: "PLATFORM") } diff --git a/fastlane/Fastfile.swift b/fastlane/Fastfile.swift index 16d35965..2ef94943 100644 --- a/fastlane/Fastfile.swift +++ b/fastlane/Fastfile.swift @@ -176,20 +176,17 @@ class Fastfile: LaneFile { Match.syncCodeSigning(type: .adHoc, environment: .staging, isForce: true) } - func addDevicesGenerateProfiles(withOptions options:[String: String]?) { + func addDevicesGenerateProfilesLane() { desc("Add device and regenerate profiles with match") - guard - let json = options?["devices"], - let devices = SocketResponse.convertToDictionary(text: json), - let platform = options?["devices_type"] else { + guard let devices = SocketResponse.convertToDictionary(text: Secret.devices) else { return } registerDevices( devices: .userDefined(devices), teamId: .userDefined(Constant.appleStagingTeamId), - platform: platform + platform: Secret.platform ) Match.syncCodeSigning(type: .development, environment: .staging, isForce: true)