Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Create artifact package #38

Merged
merged 26 commits into from
Feb 12, 2025
Merged
Show file tree
Hide file tree
Changes from 6 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
52 changes: 52 additions & 0 deletions .github/workflows/publish-artifacts.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
name: Publish Admin Plugin Artifact Package

on:
workflow_dispatch:
inputs:
branch:
description: 'Branch to publish from'
required: true
default: 'main'

jobs:
publish:
runs-on: ubuntu-latest
steps:
# Step 1: Checkout the repository
- name: Checkout Repository
uses: actions/checkout@v3
with:
ref: ${{ github.event.inputs.branch }}

# Step 2: Set up Node.js
- name: Set up Node.js
uses: actions/setup-node@v3
with:
node-version: '18'
registry-url: 'https://registry.npmjs.org/'

# Step 3: Install dependencies
- name: Install Dependencies
run: |
cd packages/artifact
Rekard0 marked this conversation as resolved.
Show resolved Hide resolved
yarn install

# Step 4: Generate ABIs
- name: Generate ABIs
run: |
cd packages/artifact
yarn generate

# Step 5: Build the package
- name: Build Package
run: |
cd packages/artifact
yarn build

# Step 6: Publish to NPM
- name: Publish to NPM
run: |
cd packages/artifact
Rekard0 marked this conversation as resolved.
Show resolved Hide resolved
npm publish --access public
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
8 changes: 7 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
.coverage_artifacts
.coverage_cache
.coverage_contracts
artifacts
packages/contracts/artifacts
build
cache
coverage
Expand Down Expand Up @@ -37,3 +37,9 @@ artifacts-zk
cache-zk
deployments-zk
deployments

generated
Rekard0 marked this conversation as resolved.
Show resolved Hide resolved

# artifacts
temp_repo
packages/artifacts/src/abis/abis.ts
Rekard0 marked this conversation as resolved.
Show resolved Hide resolved
12 changes: 12 additions & 0 deletions packages/artifacts/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# Aragon Admin plugin Artifacts

All notable changes to this project will be documented in this file.

The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## v1.4.0
Rekard0 marked this conversation as resolved.
Show resolved Hide resolved

## Added
Rekard0 marked this conversation as resolved.
Show resolved Hide resolved

- Add admin plugin's contracts artifacts of version 1.2.
Rekard0 marked this conversation as resolved.
Show resolved Hide resolved
25 changes: 25 additions & 0 deletions packages/artifacts/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# Admin Plugin artifacts

This package contains the ABIs of the OSx Admin plugin, as well as the address of the plugin repository on each network.

## Installation

```sh
yarn add @aragon/admin-plugin-artifacts
```

## Documentation

