From ff177985fca84b6bc781d6acc86be794677cd399 Mon Sep 17 00:00:00 2001 From: bjornoleh Date: Wed, 8 Jan 2025 00:26:04 +0100 Subject: [PATCH] Delete unused workflow --- .github/workflows/manage_certificates.yml | 48 ----------------------- fastlane/Fastfile | 46 ---------------------- 2 files changed, 94 deletions(-) delete mode 100644 .github/workflows/manage_certificates.yml diff --git a/.github/workflows/manage_certificates.yml b/.github/workflows/manage_certificates.yml deleted file mode 100644 index 575e8b0a5..000000000 --- a/.github/workflows/manage_certificates.yml +++ /dev/null @@ -1,48 +0,0 @@ -name: Manage Certificates -run-name: Manage Certificates (${{ github.ref_name }}) -on: - workflow_dispatch: - inputs: - expiration_threshold: - description: "Days before expiration to check certificates" - required: false - default: "30" - -jobs: - manage_certificates: - runs-on: macos-latest - steps: - # Step 1: Checkout the Repository - - name: Checkout Repository - uses: actions/checkout@v4 - - # Step 2: Set Up Ruby and Fastlane - - name: Set up Ruby - uses: ruby/setup-ruby@v1 - with: - ruby-version: 3.0 # Specify the Ruby version needed for Fastlane - - - name: Install Fastlane - run: gem install fastlane - - # Step 3: Run the Manage Certificates Lane - - name: Manage Certificates - run: fastlane ios manage_certs - env: - TEAMID: ${{ secrets.TEAMID }} - FASTLANE_KEY_ID: ${{ secrets.FASTLANE_KEY_ID }} - FASTLANE_ISSUER_ID: ${{ secrets.FASTLANE_ISSUER_ID }} - FASTLANE_KEY: ${{ secrets.FASTLANE_KEY }} - FASTLANE_USER: ${{ secrets.FASTLANE_USER }} - MATCH_PASSWORD: ${{ secrets.MATCH_PASSWORD }} - GH_PAT: ${{ secrets.GH_PAT }} - CERT_EXPIRATION_THRESHOLD: ${{ github.event.inputs.expiration_threshold }} - - # Step 4: Post Workflow Summary (Optional) - - name: Notify Success - if: success() - run: echo "Certificate management completed successfully." - - - name: Notify Failure - if: failure() - run: echo "Certificate management failed. Please check the logs." diff --git a/fastlane/Fastfile b/fastlane/Fastfile index 60acaf5e1..f4fc08cac 100644 --- a/fastlane/Fastfile +++ b/fastlane/Fastfile @@ -278,52 +278,6 @@ platform :ios do ) end - desc "Manage Certificates" - lane :manage_certs do - setup_ci if ENV['CI'] - ENV["MATCH_READONLY"] = false.to_s - - api_key = app_store_connect_api_key( - key_id: "#{FASTLANE_KEY_ID}", - issuer_id: "#{FASTLANE_ISSUER_ID}", - key_content: "#{FASTLANE_KEY}" - ) - - # Check for expiring certificates - UI.message("Checking for certificates expiring within #{CERT_EXPIRATION_THRESHOLD} days...") - - expiring_certs = Spaceship::Portal.certificate.all.select do |cert| - days_to_expire = (cert.expires - Time.now) / (60 * 60 * 24) - days_to_expire < CERT_EXPIRATION_THRESHOLD.to_i - end - - if expiring_certs.empty? - UI.success("No certificates are expiring within the next #{CERT_EXPIRATION_THRESHOLD} days.") - else - UI.message("Found #{expiring_certs.count} expiring certificates:") - expiring_certs.each do |cert| - UI.message(" - #{cert.name} (expires on #{cert.expires})") - end - - # Renew certificates - UI.message("Renewing certificates...") - match( - type: "appstore", - force: true, - git_basic_authorization: Base64.strict_encode64("#{GITHUB_REPOSITORY_OWNER}:#{GH_PAT}"), - app_identifier: [ - "com.#{TEAMID}.loopkit.Loop", - "com.#{TEAMID}.loopkit.Loop.statuswidget", - "com.#{TEAMID}.loopkit.Loop.LoopWatch.watchkitextension", - "com.#{TEAMID}.loopkit.Loop.LoopWatch", - "com.#{TEAMID}.loopkit.Loop.Loop-Intent-Extension", - "com.#{TEAMID}.loopkit.Loop.LoopWidgetExtension", - ] - ) - UI.success("Certificates renewed successfully.") - end - end - desc "Check Certificates" lane :check_and_revoke_certificates do setup_ci if ENV['CI']