From 2075c7259574970eaea88aa4d4bd1d68f3509ccb Mon Sep 17 00:00:00 2001 From: Masashi Katsumata Date: Thu, 22 Oct 2026 19:28:52 -0700 Subject: [PATCH 1/2] Submit the React Native example's Gradle dependencies after npm install --- .github/workflows/dependency-submission.yml | 65 +++++++++++++++++++++ 1 file changed, 65 insertions(+) create mode 100644 .github/workflows/dependency-submission.yml diff --git a/.github/workflows/dependency-submission.yml b/.github/workflows/dependency-submission.yml new file mode 100644 index 0000000..bae8fae --- /dev/null +++ b/.github/workflows/dependency-submission.yml @@ -0,0 +1,65 @@ +name: Dependency Submission (Gradle) + +# examples/reactnative-basic/android の Gradle 依存を依存関係グラフへ送る。 +# +# GitHub の「Automatic dependency submission」は依存を何も入れずに Gradle を動かすため、 +# このプロジェクトでは必ず落ちる。settings.gradle が `node` で node_modules の中から +# @react-native/gradle-plugin を探すので、npm install より前には評価すらできない。 +# ここでは npm install を済ませてから同じ送信を行う。 +# +# このワークフローを入れたら、リポジトリ設定の Code security → Dependency graph → +# Automatic dependency submission は Disabled にすること(二重に走り、自動の方は落ち続ける)。 +# +# pull_request では送信せず、依存グラフを作れるか(= 依存を解決できるか)だけを確かめる。 + +on: + push: + branches: + - develop + - main + pull_request: + paths: + - .github/workflows/dependency-submission.yml + - examples/reactnative-basic/android/** + workflow_dispatch: + +permissions: + contents: write + +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + +jobs: + submit-gradle: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v7 + with: + submodules: recursive + + - name: Setup Node + uses: actions/setup-node@v6 + with: + node-version: 22 + + # @mapconductor/* はまだ npm に無い。deploy-basic-example.yml と同じく、内部の依存指定を + # "*" に揃えてローカルの workspace をリンクさせる(揃えないと registry を見に行って 404)。 + - name: Link local workspace packages + run: node scripts/link-local-workspaces.mjs + + - name: Install dependencies + run: npm install --no-audit --no-fund + + - name: Setup Java + uses: actions/setup-java@v5 + with: + distribution: temurin + java-version: 17 + + - name: Generate and submit dependency graph + uses: gradle/actions/dependency-submission@v6 + with: + build-root-directory: examples/reactnative-basic/android + dependency-graph: ${{ github.event_name == 'pull_request' && 'generate-and-upload' || 'generate-and-submit' }} From 5922f2f7c085f87d168d4a5c8805fa806de23f76 Mon Sep 17 00:00:00 2001 From: Masashi Katsumata Date: Thu, 22 Oct 2026 19:32:02 -0700 Subject: [PATCH 2/2] Give the React Native example a local.properties before resolving it --- .github/workflows/dependency-submission.yml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.github/workflows/dependency-submission.yml b/.github/workflows/dependency-submission.yml index bae8fae..0a0fd4c 100644 --- a/.github/workflows/dependency-submission.yml +++ b/.github/workflows/dependency-submission.yml @@ -58,6 +58,11 @@ jobs: distribution: temurin java-version: 17 + # app/build.gradle は local.properties を存在確認なしで読む(ArcGIS のキー用)。キーはどれも + # 空が既定で、依存の解決には要らないので、ランナーの Android SDK を指すだけのものを置く。 + - name: Create local.properties + run: echo "sdk.dir=$ANDROID_HOME" > examples/reactnative-basic/android/local.properties + - name: Generate and submit dependency graph uses: gradle/actions/dependency-submission@v6 with: