Skip to content

Commit

Permalink
Generate certificates
Browse files Browse the repository at this point in the history
  • Loading branch information
m-kuhn committed Nov 17, 2023
1 parent 404ea24 commit cbcdf34
Show file tree
Hide file tree
Showing 2 changed files with 70 additions and 7 deletions.
39 changes: 39 additions & 0 deletions .github/workflows/apple_certs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
---
name: 🍏 iOS

on:
push: # TODO : delete
branches:
- fastlane2

schedule:
- cron: '30 2 * * *'

workflow_dipatch:

jobs:
sync_certs:
name: sync certs
runs-on: macos-12

steps:
- name: 🐣 Checkout
uses: actions/checkout@v4
with:
submodules: recursive

- name: ⛓️ Setup SSH
uses: webfactory/ssh-agent@v0.8.0
with:
ssh-private-key: ${{ secrets.SSH_KEY_DEPLOYMENT_CERTIFICATES }}

- name: 🔏 Sync certs
env:
bundle_id: ch.opengis.qfield
issuer_id: ${{ secrets.IOS_APPSTORE_ISSUER_ID }}
api_key_id: ${{ secrets.IOS_APPSTORE_KEY_ID }}
api_private_key: ${{ secrets.IOS_APPSTORE_PRIVATE_KEY }}
MATCH_PASSWORD: ${{ secrets.MATCH_PASSWORD }}
run: |
bundle install
bundle exec fastlane ios
38 changes: 31 additions & 7 deletions fastlane/Fastfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,13 @@ platform :ios do
signing_type = options[:type] # "development", "appstore"

setup_ci if is_ci

api_key = app_store_connect_api_key(
key_id: ENV["api_key_id"],
issuer_id: ENV["issuer_id"],
key_content: ENV["api_private_key"],
duration: 1200
)
#
# api_key = app_store_connect_api_key(
# key_id: ENV["api_key_id"],
# issuer_id: ENV["issuer_id"],
# key_content: ENV["api_private_key"],
# duration: 1200
# )

match(
type: signing_type,
Expand All @@ -25,4 +25,28 @@ platform :ios do
app_directory: 'ci-builds/ios/#{ENV["CI_PACKAGE_FILE_SUFFIX"]}'
)
end

desc "Generate new certificates"
lane :generate_new_certificates do
setup_ci if is_ci

api_key = app_store_connect_api_key(
key_id: ENV["api_key_id"],
issuer_id: ENV["issuer_id"],
key_content: ENV["api_private_key"],
duration: 1200
)
sync_code_signing(
type: "adhoc",
app_identifier: ['ch.opengis.qfield'],
force_for_new_devices: true,
readonly: false
)
sync_code_signing(
type: "appstore",
app_identifier: ['ch.opengis.qfield'],
force_for_new_devices: true,
readonly: false
)
end
end

0 comments on commit cbcdf34

Please sign in to comment.