-
Notifications
You must be signed in to change notification settings - Fork 0
122 lines (98 loc) · 4.47 KB
/
Build-Genius.yml
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
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
name: Build Genius
on:
push:
paths:
- .github/workflows/Build-Genius.yml
- .swift-version
- .swiftformat
- .swiftlint.yml
- Genius/**
- Genius.xcodeproj/**
pull_request:
paths:
- .github/workflows/Build-Genius.yml
- .swift-version
- .swiftformat
- .swiftlint.yml
- Genius/**
- Genius.xcodeproj/**
workflow_dispatch:
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
env:
GH_TOKEN: ${{ github.token }}
NSUnbufferedIO: YES
jobs:
Build-Genius:
name: Build Genius
runs-on: macos-15
permissions:
id-token: write
attestations: write
steps:
- name: Prepare
run: |
set -o pipefail
defaults write com.apple.dt.Xcode IDESkipPackagePluginFingerprintValidatation -boolean true
- name: Checkout
uses: actions/checkout@main
- name: Install SwiftFormat
run: |
curl --remote-name --location https://github.com/nicklockwood/SwiftFormat/releases/latest/download/swiftformat.zip
unzip swiftformat.zip
echo "SwiftFormat $(./swiftformat --version) installed"
- name: Run SwiftFormat
run: ./swiftformat --lint . --reporter github-actions-log
- name: Install SwiftLint
run: |
curl --remote-name --location https://github.com/realm/SwiftLint/releases/latest/download/portable_swiftlint.zip
unzip portable_swiftlint.zip
echo "SwiftLint $(./swiftlint version) installed"
- name: Run SwiftLint Lint Rules
run: ./swiftlint lint --strict --reporter github-actions-logging
- name: Select Xcode Version
run: |
sudo xcode-select --switch /Applications/$(
ls /Applications | grep "Xcode_\d*\.\d*\.app" | tail --lines=1
)
echo "$(xcodebuild -version | tr "\n" " ")selected"
- name: Install xcbeautify
run: |
latest_xcbeautify_tag=$(gh release --repo cpisciotta/xcbeautify list --json tagName --limit 1 | cut -d "\"" -f 4)
curl --location https://github.com/cpisciotta/xcbeautify/releases/download/"$latest_xcbeautify_tag"/xcbeautify-"$latest_xcbeautify_tag"-arm64-apple-macosx.zip --output xcbeautify.zip
unzip xcbeautify.zip
echo "xcbeautify $(./xcbeautify --version) installed"
- name: Build Genius
run: xcodebuild archive -scheme Genius -destination generic/platform=macOS -archivePath Genius | tee xcodebuild.log | ./xcbeautify --disable-logging --renderer github-actions
- name: Run SwiftLint Analyzer Rules
run: ./swiftlint analyze --strict --reporter github-actions-logging --compiler-log-path xcodebuild.log Genius
- name: Install Periphery
run: |
latest_periphery_tag=$(gh release --repo peripheryapp/periphery list --json tagName --limit 1 | cut -d "\"" -f 4)
curl --location https://github.com/peripheryapp/periphery/releases/download/"$latest_periphery_tag"/periphery-"$latest_periphery_tag".zip --output periphery.zip
unzip periphery.zip
echo "Periphery $(./periphery version) installed"
- name: Run Periphery
run: ./periphery scan --format github-actions --relative-results --strict
- name: Zip Genius
run: |
mv Genius.xcarchive/Products/Applications/Genius.app .
zip --recurse-paths Genius.zip Genius.app
- name: Attest Build Provenance
uses: actions/attest-build-provenance@main
with: { subject-path: Genius.zip }
- name: Upload Genius
uses: actions/upload-artifact@main
with:
name: Genius
path: Genius.zip
- name: Zip Debug Symbols
run: |
mv Genius.xcarchive/dSYMs/Genius.app.dSYM .
zip --recurse-paths DebugSymbols.zip Genius.app.dSYM
- name: Upload Debug Symbols
uses: actions/upload-artifact@main
with:
name: Debug Symbols
path: DebugSymbols.zip