From 5a98f754981f7ba5936aedbfdb7d73d17042e849 Mon Sep 17 00:00:00 2001 From: Masashi Katsumata Date: Sun, 16 Aug 2026 23:03:41 +0900 Subject: [PATCH] Verify the standalone build on every pull request MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Every module is built two ways: inside the android-sdk aggregate build, and on its own. Development happens in the aggregate build, so the standalone side rots silently — it is only exercised when the publish workflow runs, which is to say on release day. Add a `build.yml` that assembles the module on its own for every pull request, so this drift surfaces when the change is made instead of at release time. Where needed this commit also repairs the standalone build itself (missing wrapper/settings, missing version-catalog entries, dependency versions that had drifted from the aggregate build). --- .github/workflows/build.yml | 80 +++++++++++++++++++++++++++++++++++++ 1 file changed, 80 insertions(+) create mode 100644 .github/workflows/build.yml diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml new file mode 100644 index 0000000..1c511f7 --- /dev/null +++ b/.github/workflows/build.yml @@ -0,0 +1,80 @@ +name: Build + +# 単体ビルドの検証。 +# +# ## なぜ要るのか +# +# このモジュールは android-sdk の集約ビルドと、自分だけの単体ビルドの +# 2 通りで組まれる。開発は集約ビルドで行うため、**単体ビルド側の設定が +# 静かに腐る。** 実際 1.3.0 のリリースでは、publish ワークフローを回して +# 初めて次のような不備がまとめて露見した: +# +# - gradlew / settings.gradle.kts が無くて ./gradlew が叩けない +# - version catalog に依存の定義が無い(集約側の catalog にはある) +# - coroutines が推移的に古い版になり 3 引数 resume が通らない +# - ベンダ SDK の版が集約ビルドと食い違う +# +# publish のときにしか単体ビルドしないと、リリース当日に気づくことになる。 +# ここで PR ごとに回して、変更した時点で分かるようにする。 + +on: + pull_request: + +permissions: + contents: read + +jobs: + build: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Set up Java + uses: actions/setup-java@v4 + with: + distribution: temurin + java-version: '17' + cache: 'gradle' + + - name: Fetch HERE SDK mock artifact + env: + GPR_USER: ${{ github.actor }} + GPR_TOKEN: ${{ secrets.GITHUB_TOKEN }} + run: | + mkdir -p libs + target_path="libs/heresdk-explore-mock-4.23.2.0.210004.jar" + curl --fail --show-error --silent --location \ + -u "$GPR_USER:$GPR_TOKEN" \ + -o "$target_path" \ + "https://raw.githubusercontent.com/MapConductor/here-sdk-mocks/main/heresdk-explore-mock-4.23.2.0.210004.jar" + if [ ! -s "$target_path" ]; then + echo "Failed to download HERE SDK mock artifact" + exit 1 + fi + + - name: Build core and compose locally + run: | + git clone --depth 1 https://github.com/MapConductor/android-sdk-core.git _core + cd _core + ./gradlew --no-daemon publishToMavenLocal + cd .. + + mkdir -p "$HOME/.gradle/init.d" + cat > "$HOME/.gradle/init.d/use-local-maven.init.gradle" << 'EOF' + gradle.settingsEvaluated { settings -> + settings.dependencyResolutionManagement.repositories { + mavenLocal() + } + } + EOF + + git clone --depth 1 https://github.com/MapConductor/android-sdk-compose.git _compose + cd _compose + ./gradlew --no-daemon publishToMavenLocal + cd .. + + # apiCheck は集約ビルド(android-sdk)の gradle/api-surface.gradle.kts が + # 提供するタスクで、単体ビルドには存在しない。ここでは組み立てだけを見る。 + - name: Assemble + run: ./gradlew --no-daemon -PskipSampleApp=true assembleRelease