You can find all documentation regarding how to use this plugin in [Aragon's documentation here](https://docs.aragon.org/).
Rekard0 marked this conversation as resolved.
Show resolved Hide resolved

## Contributing

If you like what we're doing and would love to support, please review our `CONTRIBUTING_GUIDE.md` [here](https://github.com/aragon/admin-plugin/blob/main/CONTRIBUTIONS.md). We'd love to build with you.

## Security

If you believe you've found a security issue, we encourage you to notify us. We welcome working with you to resolve the issue promptly.

Security Contact Email: [email protected]

Please do not use the issue tracker for security issues.
33 changes: 33 additions & 0 deletions packages/artifacts/generateAbis.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
#!/usr/bin/env bash

set -e # Exit on error

# Define directories
CONTRACTS_DIR="../contracts"
GENERATED_ABI_FILE="../contracts/generated/abis.ts"
OUTPUT_ABIS_DIR="src/abis"

# Move into contracts package and install dependencies
cd $CONTRACTS_DIR

# build contracts & generate abis
yarn install

yarn build

yarn wagmi:generate

# Move back to artifacts package
cd -

# Ensure the output directory exists
mkdir -p "$OUTPUT_ABIS_DIR"

# Copy the generated ABIs to the output directory
if [ -f "$GENERATED_ABI_FILE" ]; then
cp "$GENERATED_ABI_FILE" "$OUTPUT_ABIS_DIR/abis.ts"
else
echo "Warning: generated/abis.ts not found."
Rekard0 marked this conversation as resolved.
Show resolved Hide resolved
fi

echo "ABI generation complete. ABIs are stored in $OUTPUT_ABIS_DIR."
22 changes: 22 additions & 0 deletions packages/artifacts/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
{
"name": "@aragon/admin-plugin-artifacts",
Rekard0 marked this conversation as resolved.
Show resolved Hide resolved
"author": "Aragon X",
"version": "1.4.0",
Rekard0 marked this conversation as resolved.
Show resolved Hide resolved
"license": "AGPL-3.0-or-later",
"description": "The Aragon OSx Solidity contracts ABIs",
Rekard0 marked this conversation as resolved.
Show resolved Hide resolved
"typings": "dist/index.d.ts",
"main": "dist/index.js",
"files": [
"dist"
],
"publishConfig": {
"access": "public"
},
"scripts": {
"build": "tsc -p tsconfig.json",
"generate": "bash generateAbis.sh"
},
"devDependencies": {
"typescript": "^5.5.4"
}
}
46 changes: 46 additions & 0 deletions packages/artifacts/src/addresses.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
{
"network": {
"mainnet": {
"repoAddress":"0xA4371a239D08bfBA6E8894eccf8466C6323A52C3"
},
"sepolia": {
"repoAddress":"0x152c9E28995E418870b85cbbc0AEE4e53020edb2"
},
"holesky": {
"repoAddress":"0xC56B719Fc71D9056AbC559a0E3e6CE98Abc44a67"
},
"devSepolia": {
"repoAddress":"0xEdA3074437375DC71007AFC9D421644656d72287"
},
"polygon": {
"repoAddress":"0x7fF570473d0876db16A59e8F04EE7F17Ab117309"
},
"mumbai": {
"repoAddress":"0x0DF9b15550fF39149e491dDD154b28f587e0cD16"
},
"base": {
"repoAddress":"0x212eF339C77B3390599caB4D46222D79fAabcb5c"
},
"baseSepolia": {
"repoAddress":"0x152c9E28995E418870b85cbbc0AEE4e53020edb2"
},
"arbitrum": {
"repoAddress":"0x326A2aee6A8eE78D79E7E956DE60C6E452f76a8e"
},
"arbitrumSepolia": {
"repoAddress":"0x152c9E28995E418870b85cbbc0AEE4e53020edb2"
},
"linea": {
"repoAddress":"0x7d56667664ADf9e5aAb436629e6a789162Ad83eA"
},
"lineaSepolia": {
"repoAddress":"0xf79F733e0D5d5e0e3037b221E8B3fd12Fb564101"
},
"zksync": {
"repoAddress":""
},
"zksyncSepolia": {
"repoAddress":""
}
}
}
2 changes: 2 additions & 0 deletions packages/artifacts/src/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
export * from './abis/abis';
Rekard0 marked this conversation as resolved.
Show resolved Hide resolved
export { default as addresses } from './addresses.json';
11 changes: 11 additions & 0 deletions packages/artifacts/tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"compilerOptions": {
"target": "ES6",
"module": "commonjs",
"resolveJsonModule": true,
"esModuleInterop": true,
"declaration": true,
"outDir": "./dist"
},
"include": ["src"]
}
8 changes: 8 additions & 0 deletions packages/artifacts/yarn.lock
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY.
# yarn lockfile v1


typescript@^5.5.4:
version "5.7.3"
resolved "https://registry.yarnpkg.com/typescript/-/typescript-5.7.3.tgz#919b44a7dbb8583a9b856d162be24a54bf80073e"
integrity sha512-84MVSjMEHP+FQRPy3pX9sTVV/INIex71s9TL2Gm5FG/WG1SqXeKyZ0k7/blY/4FdOzI12CBy1vGc4og/eus0fw==
7 changes: 5 additions & 2 deletions packages/contracts/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,8 @@
"docgen": "hardhat docgen",
"typechain": "cross-env TS_NODE_TRANSPILE_ONLY=true hardhat typechain",
"clean": "rimraf ./artifacts ./cache ./coverage ./typechain ./coverage.json && yarn typechain",
"docs": "DOCS=true scripts/prepare-docs.sh"
"docs": "DOCS=true scripts/prepare-docs.sh",
"wagmi:generate": "wagmi generate"
Rekard0 marked this conversation as resolved.
Show resolved Hide resolved
},
"dependencies": {
"@aragon/osx-commons-contracts": "^1.4.0",
Expand Down Expand Up @@ -76,6 +77,8 @@
"tmp-promise": "^3.0.3",
"ts-node": "^10.9.1",
"typechain": "^8.3.2",
"typescript": "^5.2.2"
"typescript": "^5.2.2",
"@wagmi/cli": "^2.2.0",
"@wagmi/core": "^2.16.3"
Rekard0 marked this conversation as resolved.
Show resolved Hide resolved
Rekard0 marked this conversation as resolved.
Show resolved Hide resolved
}
}
1 change: 1 addition & 0 deletions packages/contracts/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
"exclude": ["node_modules"],
"files": ["./hardhat.config.ts"],
"include": [
"wagmi.config.ts",
Rekard0 marked this conversation as resolved.
Show resolved Hide resolved
"hardhat-zksync.config.ts",
"src/**/*",
"deploy/**/*",
Expand Down
14 changes: 14 additions & 0 deletions packages/contracts/wagmi.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
import {defineConfig} from '@wagmi/cli';
import {hardhat} from '@wagmi/cli/plugins';

export default defineConfig({
// using abi instead of generated to avoid being ignored by git
out: 'generated/abis.ts',
plugins: [
hardhat({
project: './',
artifacts: 'artifacts/src',
exclude: ['**/test/**', '**/mocks/**'],
}),
],
});
Rekard0 marked this conversation as resolved.
Show resolved Hide resolved
Loading
Loading