feat: add multi-code-system support, hotkey recorder, and select-afte… #24
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: "SNOMED Lookup" | |
| DESTINATION: "platform=macOS" | |
| jobs: | |
| build-and-test: | |
| name: Build and Test | |
| runs-on: macos-14 | |
| 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:"SNOMED LookupTests" \ | |
| -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:"SNOMED LookupUITests" \ | |
| -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=YES | |
| - name: Create Artifact | |
| run: | | |
| mkdir -p artifact | |
| cp -R "build/Build/Products/Release/SNOMED Lookup.app" artifact/ | |
| cd artifact | |
| zip -r "SNOMED-Lookup-macOS.zip" "SNOMED Lookup.app" | |
| - name: Upload Artifact | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: SNOMED-Lookup-macOS | |
| path: artifact/SNOMED-Lookup-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 |