diff --git a/.github/workflows/build-release-android.yml b/.github/workflows/build-release-android.yml new file mode 100644 index 000000000..f9874a0ae --- /dev/null +++ b/.github/workflows/build-release-android.yml @@ -0,0 +1,57 @@ +name: Build Android Release +on: + push: + branches: + - main + workflow_dispatch: + +jobs: + build-android-release: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4.2.2 + + - name: setup node + uses: actions/setup-node@v4.0.4 + with: + node-version: lts/* + + - name: install Rust stable + uses: dtolnay/rust-toolchain@stable + + - name: install dependencies (ubuntu only) + run: | + sudo apt-get update + sudo apt-get install -y libgtk-3-dev libwebkit2gtk-4.1-dev libappindicator3-dev librsvg2-dev patchelf + + - name: install frontend dependencies + run: npm install + + - name: Build Web Assets 🔨 + run: npm run build + + - name: Set up JDK + uses: actions/setup-java@v4.4.0 + with: + distribution: "temurin" + java-version: "21" + + - name: Set up Android SDK + uses: android-actions/setup-android@v3.2.1 + + - name: Sync Capacitor Assets 🔨 + run: npx cap sync && npx cap copy android && cd android && ./gradlew assembleDebug + + - name: Upload APK + uses: actions/upload-artifact@v4.4.0 + with: + name: build-android + path: android/app/build/outputs/apk/debug/app-debug.apk + retention-days: 5 + + - name: Github Release Android + uses: softprops/action-gh-release@v2 + if: startsWith(github.ref, 'refs/tags/') + with: + files: | + android/app/build/outputs/apk/debug/app-debug.apk diff --git a/.github/workflows/build-release-ios.yml b/.github/workflows/build-release-ios.yml new file mode 100644 index 000000000..73a080d88 --- /dev/null +++ b/.github/workflows/build-release-ios.yml @@ -0,0 +1,88 @@ +name: Build iOS + +on: + push: + branches: + - main + workflow_dispatch: + +jobs: + build: + runs-on: macos-13 + name: Build iOS app + steps: + - name: Checkout source + uses: actions/checkout@v4.2.2 + + - name: Set up keychain and import certificate + env: + APPLE_CERTIFICATE: ${{ secrets.MACOS_CERTIFICATE }} + APPLE_CERTIFICATE_PASSWORD: ${{ secrets.MACOS_CERTIFICATE_PWD }} + run: | + # Create a temporary keychain + security create-keychain -p "" build.keychain + security set-keychain-settings -lut 21600 build.keychain + + # Import the certificate + echo "$APPLE_CERTIFICATE" | base64 --decode > certificate.p12 + security import certificate.p12 -k build.keychain -P "$APPLE_CERTIFICATE_PASSWORD" -T /usr/bin/codesign + + # Set the keychain as default + security list-keychains -d user -s build.keychain + security unlock-keychain -p "" build.keychain + + # Give the codesign tool access to the keychain + security set-key-partition-list -S apple-tool:,apple: -k "" build.keychain + + - name: Set up XCode + uses: maxim-lobanov/setup-xcode@v1 + with: + xcode-version: 14.3.1 + + - name: setup node + uses: actions/setup-node@v4.0.4 + with: + node-version: lts/* + + - name: Install app dependencies + run: npm install + + - name: Build project app + run: npm run build + + - name: Capacitor update + run: npx cap update + + - name: Capacitor copy + run: npx cap copy + + - name: Build project + env: + APPLE_TEAM_ID: ${{ secrets.MACOS_NOTARIZATION_TEAM_ID }} + APPLE_SIGNING_IDENTITY: ${{ secrets.MACOS_CERTIFICATE_NAME }} + run: xcodebuild -workspace './ios/App/App.xcworkspace' -scheme App -destination generic/platform=iOS -archivePath App.xcarchive archive DEVELOPMENT_TEAM="$APPLE_TEAM_ID" CODE_SIGN_IDENTITY="$APPLE_SIGNING_IDENTITY" + + - name: 🍻 Assemble IPA + run: xcodebuild archive -archivePath App.xcarchive -exportArchive -exportOptionsPlist ./archive.plist -exportPath output -allowProvisioningUpdates + + - name: Notarize App with Apple + env: + APPLE_ID: ${{ secrets.MACOS_NOTARIZATION_APPLE_ID }} + APPLE_PASSWORD: ${{ secrets.MACOS_NOTARIZATION_PWD }} + APPLE_TEAM_ID: ${{ secrets.MACOS_NOTARIZATION_TEAM_ID }} + run: | + xcrun altool --notarize-app -f build/YourApp.ipa \ + --primary-bundle-id "com.yourapp.bundle" \ + -u "$APPLE_ID" \ + -p "$APPLE_PASSWORD" + + - name: Upload release bundle + uses: actions/upload-artifact@v3 + with: + name: app-ios + path: output/ + retention-days: 60 + + - name: Remove temporary keychain + run: | + security delete-keychain build.keychain