Skip to content

Commit f6d0364

Browse files
authored
Merge pull request #97 from aragon/feat/add-osx-and-plugins-artifacts
feat: add osx and plugins artifacts
2 parents 0d84913 + 07bec06 commit f6d0364

20 files changed

+8900
-2
lines changed
+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
name: Artifacts Publish
2+
3+
on:
4+
push:
5+
tags:
6+
- '*-artifacts'
7+
8+
jobs:
9+
check_tag:
10+
uses: ./.github/workflows/reusable-check-tag.yml
11+
with:
12+
ref: ${{ github.ref }}
13+
14+
publish:
15+
needs: [check_tag]
16+
uses: ./.github/workflows/reusable-publish.yml
17+
with:
18+
package: ${{ needs.check_tag.outputs.package }}
19+
version: ${{ needs.check_tag.outputs.version }}
20+
secrets:
21+
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}

.gitignore

-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@ coverage
1111
.coverage_contracts
1212

1313
# production
14-
artifacts
1514
build
1615
cache
1716
dist

.prettierignore

-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
.coverage_artifacts
33
.coverage_cache
44
.coverage_contracts
5-
artifacts
65
build
76
cache
87
coverage

artifacts/.env.example

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
ALCHEMY_API_KEY=your_alchemy_api_key

artifacts/CHANGELOG.md

+16
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
# Aragon OSx Commons Artifacts
2+
3+
All notable changes to this project will be documented in this file.
4+
5+
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
6+
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7+
8+
## v0.1.0-alpha.1
9+
10+
## Added
11+
12+
- Add osx's contracts artifacts of version 1.4.0-alpha.1.
13+
- Add admin plugin's contracts artifacts of version 1.2-alpha.1.
14+
- Add multisig plugin's contracts artifacts of version 1.3-alpha.1.
15+
- Add token voting plugin's contracts artifacts of version 1.3-alpha.1.
16+
- Add staged proposal processor plugin's contracts artifacts of version 1.0.0-alpha.1.

artifacts/README.md

+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
# @aragon/osx-dev-artifacts
2+
3+
## Installation
4+
5+
```bash
6+
npm install @aragon/osx-dev-artifacts
7+
## or
8+
yarn add @aragon/osx-dev-artifacts
9+
```
10+
11+
## Usage
12+
13+
Import the needed abis from the package.

artifacts/generateAbis.sh

+70
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
1+
#!/bin/bash
2+
3+
source .env
4+
5+
if [ -z "$ALCHEMY_API_KEY" ]
6+
then
7+
echo "ALCHEMY_API_KEY is not set on the .env file, exiting..."
8+
exit -1
9+
else
10+
export ALCHEMY_API_KEY=$ALCHEMY_API_KEY
11+
fi
12+
13+
14+
current_dir=$(pwd)
15+
CLONE_DIR="temp_dir"
16+
17+
rm -rf $CLONE_DIR
18+
mkdir -p $CLONE_DIR
19+
cd $CLONE_DIR
20+
21+
# The format is the following:
22+
# repoUrl = branchname&artifactsDirectory&projectType&contractsDirectory
23+
24+
REPOS=$(cat <<EOF
25+
https://github.com/aragon/osx=develop&artifacts/src&hardhat&packages/contracts,
26+
https://github.com/aragon/admin-plugin=develop&artifacts/src&hardhat&packages/contracts,
27+
https://github.com/aragon/token-voting-plugin=develop&artifacts/src&hardhat&packages/contracts,
28+
https://github.com/aragon/multisig-plugin=develop&artifacts/src&hardhat&packages/contracts,
29+
https://github.com/aragon/staged-proposal-processor-plugin=init-project&out&forge&
30+
EOF
31+
)
32+
33+
# Process each line
34+
while IFS=',' read -r line; do
35+
IFS='=' read -r repoUrl data <<< "$line"
36+
37+
IFS='&' read -r branch artifactSource projectType contractsDirectory <<< "$data"
38+
39+
REPO_NAME=$(basename $repoUrl .git)
40+
41+
git clone -b ${branch} $repoUrl $REPO_NAME
42+
43+
cd $REPO_NAME/$contractsDirectory
44+
45+
yarn install
46+
47+
yarn add -D @wagmi/cli
48+
49+
if [ "$projectType" = "hardhat" ]; then
50+
cp $current_dir/wagmi.hardhat.config.ts wagmi.config.ts
51+
sed -i -e "s|REPLACE_ARTIFACTS_SOURCE|${artifactSource}|g" wagmi.config.ts
52+
npx hardhat compile
53+
54+
elif [ "$projectType" = "forge" ]; then
55+
cp $current_dir/wagmi.foundry.config.ts wagmi.config.ts
56+
forge remappings
57+
forge compile
58+
59+
else
60+
echo "either hardhat or forge project is required"
61+
exit 1
62+
fi
63+
64+
yarn wagmi generate
65+
66+
mv generated/abis.ts $current_dir/src/abis/${REPO_NAME}-abis.ts
67+
68+
cd $current_dir/$CLONE_DIR
69+
70+
done <<< "$REPOS"

artifacts/package-lock.json

+32
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

artifacts/package.json

+26
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
{
2+
"name": "@aragon/osx-dev-artifacts",
3+
"author": "Aragon X",
4+
"version": "0.1.0-alpha.1",
5+
"license": "AGPL-3.0-or-later",
6+
"description": "The Aragon OSx Solidity contracts ABIs",
7+
"typings": "dist/index.d.ts",
8+
"main": "dist/index.js",
9+
"files": [
10+
"dist"
11+
],
12+
"publishConfig": {
13+
"access": "public"
14+
},
15+
"scripts": {
16+
"build": "tsc",
17+
"generate": "sh generateAbis.sh"
18+
},
19+
"engines": {
20+
"node": "^14.0.0 || ^16.0.0 || ^18.0.0"
21+
},
22+
"devDependencies": {
23+
"typescript": "^5.5.4",
24+
"@wagmi/cli": "^2.1.15"
25+
}
26+
}

0 commit comments

Comments
 (0)