Merge branch 'deployment-target-macos-12' into deployment-target-maco… #642
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |