Skip to content

arguments: improve vyper quality #291

arguments: improve vyper quality

arguments: improve vyper quality #291

Workflow file for this run

name: build
on:
push:
pull_request:
workflow_dispatch:
inputs:
version:
description: 'Version to release (e.g., 0.9.0)'
required: true
type: string
env:
MATURIN_VERSION: 1.13.3
MCP_PUBLISHER_VERSION: 1.7.9
jobs:
prepare-release:
runs-on: ubuntu-latest
if: github.event_name == 'workflow_dispatch'
permissions:
contents: write
steps:
- uses: actions/checkout@v6
with:
fetch-depth: 0
- name: Validate version format
run: |
if ! echo "${{ inputs.version }}" | grep -qE '^[0-9]+\.[0-9]+\.[0-9]+$'; then
echo "Error: Invalid version format. Expected semver like 0.9.0"
exit 1
fi
- name: Check tags do not exist
run: |
if git rev-parse "${{ inputs.version }}" >/dev/null 2>&1; then
echo "Error: Tag ${{ inputs.version }} already exists"
exit 1
fi
if git rev-parse "go/v${{ inputs.version }}" >/dev/null 2>&1; then
echo "Error: Tag go/v${{ inputs.version }} already exists"
exit 1
fi
- name: Install Rust
uses: dtolnay/rust-toolchain@stable
with:
targets: wasm32-unknown-unknown
- name: Install Node
uses: actions/setup-node@v6
with:
node-version: 24
- name: Update version in Cargo.toml
run: sed -i 's/^version = ".*"/version = "${{ inputs.version }}"/' Cargo.toml
- name: Update version in javascript/package.json
run: |
sed -i 's/"version": ".*"/"version": "${{ inputs.version }}"/' javascript/package.json
node agent/scripts/sync-version.mjs
- name: Build & Compress WASM
run: make -C go/ wasm
- name: Configure Git
run: |
git config user.name "github-actions[bot]"
git config user.email "github-actions[bot]@users.noreply.github.com"
- name: Commit and Tag Release
run: |
git add Cargo.toml Cargo.lock javascript/package.json javascript/package-lock.json agent
git commit -m "release ${{ inputs.version }}"
release_commit="$(git rev-parse HEAD)"
git tag "${{ inputs.version }}"
git push origin "$release_commit:${{ github.ref_name }}"
git push origin "${{ inputs.version }}"
git checkout --detach "$release_commit"
- name: Tag Go Release
run: |
git add -f go/wasm/evmole.wasm.gz
git commit -m "go release ${{ inputs.version }}"
git tag "go/v${{ inputs.version }}"
git push origin "go/v${{ inputs.version }}"
rust-test:
runs-on: ubuntu-latest
needs: [prepare-release]
if: always() && (needs.prepare-release.result == 'success' || needs.prepare-release.result == 'skipped')
steps:
- uses: actions/checkout@v6
with:
ref: ${{ github.event_name == 'workflow_dispatch' && inputs.version || '' }}
- name: Install Rust
uses: dtolnay/rust-toolchain@stable
- name: Test and Clippy
run: |
cargo fmt --check
cargo test
cargo clippy --all-features -- -D warnings
go-test:
runs-on: ubuntu-latest
needs: rust-test
if: always() && needs.rust-test.result == 'success'
strategy:
matrix:
go-version: ['1.25', 'stable']
steps:
- uses: actions/checkout@v6
with:
ref: ${{ github.event_name == 'workflow_dispatch' && format('go/v{0}', inputs.version) || '' }}
- name: Install Rust
uses: dtolnay/rust-toolchain@stable
with:
targets: wasm32-unknown-unknown
- name: Install Go
uses: actions/setup-go@v6
with:
go-version: ${{ matrix.go-version }}
- name: Build WASM
working-directory: go
run: make wasm
- name: Run tests
working-directory: go
run: make test
javascript:
runs-on: ubuntu-latest
needs: rust-test
if: always() && needs.rust-test.result == 'success'
steps:
- uses: actions/checkout@v6
with:
ref: ${{ github.event_name == 'workflow_dispatch' && inputs.version || '' }}
- name: Install Node
uses: actions/setup-node@v6
with:
node-version: 24
registry-url: 'https://registry.npmjs.org/'
- name: Install Rust
uses: dtolnay/rust-toolchain@stable
- name: Build, test, and package JavaScript integrations
run: |
cp README.md javascript/
npm --prefix javascript ci
npm --prefix javascript run build
(cd javascript && npx tsc ./dist/evmole.d.ts)
npm --prefix javascript/tests ci
(cd javascript/tests && npx playwright install --with-deps)
npm --prefix javascript test
make -C javascript test
npm --prefix agent/mcp install --ignore-scripts --package-lock=false --no-save --no-audit --no-fund "${{ github.workspace }}/javascript"
npm --prefix agent/mcp test
node agent/scripts/sync-version.mjs --check
node agent/tests/evaluate-routing.mjs
node agent/tests/validate-packaging.mjs
npx -y skills@latest add . --list
(cd agent/mcp && npm pack)
- name: Upload JavaScript artifacts
uses: actions/upload-artifact@v6
with:
name: javascript
path: |
javascript/evmole-*.tgz
agent/mcp/evmole-mcp-*.tgz
python-wheel:
needs: rust-test
if: always() && needs.rust-test.result == 'success'
strategy:
matrix:
python-version: [ '3.10', '3.11', '3.12', '3.13', '3.14']
platform:
- runner: ubuntu-latest
os: linux
target: x86_64
- runner: windows-latest
os: windows
target: x64
- runner: macos-latest
os: macos
target: universal2-apple-darwin
runs-on: ${{ matrix.platform.runner }}
steps:
- uses: actions/checkout@v6
with:
ref: ${{ github.event_name == 'workflow_dispatch' && inputs.version || '' }}
- name: Install python
uses: actions/setup-python@v6
with:
python-version: ${{ matrix.python-version }}
- name: Build
uses: PyO3/maturin-action@v1
with:
maturin-version: ${{ env.MATURIN_VERSION }}
target: ${{ matrix.platform.target }}
manylinux: auto
args: -i ${{ matrix.python-version }} --release --out dist
- name: Install wheel
run: pip3 install ${{ matrix.platform.os == 'windows' && '(get-item .\dist\*.whl)' || 'dist/*.whl' }}
- name: Test
run: python3 python/test_python.py
- name: Upload artifacts
uses: actions/upload-artifact@v6
with:
name: python-${{ matrix.platform.os}}-${{ matrix.python-version }}
path: dist/*.whl
compression-level: 0
python-sdist:
runs-on: ubuntu-latest
needs: rust-test
if: always() && needs.rust-test.result == 'success'
steps:
- uses: actions/checkout@v6
with:
ref: ${{ github.event_name == 'workflow_dispatch' && inputs.version || '' }}
- name: Install python
uses: actions/setup-python@v6
with:
python-version: 3.x
- name: Build sdist
uses: PyO3/maturin-action@v1
with:
maturin-version: ${{ env.MATURIN_VERSION }}
command: sdist
args: --out dist
- name: Upload artifacts
uses: actions/upload-artifact@v6
with:
name: python-sdist
path: dist
compression-level: 0
python-sdist-test:
runs-on: ubuntu-latest
needs: python-sdist
if: always() && needs.python-sdist.result == 'success'
steps:
- uses: actions/checkout@v6
with:
ref: ${{ github.event_name == 'workflow_dispatch' && inputs.version || '' }}
- name: Install Rust
uses: dtolnay/rust-toolchain@stable
- name: Install python
uses: actions/setup-python@v6
with:
python-version: 3.13
allow-prereleases: true
- uses: actions/download-artifact@v7
with:
name: python-sdist
- name: Build and install wheel
run: pip3 install *.tar.gz
- name: Test
run: python3 python/test_python.py
release:
runs-on: ubuntu-latest
if: github.event_name == 'workflow_dispatch'
needs: [javascript, python-wheel, python-sdist, python-sdist-test, go-test]
permissions:
contents: write
id-token: write
steps:
- uses: actions/checkout@v6
with:
fetch-depth: 0 # need tags to generate release notes
ref: ${{ inputs.version }}
- name: Install Rust
uses: dtolnay/rust-toolchain@stable
- name: Publish rust
env:
CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_TOKEN }}
run: cargo publish --allow-dirty
- name: Install Node
uses: actions/setup-node@v6
with:
node-version: 24
registry-url: 'https://registry.npmjs.org/'
- name: Release Notes
run: |
echo '## Changes since previous release:' > changelog.md
git log --oneline $(git describe --tags --abbrev=0 HEAD^)..HEAD --pretty=format:"- [%h](https://github.com/cdump/evmole/commit/%H) %s" >> changelog.md
cat changelog.md
- name: Download Python Artifacts
uses: actions/download-artifact@v7
with:
pattern: python-*
path: dist-py
merge-multiple: true
- name: Download JavaScript artifacts
uses: actions/download-artifact@v7
with:
name: javascript
path: .
- name: Publish and verify npm packages
env:
NPM_CONFIG_PREFER_ONLINE: 'true'
run: |
wait_for_npm_version() {
local package_name="$1"
local expected_version="$2"
local published_version
for attempt in {1..30}; do
published_version="$(npm view "${package_name}@${expected_version}" version 2>/dev/null || true)"
if [[ "$published_version" == "$expected_version" ]]; then
echo "${package_name}@${expected_version} is available from npm."
return 0
fi
echo "Waiting for ${package_name}@${expected_version} to become available from npm (attempt ${attempt}/30)..."
sleep 10
done
echo "Error: ${package_name}@${expected_version} did not become available from npm." >&2
return 1
}
npm publish --provenance ./javascript/evmole-*.tgz
wait_for_npm_version evmole "${{ inputs.version }}"
npx -y "evmole@${{ inputs.version }}" analyze --bytecode 0x00
npm publish --provenance ./agent/mcp/evmole-mcp-*.tgz
wait_for_npm_version evmole-mcp "${{ inputs.version }}"
npm --prefix agent/mcp install --ignore-scripts --package-lock=false --no-save --no-audit --no-fund
node agent/mcp/tests/public-smoke.mjs "${{ inputs.version }}"
- name: Publish MCP Registry metadata
working-directory: agent/mcp
run: |
curl -L "https://github.com/modelcontextprotocol/registry/releases/download/v${MCP_PUBLISHER_VERSION}/mcp-publisher_linux_amd64.tar.gz" | tar xz mcp-publisher
./mcp-publisher validate
./mcp-publisher login github-oidc
./mcp-publisher publish
- name: Github Release
uses: softprops/action-gh-release@v3
with:
tag_name: ${{ inputs.version }}
name: Release ${{ inputs.version }}
draft: false
prerelease: false
body_path: changelog.md
files: |
javascript/evmole-*.tgz
agent/mcp/evmole-mcp-*.tgz
dist-py/*
- name: Publish python
uses: pypa/gh-action-pypi-publish@unstable/v1 # unstable tmp for issue #309
with:
attestations: true
packages-dir: dist-py/