fix: update Node.js version to 20.19.0 in all workflows to resolve co… #6
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: Release | ||
| on: | ||
| push: | ||
| tags: | ||
| - 'v*' | ||
| jobs: | ||
| build-android: | ||
| runs-on: ubuntu-latest | ||
| needs: create-release | ||
| steps: | ||
| - name: Checkout code | ||
| uses: actions/checkout@v4 | ||
| - name: Setup Node.js | ||
| uses: actions/setup-node@v4 | ||
| with: | ||
| node-version: '20.19.0' | ||
| cache: 'npm' | ||
| - name: Setup Java | ||
| uses: actions/setup-java@v4 | ||
| with: | ||
| java-version: '17' | ||
| distribution: 'temurin' | ||
| - name: Install dependencies | ||
| run: npm ci | ||
| - name: Build Android Release APK | ||
| run: | | ||
| cd android | ||
| ./gradlew assembleRelease | ||
| cp app/build/outputs/apk/release/app-release.apk ../CardScanner-${{ github.ref_name }}-android.apk | ||
| - name: Upload Android Release | ||
| uses: actions/upload-release-asset@v1 | ||
| env: | ||
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
| with: | ||
| upload_url: ${{ needs.create-release.outputs.upload_url }} | ||
| asset_path: CardScanner-${{ github.ref_name }}-android.apk | ||
| asset_name: CardScanner-${{ github.ref_name }}-android.apk | ||
| asset_content_type: application/vnd.android.package-archive | ||
| build-ios: | ||
| runs-on: macos-latest | ||
| needs: create-release | ||
| steps: | ||
| - name: Checkout code | ||
| uses: actions/checkout@v4 | ||
| - name: Setup Node.js | ||
| uses: actions/setup-node@v4 | ||
| with: | ||
| node-version: '20.19.0' | ||
| cache: 'npm' | ||
| - name: Install dependencies | ||
| run: npm ci | ||
| - name: Install iOS pods | ||
| run: | | ||
| cd ios | ||
| pod install | ||
| cd .. | ||
| - name: Build iOS Release | ||
| run: | | ||
| xcodebuild -workspace ios/CardScannerApp.xcworkspace \ | ||
| -scheme CardScannerApp \ | ||
| -configuration Release \ | ||
| -sdk iphoneos \ | ||
| -archivePath CardScannerApp.xcarchive \ | ||
| archive | ||
| xcodebuild -exportArchive \ | ||
| -archivePath CardScannerApp.xcarchive \ | ||
| -exportOptionsPlist ios/ExportOptions.plist \ | ||
| -exportPath build | ||
| cp build/CardScannerApp.ipa CardScanner-${{ github.ref_name }}-ios.ipa | ||
| - name: Upload iOS Release | ||
| uses: actions/upload-release-asset@v1 | ||
| env: | ||
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
| with: | ||
| upload_url: ${{ needs.create-release.outputs.upload_url }} | ||
| asset_path: CardScanner-${{ github.ref_name }}-ios.ipa | ||
| asset_name: CardScanner-${{ github.ref_name }}-ios.ipa | ||
| asset_content_type: application/octet-stream | ||