diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index be734d1..eb56c72 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -1,27 +1,65 @@ name: Publish on: - pull_request_target: - types: - - closed + push: + branches: + - main permissions: contents: read concurrency: - group: publish-${{ github.event.pull_request.number }} + group: publish-${{ github.ref }} cancel-in-progress: false jobs: + detect: + name: Detect Publishable Release + runs-on: ubuntu-latest + outputs: + should_publish: ${{ steps.compare.outputs.should_publish }} + local_version: ${{ steps.compare.outputs.local_version }} + published_version: ${{ steps.compare.outputs.published_version }} + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Setup Node.js + uses: actions/setup-node@v6.1.0 + with: + node-version: 24 + + - name: Compare local and published versions + id: compare + shell: bash + run: | + local_version=$(node -p "require('./packages/mpp/package.json').version") + published_version=$(npm view @abstract-foundation/mpp version 2>/dev/null || true) + published_version=$(printf '%s\n' "$published_version" | tail -n 1 | tr -d '"') + + should_publish=false + if [ -z "$published_version" ] || [ "$published_version" != "$local_version" ]; then + should_publish=true + fi + + echo "local_version=$local_version" >> "$GITHUB_OUTPUT" + echo "published_version=$published_version" >> "$GITHUB_OUTPUT" + echo "should_publish=$should_publish" >> "$GITHUB_OUTPUT" + + - name: Report decision + run: | + echo "Local version: ${{ steps.compare.outputs.local_version }}" + echo "Published version: ${{ steps.compare.outputs.published_version }}" + echo "Should publish: ${{ steps.compare.outputs.should_publish }}" + verify: name: Verify Release Commit - if: github.event.pull_request.merged == true && github.event.pull_request.base.ref == 'main' && startsWith(github.event.pull_request.head.ref, 'changeset-release/') + needs: detect + if: needs.detect.outputs.should_publish == 'true' runs-on: ubuntu-latest steps: - - name: Checkout merged release commit + - name: Checkout uses: actions/checkout@v4 - with: - ref: ${{ github.event.pull_request.merge_commit_sha }} - name: Setup pnpm uses: pnpm/action-setup@v4.2.0 @@ -54,7 +92,10 @@ jobs: publish: name: Publish to npm - needs: verify + needs: + - detect + - verify + if: needs.detect.outputs.should_publish == 'true' runs-on: ubuntu-latest environment: name: npm @@ -63,10 +104,8 @@ jobs: contents: read id-token: write steps: - - name: Checkout merged release commit + - name: Checkout uses: actions/checkout@v4 - with: - ref: ${{ github.event.pull_request.merge_commit_sha }} - name: Setup pnpm uses: pnpm/action-setup@v4.2.0 diff --git a/README.md b/README.md index fdb97fc..951d456 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,9 @@ # mpp-abstract +> [!IMPORTANT] +> This repository is archived and no longer the active home for the Abstract MPP plugin or its demo. +> The packages and demo have moved to [`Abstract-Foundation/abstract-packages`](https://github.com/Abstract-Foundation/abstract-packages). For maintained source and ongoing updates, use that repository. + **Machine Payments Protocol (MPP) implementation for Abstract chain.** Custom `mppx` payment method plugin that settles on Abstract using standard @@ -304,11 +308,14 @@ await writeContract(client, { ## Quickstart +> The commands below are preserved for historical reference. The current source lives in +> [`Abstract-Foundation/abstract-packages`](https://github.com/Abstract-Foundation/abstract-packages) — clone that repository instead. + ```bash # 1. Clone and install -git clone https://github.com/spectra-the-bot/mpp-abstract -cd mpp-abstract -npm install +git clone https://github.com/Abstract-Foundation/abstract-packages +cd abstract-packages +pnpm install # 2. Build the plugin cd packages/mppx-abstract && npx tsc @@ -364,3 +371,11 @@ tsx src/agent.ts 3. EIP-712 domain name → `"Abstract Stream Channel"` All function signatures, events, errors, and business logic are identical. + +--- + +## Contributing + +This repository is archived and is not accepting new issues or pull requests. + +If you need to contribute to the actively maintained packages or demo, start in [`Abstract-Foundation/abstract-packages`](https://github.com/Abstract-Foundation/abstract-packages). diff --git a/RELEASING.md b/RELEASING.md index 320c55a..01c8f49 100644 --- a/RELEASING.md +++ b/RELEASING.md @@ -9,8 +9,11 @@ publishing. 2. Merge changesets into `main`. 3. The `Release PR` workflow opens or updates a `Version Packages` pull request. 4. Merge the `Version Packages` pull request. -5. The `Publish` workflow verifies the merged commit, waits for approval on the - protected `npm` environment, and then publishes to npm. +5. A push to `main` triggers the `Publish` workflow. +6. The workflow compares `packages/mpp/package.json` to the version currently on + npm and only continues when the local version is unpublished. +7. For unpublished versions, the workflow verifies the merged commit, waits for + approval on the protected `npm` environment, and then publishes to npm. ## GitHub setup diff --git a/packages/mpp/README.md b/packages/mpp/README.md index 0b21575..b35d04c 100644 --- a/packages/mpp/README.md +++ b/packages/mpp/README.md @@ -1,5 +1,7 @@ # @abstract-foundation/mpp +This package README is kept for historical reference. The actively maintained package source now lives in [`Abstract-Foundation/abstract-packages`](https://github.com/Abstract-Foundation/abstract-packages). + [MPP](https://github.com/anthropics/mppx) payment method plugin for the [Abstract](https://abs.xyz) blockchain. Enables paid API access via two settlement mechanisms: one-time ERC-3009 charges and ERC-20 payment channel sessions. ## Install @@ -109,3 +111,7 @@ Client-side signing supports both EOA and ERC-1271 smart wallets via `viem`'s ty ## License [MIT](./LICENSE) + +--- + +For maintained source and repository updates, refer to [`Abstract-Foundation/abstract-packages`](https://github.com/Abstract-Foundation/abstract-packages).