chore: macOS install button links to INSTALL.md, add release page link #61
This file contains hidden or 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: CI | |
| on: | |
| push: | |
| branches: [main] | |
| pull_request: | |
| branches: [main] | |
| env: | |
| SCHEME: "Codeagogo" | |
| DESTINATION: "platform=macOS" | |
| jobs: | |
| lint: | |
| name: SwiftLint | |
| runs-on: macos-14 | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Install SwiftLint | |
| run: brew install swiftlint | |
| - name: Run SwiftLint | |
| run: swiftlint lint --reporter github-actions-logging | |
| audit: | |
| name: Dependency Audit | |
| runs-on: macos-14 | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Audit Dependencies | |
| run: ./scripts/audit-dependencies.sh | |
| secrets: | |
| name: Secrets Scan | |
| runs-on: macos-14 | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 | |
| - name: Install gitleaks | |
| run: brew install gitleaks | |
| - name: Run gitleaks | |
| run: gitleaks detect --source . --config .gitleaks.toml --verbose | |
| license-headers: | |
| name: License Headers | |
| runs-on: macos-14 | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Check license headers | |
| run: ./scripts/license-header.sh --check | |
| build-and-test: | |
| name: Build and Test | |
| runs-on: macos-14 | |
| needs: [lint, audit, secrets, license-headers] | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Select Xcode | |
| run: sudo xcode-select -s /Applications/Xcode_16.2.app/Contents/Developer | |
| - name: Show Xcode version | |
| run: xcodebuild -version | |
| - name: Build | |
| run: | | |
| xcodebuild build \ | |
| -scheme "$SCHEME" \ | |
| -destination "$DESTINATION" \ | |
| -configuration Release \ | |
| CODE_SIGN_IDENTITY="-" \ | |
| CODE_SIGNING_REQUIRED=NO \ | |
| ENABLE_HARDENED_RUNTIME=NO \ | |
| ENABLE_APP_SANDBOX=NO \ | |
| | xcpretty | |
| - name: Unit Tests | |
| run: | | |
| xcodebuild test \ | |
| -scheme "$SCHEME" \ | |
| -destination "$DESTINATION" \ | |
| -only-testing:"CodeagogoTests" \ | |
| -configuration Debug \ | |
| CODE_SIGN_IDENTITY="-" \ | |
| CODE_SIGNING_REQUIRED=NO \ | |
| ENABLE_HARDENED_RUNTIME=NO \ | |
| ENABLE_APP_SANDBOX=NO \ | |
| | xcpretty | |
| - name: UI Tests | |
| run: | | |
| xcodebuild test \ | |
| -scheme "$SCHEME" \ | |
| -destination "$DESTINATION" \ | |
| -only-testing:"CodeagogoUITests" \ | |
| -configuration Debug \ | |
| CODE_SIGN_IDENTITY="-" \ | |
| CODE_SIGNING_REQUIRED=YES \ | |
| ENABLE_HARDENED_RUNTIME=NO \ | |
| ENABLE_APP_SANDBOX=NO \ | |
| | xcpretty | |
| build-artifact: | |
| name: Build Release Artifact | |
| runs-on: macos-14 | |
| needs: build-and-test | |
| if: github.event_name == 'push' && github.ref == 'refs/heads/main' | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Select Xcode | |
| run: sudo xcode-select -s /Applications/Xcode_16.2.app/Contents/Developer | |
| - name: Install Apple Certificate | |
| env: | |
| APPLE_CERTIFICATE_BASE64: ${{ secrets.APPLE_CERTIFICATE_BASE64 }} | |
| APPLE_CERTIFICATE_PASSWORD: ${{ secrets.APPLE_CERTIFICATE_PASSWORD }} | |
| run: | | |
| # Create temporary keychain | |
| KEYCHAIN_PATH=$RUNNER_TEMP/app-signing.keychain-db | |
| KEYCHAIN_PASSWORD=$(openssl rand -base64 32) | |
| security create-keychain -p "$KEYCHAIN_PASSWORD" "$KEYCHAIN_PATH" | |
| security set-keychain-settings -lut 21600 "$KEYCHAIN_PATH" | |
| security unlock-keychain -p "$KEYCHAIN_PASSWORD" "$KEYCHAIN_PATH" | |
| # Import certificate | |
| CERTIFICATE_PATH=$RUNNER_TEMP/certificate.p12 | |
| echo -n "$APPLE_CERTIFICATE_BASE64" | base64 --decode -o "$CERTIFICATE_PATH" | |
| security import "$CERTIFICATE_PATH" \ | |
| -P "$APPLE_CERTIFICATE_PASSWORD" \ | |
| -A \ | |
| -t cert \ | |
| -f pkcs12 \ | |
| -k "$KEYCHAIN_PATH" | |
| security set-key-partition-list -S apple-tool:,apple: -k "$KEYCHAIN_PASSWORD" "$KEYCHAIN_PATH" | |
| security list-keychain -d user -s "$KEYCHAIN_PATH" | |
| - name: Build Release | |
| env: | |
| APPLE_TEAM_ID: ${{ secrets.APPLE_TEAM_ID }} | |
| run: | | |
| xcodebuild build \ | |
| -scheme "$SCHEME" \ | |
| -destination "$DESTINATION" \ | |
| -configuration Release \ | |
| -derivedDataPath build \ | |
| CODE_SIGN_STYLE=Manual \ | |
| CODE_SIGN_IDENTITY="Apple Development" \ | |
| DEVELOPMENT_TEAM="$APPLE_TEAM_ID" \ | |
| CODE_SIGNING_REQUIRED=YES \ | |
| ENABLE_HARDENED_RUNTIME=YES \ | |
| ENABLE_APP_SANDBOX=NO | |
| - name: Create Artifact | |
| run: | | |
| mkdir -p artifact | |
| cp -R "build/Build/Products/Release/Codeagogo.app" artifact/ | |
| cd artifact | |
| zip -r "Codeagogo-macOS.zip" "Codeagogo.app" | |
| - name: Upload Artifact | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: Codeagogo-macOS | |
| path: artifact/Codeagogo-macOS.zip | |
| retention-days: 30 | |
| - name: Cleanup Keychain | |
| if: always() | |
| run: | | |
| KEYCHAIN_PATH=$RUNNER_TEMP/app-signing.keychain-db | |
| if [ -f "$KEYCHAIN_PATH" ]; then | |
| security delete-keychain "$KEYCHAIN_PATH" | |
| fi |