mirror of
https://github.com/kiwix/kiwix-apple.git
synced 2025-09-27 22:10:57 -04:00
Simplify CI steps, remove unused xcbuild param
This commit is contained in:
parent
2619fc42fd
commit
00127fd238
2
.github/actions/xcbuild/action.yml
vendored
2
.github/actions/xcbuild/action.yml
vendored
@ -8,8 +8,6 @@ inputs:
|
|||||||
required: true
|
required: true
|
||||||
xc-destination:
|
xc-destination:
|
||||||
required: true
|
required: true
|
||||||
upload-to:
|
|
||||||
required: true
|
|
||||||
APPLE_DEVELOPMENT_SIGNING_CERTIFICATE:
|
APPLE_DEVELOPMENT_SIGNING_CERTIFICATE:
|
||||||
required: true
|
required: true
|
||||||
APPLE_DEVELOPMENT_SIGNING_P12_PASSWORD:
|
APPLE_DEVELOPMENT_SIGNING_P12_PASSWORD:
|
||||||
|
10
.github/workflows/cd.yml
vendored
10
.github/workflows/cd.yml
vendored
@ -12,7 +12,7 @@ env:
|
|||||||
KEYCHAIN_PASSWORD: mysecretpassword
|
KEYCHAIN_PASSWORD: mysecretpassword
|
||||||
KEYCHAIN_PROFILE: build-profile
|
KEYCHAIN_PROFILE: build-profile
|
||||||
SSH_KEY: /tmp/id_rsa
|
SSH_KEY: /tmp/id_rsa
|
||||||
APPLE_STORE_AUTH_KEY_PATH: /tmp/authkey.p8
|
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
build_and_deploy:
|
build_and_deploy:
|
||||||
@ -32,12 +32,15 @@ jobs:
|
|||||||
# uploadto: app-store
|
# uploadto: app-store
|
||||||
runs-on: macos-13
|
runs-on: macos-13
|
||||||
env:
|
env:
|
||||||
APPLE_AUTH_PARAMS: "-authenticationKeyPath ${{ env.APPLE_STORE_AUTH_KEY_PATH }} -authenticationKeyID ${{ secrets.APPLE_STORE_AUTH_KEY_ID }} -authenticationKeyIssuerID ${{ secrets.APPLE_STORE_AUTH_KEY_ISSUER_ID }}"
|
APPLE_STORE_AUTH_KEY_PATH: /tmp/authkey.p8
|
||||||
|
APPLE_AUTH_PARAMS: "-authenticationKeyPath /tmp/authkey.p8 -authenticationKeyID ${{ secrets.APPLE_STORE_AUTH_KEY_ID }} -authenticationKeyIssuerID ${{ secrets.APPLE_STORE_AUTH_KEY_ISSUER_ID }}"
|
||||||
# conditionally updated later:
|
# conditionally updated later:
|
||||||
EXPORT_METHOD: "app-store"
|
EXPORT_METHOD: "app-store"
|
||||||
EXTRA_XCODEBUILD: ""
|
EXTRA_XCODEBUILD: ""
|
||||||
UPLOAD_TO: ""
|
UPLOAD_TO: ""
|
||||||
VERSION: ""
|
VERSION: ""
|
||||||
|
SIGNING_CERTIFICATE: ""
|
||||||
|
SIGNING_CERTIFICATE_P12_PASSWORD: ""
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout code
|
- name: Checkout code
|
||||||
@ -116,7 +119,6 @@ jobs:
|
|||||||
with:
|
with:
|
||||||
action: archive
|
action: archive
|
||||||
xc-destination: generic/platform=${{ matrix.platform }}
|
xc-destination: generic/platform=${{ matrix.platform }}
|
||||||
upload-to: ${{ env.UPLOAD_TO }}
|
|
||||||
version: ${{ env.VERSION }}
|
version: ${{ env.VERSION }}
|
||||||
APPLE_DEVELOPMENT_SIGNING_CERTIFICATE: ${{ secrets.APPLE_DEVELOPMENT_SIGNING_CERTIFICATE }}
|
APPLE_DEVELOPMENT_SIGNING_CERTIFICATE: ${{ secrets.APPLE_DEVELOPMENT_SIGNING_CERTIFICATE }}
|
||||||
APPLE_DEVELOPMENT_SIGNING_P12_PASSWORD: ${{ secrets.APPLE_DEVELOPMENT_SIGNING_P12_PASSWORD }}
|
APPLE_DEVELOPMENT_SIGNING_P12_PASSWORD: ${{ secrets.APPLE_DEVELOPMENT_SIGNING_P12_PASSWORD }}
|
||||||
|
47
.github/workflows/ci.yml
vendored
47
.github/workflows/ci.yml
vendored
@ -7,9 +7,6 @@ on:
|
|||||||
branches:
|
branches:
|
||||||
- main
|
- main
|
||||||
|
|
||||||
env:
|
|
||||||
APPLE_STORE_AUTH_KEY_PATH: /tmp/authkey.p8
|
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
authorize:
|
authorize:
|
||||||
# sets environment based on origin of PR: internal (non-existent) for own-repo or external (requires reviewer to run) for external repos
|
# sets environment based on origin of PR: internal (non-existent) for own-repo or external (requires reviewer to run) for external repos
|
||||||
@ -20,54 +17,38 @@ jobs:
|
|||||||
build:
|
build:
|
||||||
needs: authorize
|
needs: authorize
|
||||||
runs-on: macos-13
|
runs-on: macos-13
|
||||||
|
env:
|
||||||
|
EXTRA_XCODEBUILD: ""
|
||||||
|
APPLE_STORE_AUTH_KEY_PATH: /tmp/authkey.p8
|
||||||
|
APPLE_AUTH_PARAMS: "-authenticationKeyPath /tmp/authkey.p8 -authenticationKeyID ${{ secrets.APPLE_STORE_AUTH_KEY_ID }} -authenticationKeyIssuerID ${{ secrets.APPLE_STORE_AUTH_KEY_ISSUER_ID }}"
|
||||||
strategy:
|
strategy:
|
||||||
fail-fast: false
|
fail-fast: false
|
||||||
matrix:
|
matrix:
|
||||||
destination:
|
platform: [macOS, iOS]
|
||||||
- platform: macOS
|
|
||||||
- platform: iOS
|
|
||||||
xcode_extra: -sdk iphoneos
|
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout code
|
- name: Checkout code
|
||||||
uses: actions/checkout@v3
|
uses: actions/checkout@v4
|
||||||
with:
|
with:
|
||||||
# /!\ important: this checks out code from the HEAD of the PR instead of the main branch (for pull_request_target)
|
# /!\ important: this checks out code from the HEAD of the PR instead of the main branch (for pull_request_target)
|
||||||
ref: ${{ github.event.pull_request.head.sha || github.ref }}
|
ref: ${{ github.event.pull_request.head.sha || github.ref }}
|
||||||
|
|
||||||
- name: Add Apple Store Key
|
- name: Add Apple Store Key
|
||||||
if: ${{ matrix.destination.platform == 'iOS' }}
|
if: matrix.platform == 'iOS'
|
||||||
env:
|
run: echo "${{ secrets.APPLE_STORE_AUTH_KEY }}" | base64 --decode -o ${{ env.APPLE_STORE_AUTH_KEY_PATH}}
|
||||||
APPLE_STORE_AUTH_KEY_PATH: ${{ env.APPLE_STORE_AUTH_KEY_PATH }}
|
|
||||||
APPLE_STORE_AUTH_KEY: ${{ secrets.APPLE_STORE_AUTH_KEY }}
|
|
||||||
shell: bash
|
|
||||||
run: echo "${APPLE_STORE_AUTH_KEY}" | base64 --decode -o $APPLE_STORE_AUTH_KEY_PATH
|
|
||||||
|
|
||||||
- name: Extend EXTRA_XCODEBUILD
|
- name: Set EXTRA_XCODEBUILD
|
||||||
if: ${{ matrix.destination.platform == 'iOS' }}
|
if: matrix.platform == 'iOS'
|
||||||
env:
|
env:
|
||||||
EXTRA_XCODEBUILD: ${{ matrix.destination.xcode_extra }}
|
EXTRA_XCODEBUILD: "-sdk iphoneos ${{ env.APPLE_AUTH_PARAMS }}"
|
||||||
APPLE_STORE_AUTH_KEY_PATH: ${{ env.APPLE_STORE_AUTH_KEY_PATH }}
|
run: echo
|
||||||
APPLE_STORE_AUTH_KEY_ID: ${{ secrets.APPLE_STORE_AUTH_KEY_ID }}
|
|
||||||
APPLE_STORE_AUTH_KEY_ISSUER_ID: ${{ secrets.APPLE_STORE_AUTH_KEY_ISSUER_ID }}
|
|
||||||
shell: python
|
|
||||||
run: |
|
|
||||||
import os
|
|
||||||
extra_xcode = os.getenv("EXTRA_XCODEBUILD", "")
|
|
||||||
extra_xcode += f" -authenticationKeyPath {os.getenv('APPLE_STORE_AUTH_KEY_PATH')}"
|
|
||||||
extra_xcode += f" -authenticationKeyID {os.getenv('APPLE_STORE_AUTH_KEY_ID')}"
|
|
||||||
extra_xcode += f" -authenticationKeyIssuerID {os.getenv('APPLE_STORE_AUTH_KEY_ISSUER_ID')}"
|
|
||||||
|
|
||||||
with open(os.getenv("GITHUB_ENV"), "a") as fh:
|
|
||||||
fh.write(f"EXTRA_XCODEBUILD={extra_xcode}\n")
|
|
||||||
|
|
||||||
- name: Build
|
- name: Build
|
||||||
uses: ./.github/actions/xcbuild
|
uses: ./.github/actions/xcbuild
|
||||||
with:
|
with:
|
||||||
action: build
|
action: build
|
||||||
xc-destination: generic/platform=${{ matrix.destination.platform }}
|
xc-destination: generic/platform=${{ matrix.platform }}
|
||||||
upload-to: dev
|
|
||||||
version: CI
|
version: CI
|
||||||
APPLE_DEVELOPMENT_SIGNING_CERTIFICATE: ${{ secrets.APPLE_DEVELOPMENT_SIGNING_CERTIFICATE }}
|
APPLE_DEVELOPMENT_SIGNING_CERTIFICATE: ${{ secrets.APPLE_DEVELOPMENT_SIGNING_CERTIFICATE }}
|
||||||
APPLE_DEVELOPMENT_SIGNING_P12_PASSWORD: ${{ secrets.APPLE_DEVELOPMENT_SIGNING_P12_PASSWORD }}
|
APPLE_DEVELOPMENT_SIGNING_P12_PASSWORD: ${{ secrets.APPLE_DEVELOPMENT_SIGNING_P12_PASSWORD }}
|
||||||
EXTRA_XCODEBUILD: ${{ env.EXTRA_XCODEBUILD }}
|
EXTRA_XCODEBUILD: ${{ env.EXTRA_XCODEBUILD }}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user