-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #97 from aragon/feat/add-osx-and-plugins-artifacts
feat: add osx and plugins artifacts
- Loading branch information
Showing
20 changed files
with
8,900 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
name: Artifacts Publish | ||
|
||
on: | ||
push: | ||
tags: | ||
- '*-artifacts' | ||
|
||
jobs: | ||
check_tag: | ||
uses: ./.github/workflows/reusable-check-tag.yml | ||
with: | ||
ref: ${{ github.ref }} | ||
|
||
publish: | ||
needs: [check_tag] | ||
uses: ./.github/workflows/reusable-publish.yml | ||
with: | ||
package: ${{ needs.check_tag.outputs.package }} | ||
version: ${{ needs.check_tag.outputs.version }} | ||
secrets: | ||
NPM_TOKEN: ${{ secrets.NPM_TOKEN }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -11,7 +11,6 @@ coverage | |
.coverage_contracts | ||
|
||
# production | ||
artifacts | ||
build | ||
cache | ||
dist | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,7 +2,6 @@ | |
.coverage_artifacts | ||
.coverage_cache | ||
.coverage_contracts | ||
artifacts | ||
build | ||
cache | ||
coverage | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
ALCHEMY_API_KEY=your_alchemy_api_key |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
# Aragon OSx Commons 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). | ||
|
||
## v0.1.0-alpha.1 | ||
|
||
## Added | ||
|
||
- Add osx's contracts artifacts of version 1.4.0-alpha.1. | ||
- Add admin plugin's contracts artifacts of version 1.2-alpha.1. | ||
- Add multisig plugin's contracts artifacts of version 1.3-alpha.1. | ||
- Add token voting plugin's contracts artifacts of version 1.3-alpha.1. | ||
- Add staged proposal processor plugin's contracts artifacts of version 1.0.0-alpha.1. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
# @aragon/osx-dev-artifacts | ||
|
||
## Installation | ||
|
||
```bash | ||
npm install @aragon/osx-dev-artifacts | ||
## or | ||
yarn add @aragon/osx-dev-artifacts | ||
``` | ||
|
||
## Usage | ||
|
||
Import the needed abis from the package. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,70 @@ | ||
#!/bin/bash | ||
|
||
source .env | ||
|
||
if [ -z "$ALCHEMY_API_KEY" ] | ||
then | ||
echo "ALCHEMY_API_KEY is not set on the .env file, exiting..." | ||
exit -1 | ||
else | ||
export ALCHEMY_API_KEY=$ALCHEMY_API_KEY | ||
fi | ||
|
||
|
||
current_dir=$(pwd) | ||
CLONE_DIR="temp_dir" | ||
|
||
rm -rf $CLONE_DIR | ||
mkdir -p $CLONE_DIR | ||
cd $CLONE_DIR | ||
|
||
# The format is the following: | ||
# repoUrl = branchname&artifactsDirectory&projectType&contractsDirectory | ||
|
||
REPOS=$(cat <<EOF | ||
https://github.com/aragon/osx=develop&artifacts/src&hardhat&packages/contracts, | ||
https://github.com/aragon/admin-plugin=develop&artifacts/src&hardhat&packages/contracts, | ||
https://github.com/aragon/token-voting-plugin=develop&artifacts/src&hardhat&packages/contracts, | ||
https://github.com/aragon/multisig-plugin=develop&artifacts/src&hardhat&packages/contracts, | ||
https://github.com/aragon/staged-proposal-processor-plugin=init-project&out&forge& | ||
EOF | ||
) | ||
|
||
# Process each line | ||
while IFS=',' read -r line; do | ||
IFS='=' read -r repoUrl data <<< "$line" | ||
|
||
IFS='&' read -r branch artifactSource projectType contractsDirectory <<< "$data" | ||
|
||
REPO_NAME=$(basename $repoUrl .git) | ||
|
||
git clone -b ${branch} $repoUrl $REPO_NAME | ||
|
||
cd $REPO_NAME/$contractsDirectory | ||
|
||
yarn install | ||
|
||
yarn add -D @wagmi/cli | ||
|
||
if [ "$projectType" = "hardhat" ]; then | ||
cp $current_dir/wagmi.hardhat.config.ts wagmi.config.ts | ||
sed -i -e "s|REPLACE_ARTIFACTS_SOURCE|${artifactSource}|g" wagmi.config.ts | ||
npx hardhat compile | ||
|
||
elif [ "$projectType" = "forge" ]; then | ||
cp $current_dir/wagmi.foundry.config.ts wagmi.config.ts | ||
forge remappings | ||
forge compile | ||
|
||
else | ||
echo "either hardhat or forge project is required" | ||
exit 1 | ||
fi | ||
|
||
yarn wagmi generate | ||
|
||
mv generated/abis.ts $current_dir/src/abis/${REPO_NAME}-abis.ts | ||
|
||
cd $current_dir/$CLONE_DIR | ||
|
||
done <<< "$REPOS" |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
{ | ||
"name": "@aragon/osx-dev-artifacts", | ||
"author": "Aragon X", | ||
"version": "0.1.0-alpha.1", | ||
"license": "AGPL-3.0-or-later", | ||
"description": "The Aragon OSx Solidity contracts ABIs", | ||
"typings": "dist/index.d.ts", | ||
"main": "dist/index.js", | ||
"files": [ | ||
"dist" | ||
], | ||
"publishConfig": { | ||
"access": "public" | ||
}, | ||
"scripts": { | ||
"build": "tsc", | ||
"generate": "sh generateAbis.sh" | ||
}, | ||
"engines": { | ||
"node": "^14.0.0 || ^16.0.0 || ^18.0.0" | ||
}, | ||
"devDependencies": { | ||
"typescript": "^5.5.4", | ||
"@wagmi/cli": "^2.1.15" | ||
} | ||
} |
Oops, something went wrong.