From 37701fadf35891d3611fbd89515a5849a79a7439 Mon Sep 17 00:00:00 2001 From: Haksun Li <65719379+haksunlinm@users.noreply.github.com> Date: Sun, 18 Oct 2026 08:30:57 -0400 Subject: [PATCH] Use public NMDEV distribution and verify access without private-source credentials --- .github/workflows/nmdev-starter.yml | 11 +++++++++-- samples/new-nmdev-project/README.md | 6 +++--- samples/new-nmdev-project/pom.xml | 6 +++--- 3 files changed, 15 insertions(+), 8 deletions(-) diff --git a/.github/workflows/nmdev-starter.yml b/.github/workflows/nmdev-starter.yml index ca3a863..d965128 100644 --- a/.github/workflows/nmdev-starter.yml +++ b/.github/workflows/nmdev-starter.yml @@ -14,6 +14,13 @@ jobs: runs-on: ubuntu-latest timeout-minutes: 15 steps: + - name: Confirm this token cannot read private NMDEV source + env: + GH_TOKEN: ${{ github.token }} + run: | + status=$(curl --silent --output /dev/null --write-out '%{http_code}' -H "Authorization: Bearer $GH_TOKEN" https://api.github.com/repos/nmltd/nmdev/contents/pom.xml) + test "$status" = 404 + echo 'PASS: customer CI token cannot access private NMDEV source' - uses: actions/checkout@v4 with: persist-credentials: false @@ -27,11 +34,11 @@ jobs: with: distribution: temurin java-version: '8' - server-id: github-nmdev + server-id: github-nm-packages - name: Download stable NM Dev, build and run from a fresh cache working-directory: samples/new-nmdev-project env: - GITHUB_TOKEN: ${{ secrets.NM_REPOSITORIES_TOKEN || github.token }} + GITHUB_TOKEN: ${{ github.token }} run: mvn -B -ntp -U -Dmaven.repo.local="$RUNNER_TEMP/m2" clean verify exec:java - name: Run the packaged sample and graph example working-directory: samples/new-nmdev-project diff --git a/samples/new-nmdev-project/README.md b/samples/new-nmdev-project/README.md index 28fd85a..a7923d6 100644 --- a/samples/new-nmdev-project/README.md +++ b/samples/new-nmdev-project/README.md @@ -1,17 +1,17 @@ # New NMDEV project -This sample uses the published obfuscated combined `dev.nm:nmdev:1.2.6` JAR from GitHub Packages. Java 8 or later and Maven are required. +This sample uses the published obfuscated combined `dev.nm:nmdev-dist:1.2.6` JAR from GitHub Packages. Java 8 or later and Maven are required. ## Authentication -The binary package is hosted at https://maven.pkg.github.com/nmltd/nmdev. Your GitHub account and token must have access to the package; contact NM Dev for access. Create a personal access token (classic) with `read:packages` using [GitHub's instructions](https://docs.github.com/en/authentication/keeping-your-account-and-data-secure/managing-your-personal-access-tokens#creating-a-personal-access-token-classic). +The binary package is hosted at https://maven.pkg.github.com/nmltd/maven-packages. The binary package is public; no access to the private source repository is required. GitHub still requires authentication for Maven downloads. Create a personal access token (classic) with `read:packages` using [GitHub's instructions](https://docs.github.com/en/authentication/keeping-your-account-and-data-secure/managing-your-personal-access-tokens#creating-a-personal-access-token-classic). Add the following server to `~/.m2/settings.xml` (merge it into existing settings): ```xml - github-nmdev + github-nm-packages ${env.GITHUB_USERNAME} ${env.GITHUB_PACKAGES_TOKEN} diff --git a/samples/new-nmdev-project/pom.xml b/samples/new-nmdev-project/pom.xml index 4aafe52..74bd16d 100644 --- a/samples/new-nmdev-project/pom.xml +++ b/samples/new-nmdev-project/pom.xml @@ -16,9 +16,9 @@ - github-nmdev + github-nm-packages NMDEV GitHub Packages - https://maven.pkg.github.com/nmltd/nmdev + https://maven.pkg.github.com/nmltd/maven-packages true false @@ -26,7 +26,7 @@ dev.nm - nmdev + nmdev-dist ${nmdev.version}