Repository navigation
95 lines (80 loc) · 3 KB
/
Copy pathci_cd.yml
File metadata and controls
95 lines (80 loc) · 3 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
name: CI/CD
on:
# Push on main excluding tags
push:
branches:
- 'main'
tags-ignore:
- '*.*'
# PR
pull_request:
branches:
- 'main'
# Manual trigger
workflow_dispatch:
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
build:
name: CI/CD
runs-on: macos-latest
permissions:
actions: read
contents: read
security-events: write
steps:
- name: Checkout
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- name: Install tooling
run: |
brew install swiftlint
- name: Generate SwiftLint SARIF
if: ${{ !cancelled() }}
run: |
swiftlint lint --no-cache --quiet --config GenericApp/.swiftlint.yml --reporter sarif GenericApp/GenericApp GenericApp/NotificationService > swiftlint.sarif
- name: Upload SwiftLint SARIF
if: ${{ always() && !cancelled() && hashFiles('swiftlint.sarif') != '' }}
uses: github/codeql-action/upload-sarif@cdf488f595d80d6e07e03d4674febd5ab45fa938 # v4.37.9
with:
sarif_file: swiftlint.sarif
category: swiftlint
- name: Install App Store Connect API key
env:
APP_STORE_CONNECT_PRIVATE_KEY: ${{ secrets.APP_STORE_CONNECT_PRIVATE_KEY }}
run: |
mkdir -p ~/private_keys
echo -n "$APP_STORE_CONNECT_PRIVATE_KEY" > ~/private_keys/AuthKey_${{ secrets.APP_STORE_CONNECT_KEY_ID }}.p8
- name: Swift Package Manager cache
uses: actions/cache@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0
with:
path: .build
key: ${{ runner.os }}-spm-${{ hashFiles('**/Package.resolved') }}
restore-keys: |
${{ runner.os }}-spm-
- name: Build Archive
run: |
xcodebuild -project GenericApp/GenericApp.xcodeproj -scheme "GenericApp" \
-archivePath $RUNNER_TEMP/genericapp.xcarchive \
-sdk iphoneos \
-configuration Release \
-destination generic/platform=iOS \
-allowProvisioningUpdates \
-authenticationKeyPath ~/private_keys/AuthKey_${{ secrets.APP_STORE_CONNECT_KEY_ID }}.p8 \
-authenticationKeyID ${{ secrets.APP_STORE_CONNECT_KEY_ID }} \
-authenticationKeyIssuerID ${{ secrets.APP_STORE_CONNECT_ISSUER_ID }} \
clean archive
# - name: Export IPA
# env:
# EXPORT_OPTIONS_PLIST: ${{ secrets.APPLE_EXPORT_OPTIONS_PLIST }}
# run: |
# EXPORT_OPTS_PATH=$RUNNER_TEMP/ExportOptions.plist
# echo -n "$EXPORT_OPTIONS_PLIST" | base64 --decode -o $EXPORT_OPTS_PATH
# xcodebuild -exportArchive -archivePath $RUNNER_TEMP/genericapp.xcarchive -exportOptionsPlist $EXPORT_OPTS_PATH -exportPath $RUNNER_TEMP/build
# - name: Upload IPAs
# if: success()
# uses: actions/upload-artifact@4cec3d8aa04e39d1a68397de0c4cd6fb9dce8ec1 # v4
# with:
# name: ipas
# path: |
# **/*.ipa