Skip to content

Commit

Permalink
Rename to original names create_certs.yml name: 3. Create Certificates
Browse files Browse the repository at this point in the history
Changed to reduce need for updating docs and instructions. The workflow for users will be the same as before this PR, but missing or invalid certificates or profiles will be updated automatically.

Update job and step names in create_certs.yml

Rename job check_certs to create_certs (original name)

- Keep step name check_certs
- Update step name under nuke_certs
- add comments for set -e at fastlane nuke_certs and fastlane certs

create_certs.yml job create_certs: name: Certificates
  • Loading branch information
bjornoleh committed Jan 14, 2025
1 parent b6bb80a commit 634bbae
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 14 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build_loop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ jobs:
# creates new certs if the repository variable ENABLE_NUKE_CERTS == 'true'
check_certs:
name: Check certificates
uses: ./.github/workflows/create_certificates.yml
uses: ./.github/workflows/create_certs.yml
secrets: inherit

# Checks if GH_PAT holds workflow permissions
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name: 3. Check Certificates
run-name: Check Certificates (${{ github.ref_name }})
name: 3. Create Certificates
run-name: Create Certificates (${{ github.ref_name }})

on: [workflow_call, workflow_dispatch]

Expand All @@ -18,7 +18,8 @@ jobs:
uses: ./.github/workflows/validate_secrets.yml
secrets: inherit

check_certs:
create_certs:
name: Certificates
needs: validate
runs-on: macos-14
outputs:
Expand All @@ -41,17 +42,17 @@ jobs:
- name: Install Project Dependencies
run: bundle install

# Create or update provisioning profiles
- name: Check certificate and profiles
# Create or update Distribution certificate and provisioning profiles
- name: Check and create or update Distribution certificate and profiles if needed
run: |
echo "Running Fastlane certs lane..."
bundle exec fastlane certs || true # ignore and continue on errors without annotating an exit code
- name: Check Distribution Certificate and create or renew if needed
- name: Check Distribution certificate and launch Nuke certificates if needed
run: bundle exec fastlane check_and_renew_certificates
id: check_certs

- name: Set output based on Fastlane result
- name: Set output and annotations based on Fastlane result
id: set_output
run: |
CERT_STATUS_FILE="${{ github.workspace }}/fastlane/new_certificate_needed.txt"
Expand Down Expand Up @@ -84,12 +85,13 @@ jobs:
# Nuke Certs if needed, and if the repository variable ENABLE_NUKE_CERTS is set to 'true', or if FORCE_NUKE_CERTS is set to 'true', which will always force certs to be nuked
nuke_certs:
needs: [validate, check_certs]
name: Nuke certificates
needs: [validate, create_certs]
runs-on: macos-14
if: ${{ (needs.check_certs.outputs.new_certificate_needed == 'true' && vars.ENABLE_NUKE_CERTS == 'true') || vars.FORCE_NUKE_CERTS == 'true' }}
if: ${{ (needs.create_certs.outputs.new_certificate_needed == 'true' && vars.ENABLE_NUKE_CERTS == 'true') || vars.FORCE_NUKE_CERTS == 'true' }}
steps:
- name: Output from Check_certs
run: echo "new_certificate_needed=${{ needs.check_certs.outputs.new_certificate_needed }}"
- name: Output from step id 'check_certs'
run: echo "new_certificate_needed=${{ needs.create_certs.outputs.new_certificate_needed }}"

- name: Checkout repository
uses: actions/checkout@v4
Expand All @@ -99,12 +101,12 @@ jobs:

- name: Run Fastlane nuke_certs
run: |
set -e
set -e # Set error immediately after this step if error occurs
bundle exec fastlane nuke_certs
- name: Recreate Distribution certificate after nuking
run: |
set -e
set -e # Set error immediately after this step if error occurs
bundle exec fastlane certs
- name: Add success annotations for nuke and certificate recreation
Expand Down

0 comments on commit 634bbae

Please sign in to comment.