Skip to content
This repository was archived by the owner on Apr 19, 2026. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
63 changes: 51 additions & 12 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -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
Comment on lines +37 to +41
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Check published version set, not only latest

The detect step compares local_version against npm view ... version, which only yields a single version string, so any already-published non-latest version is treated as "unpublished" and triggers should_publish=true. If main is reverted/cherry-picked to an older version that already exists on npm, this workflow will run verify/publish and then fail at publish with a duplicate-version error instead of correctly skipping.

Useful? React with 👍 / 👎.

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
Expand Down Expand Up @@ -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
Expand All @@ -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
Expand Down
21 changes: 18 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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).
7 changes: 5 additions & 2 deletions RELEASING.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
6 changes: 6 additions & 0 deletions packages/mpp/README.md
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -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).
Loading