From 09b5276e3c2b2a6f917f4c73e4a507d01e3aec30 Mon Sep 17 00:00:00 2001 From: blckbx <74455114+blckbx@users.noreply.github.com> Date: Thu, 27 Aug 2026 10:18:42 +0200 Subject: [PATCH] ci: publish checksummed package artifacts --- .github/workflows/ci.yml | 34 ++++++++++++++++++++++++++++++++++ README.md | 7 +++++++ src/__tests__/metadata.test.ts | 17 +++++++++++++++++ 3 files changed, 58 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 0be8724..24edcea 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -19,3 +19,37 @@ jobs: cache: npm - run: npm ci - run: npm run ci + + package: + if: github.event_name == 'push' && github.ref == 'refs/heads/main' + needs: validate + runs-on: ubuntu-latest + timeout-minutes: 20 + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-node@v4 + with: + node-version: 22.22.3 + cache: npm + - run: npm install + - run: npm test + - run: npm run build + - run: npm run package:validate + - name: Pack artifact and write SHA-256 checksum + id: pack + shell: bash + run: | + package_file="$(npm pack --silent)" + sha256sum "${package_file}" > "${package_file}.sha256" + echo "package_file=${package_file}" >> "${GITHUB_OUTPUT}" + - name: Verify SHA-256 checksum + shell: bash + run: sha256sum --check "${{ steps.pack.outputs.package_file }}.sha256" + - name: Upload package and checksum + uses: actions/upload-artifact@v4 + with: + name: openclaw-armada-dm-${{ github.sha }} + path: | + ${{ steps.pack.outputs.package_file }} + ${{ steps.pack.outputs.package_file }}.sha256 + if-no-files-found: error diff --git a/README.md b/README.md index 7ffbea1..d70fad0 100644 --- a/README.md +++ b/README.md @@ -31,11 +31,18 @@ For a standard OpenClaw installation, pack and install the managed artifact: ```bash npm pack +sha256sum openclaw-armada-dm-0.1.0.tgz > openclaw-armada-dm-0.1.0.tgz.sha256 +sha256sum --check openclaw-armada-dm-0.1.0.tgz.sha256 openclaw plugins install npm-pack:/absolute/path/openclaw-armada-dm-0.1.0.tgz openclaw plugins enable armada-dm openclaw gateway restart ``` +After each change reaches `main` (including every merged pull request), CI repeats +the install, test, build, validation, and pack sequence. The workflow artifact +contains both the `.tgz` package and its `.sha256` file so a downloaded package +can be checked with `sha256sum --check .tgz.sha256`. + The published `setup-entry.js` uses only the OpenClaw `2026.6.1` public SDK compatibility baseline, while deployment requires patched OpenClaw `2026.7.2-beta.6` or newer. It does not run a wizard, prompt for values, edit configuration, read the secret file, publish events, or start relay connections. ## Migrating another Nostr channel diff --git a/src/__tests__/metadata.test.ts b/src/__tests__/metadata.test.ts index 3399f48..624f9ce 100644 --- a/src/__tests__/metadata.test.ts +++ b/src/__tests__/metadata.test.ts @@ -112,6 +112,23 @@ describe("package and manifest contracts", () => { expect(workflow).toContain("npm run ci"); }); + it("packs a checksummed artifact after changes reach main", async () => { + const workflow = await readFile( + new URL(".github/workflows/ci.yml", root), + "utf8", + ); + + expect(workflow).toContain("github.event_name == 'push'"); + expect(workflow).toContain("github.ref == 'refs/heads/main'"); + expect(workflow).toContain("npm install"); + expect(workflow).toContain("npm test"); + expect(workflow).toContain("npm run build"); + expect(workflow).toContain("npm run package:validate"); + expect(workflow).toContain("npm pack"); + expect(workflow).toContain("sha256sum"); + expect(workflow).toContain("actions/upload-artifact@v4"); + }); + it("fails CI when coverage falls below the repository baseline", async () => { const config = await readFile(new URL("vitest.config.mjs", root), "utf8");