Skip to content

Commit

Permalink
update readme & add publish flow
Browse files Browse the repository at this point in the history
  • Loading branch information
Rekard0 committed Feb 10, 2025
1 parent e0df816 commit e2fc8fd
Show file tree
Hide file tree
Showing 2 changed files with 67 additions and 6 deletions.
63 changes: 63 additions & 0 deletions .github/workflows/artifacts-publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
name: Publish Artifacts

on:
workflow_dispatch:

jobs:
publish-artifacts-to-npm:
runs-on: ubuntu-latest

steps:
- name: Checkout Repository
uses: actions/checkout@v4

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

- name: Configure NPM for Scoped Package
run: |
cd packages/artifacts
SCOPE=$(jq -r '.name' package.json | cut -d'/' -f1)
echo "$SCOPE:registry=https://registry.npmjs.org/" > ~/.npmrc
echo "//registry.npmjs.org/:_authToken=${{ secrets.NPM_TOKEN }}" >> ~/.npmrc
- name: Get Version from package.json
id: get_version
run: |
cd packages/artifacts
VERSION=$(jq -r '.version' package.json)
TAG_VERSION="v$VERSION"
echo "VERSION=$TAG_VERSION" >> $GITHUB_ENV
- name: Create Git Tag
run: |
git config --global user.name "github-actions"
git config --global user.email "[email protected]"
git tag $VERSION
git push origin $VERSION
- name: Install Dependencies
run: |
cd packages/artifacts
yarn install
- name: Build Package
env:
ALCHEMY_API_KEY: ${{ secrets.ALCHEMY_API_KEY }}
run: |
cd packages/artifacts
yarn build
- name: Publish to NPM
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
run: |
cd packages/artifacts
if [[ "$VERSION" == *"-alpha"* ]]; then
npm publish --tag alpha --access public
else
npm publish --tag latest --access public
fi
10 changes: 4 additions & 6 deletions packages/artifacts/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,11 @@ yarn add @aragon/admin-plugin-artifacts

```typescript
import {
MultisigABI,
IMultisigABI,
ListedCheckConditionABI,
MultisigSetupABI
} from "@aragon/multisig-plugin-artifacts";
AdminSetupABI,
AdminABI
} from "@aragon/admin-plugin-artifacts";

import { addresses } from "@aragon/multisig-plugin-artifacts";
import { addresses } from "@aragon/admin-plugin-artifacts";
```

You can also open [addresses.json](./src/addresses.json) directly.
Expand Down

0 comments on commit e2fc8fd

Please sign in to comment.