Merge remote-tracking branch 'origin/fix/playlist_sync' into preview #1170
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: Build | |
| on: | |
| push: | |
| paths: | |
| - composeApp/** | |
| - gradle/** | |
| - iosApp/** | |
| - build.gradle.kts | |
| - settings.gradle.kts | |
| - .github/workflows/build.yml | |
| - "!**/strings.xml" | |
| tags: | |
| - 'v*' | |
| branches: | |
| - '*' | |
| pull_request: | |
| paths: | |
| - composeApp/** | |
| - gradle/** | |
| - iosApp/** | |
| - build.gradle.kts | |
| - settings.gradle.kts | |
| - .github/workflows/build.yml | |
| - "!**/strings.xml" | |
| workflow_dispatch: | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.ref }} | |
| cancel-in-progress: true | |
| jobs: | |
| build-android: | |
| name: Android | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v6 | |
| - name: Setup JDK | |
| uses: actions/setup-java@v5 | |
| with: | |
| distribution: temurin | |
| java-version: 21 | |
| cache: gradle | |
| - name: Setup Gradle | |
| uses: gradle/actions/setup-gradle@v5 | |
| - name: Build with Gradle (release) | |
| id: build_release | |
| if: github.event_name == 'push' && env.SIGNING_KEY_ALIAS | |
| env: | |
| SIGNING_KEY_ALIAS: ${{ secrets.KEY_ALIAS }} | |
| SIGNING_KEY_PASSWORD: ${{ secrets.KEY_PASSWORD }} | |
| SIGNING_STORE_PASSWORD: ${{ secrets.KEYSTORE_PASSWORD }} | |
| SIGNING_STORE_FILE: ${{ github.workspace }}/release.keystore | |
| RELEASE: true | |
| run: | | |
| echo "${{ secrets.KEYSTORE }}" | base64 -d > release.keystore | |
| ./gradlew :androidApp:packageRelease --stacktrace | |
| rm release.keystore | |
| - name: Build with Gradle (debug) | |
| id: build_debug | |
| if: github.event_name == 'pull_request' | |
| run: | | |
| ./gradlew :androidApp:assembleDebug --stacktrace | |
| - name: Upload APK artifact | |
| uses: actions/upload-artifact@v6 | |
| with: | |
| name: navic-release-android | |
| path: androidApp/build/outputs/apk/**/*.apk | |
| compression-level: 0 | |
| if-no-files-found: ignore | |
| build-ios: | |
| name: iOS | |
| runs-on: macos-26 | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v6 | |
| - name: Setup JDK | |
| uses: actions/setup-java@v5 | |
| with: | |
| distribution: temurin | |
| java-version: 21 | |
| cache: gradle | |
| - name: Setup Gradle | |
| uses: gradle/actions/setup-gradle@v5 | |
| - name: Cache konan | |
| uses: actions/cache@v4 | |
| with: | |
| path: ~/.konan | |
| key: ${{ runner.os }}-konan-${{ hashFiles('**/*.gradle.kts', '**/libs.versions.toml') }} | |
| restore-keys: | | |
| ${{ runner.os }}-konan- | |
| - name: Run Gradle tasks | |
| run: ./gradlew :composeApp:generateValkyrieImageVector | |
| - name: Build IPA | |
| run: | | |
| xcodebuild archive \ | |
| -project iosApp/iosApp.xcodeproj \ | |
| -scheme iosApp \ | |
| -configuration Release \ | |
| -sdk iphoneos \ | |
| -archivePath "iosApp.xcarchive" \ | |
| CODE_SIGN_ENTITLEMENTS="iosApp/entitlements.xml" \ | |
| CODE_SIGN_IDENTITY="-" \ | |
| CODE_SIGN_STYLE=Manual \ | |
| AD_HOC_CODE_SIGNING_ALLOWED=YES | |
| mkdir -p Payload | |
| APP_PATH=$(find "iosApp.xcarchive/Products/Applications" -name "*.app" | head -n 1) | |
| cp -r "$APP_PATH" Payload/ | |
| zip -r "Navic.ipa" Payload | |
| - name: Upload IPA Artifact | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: navic-release-ios | |
| path: Navic.ipa | |
| compression-level: 0 | |
| if-no-files-found: ignore | |
| upload-artifacts-to-discord: | |
| name: Upload Artifacts to Discord | |
| if: github.event_name == 'push' && github.ref == 'refs/heads/master' | |
| needs: [ build-android, build-ios ] | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Download Artifacts | |
| uses: actions/download-artifact@v7 | |
| - name: Post artifacts to Discord webhook | |
| shell: bash | |
| if: env.CI_BUILD_WEBHOOK | |
| env: | |
| CI_BUILD_WEBHOOK: ${{ secrets.CI_BUILD_WEBHOOK }} | |
| run: | | |
| shopt -s nullglob globstar | |
| files=() | |
| i=1 | |
| for file in **/*.apk; do # TODO: Add ipa - too big for Discord 10mb limit (need boooosts) | |
| files+=("-F file${i}=@${file}") | |
| ((i++)) | |
| done | |
| if (( ${#files[@]} == 0 )); then | |
| echo "No files to upload" | |
| exit 0 | |
| fi | |
| run_url="${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}" | |
| payload=$(jq -n --arg content "Builds for [${GITHUB_SHA::7}](<$run_url>)" '{$content}') | |
| curl -XPOST "$CI_BUILD_WEBHOOK" -F "payload_json=$payload" "${files[@]}" | |
| create-release: | |
| name: Create GitHub Release | |
| if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v') | |
| needs: [ build-android, build-ios ] | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: write | |
| id-token: write | |
| steps: | |
| - name: Download Artifacts | |
| uses: actions/download-artifact@v7 | |
| - name: Create Release | |
| shell: bash | |
| env: | |
| GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| run: | | |
| shopt -s nullglob globstar | |
| gh release create "$GITHUB_REF_NAME" **/*.{apk,ipa} \ | |
| --repo "$GITHUB_REPOSITORY" \ | |
| --title "$GITHUB_REF_NAME" \ | |
| --draft --generate-notes |