From e2fc8fd4fd4f384493bbee3ef4fb14a3c4ad6da8 Mon Sep 17 00:00:00 2001 From: Rekard0 <5880388+Rekard0@users.noreply.github.com> Date: Mon, 10 Feb 2025 15:58:32 +0100 Subject: [PATCH] update readme & add publish flow --- .github/workflows/artifacts-publish.yml | 63 +++++++++++++++++++++++++ packages/artifacts/README.md | 10 ++-- 2 files changed, 67 insertions(+), 6 deletions(-) create mode 100644 .github/workflows/artifacts-publish.yml diff --git a/.github/workflows/artifacts-publish.yml b/.github/workflows/artifacts-publish.yml new file mode 100644 index 00000000..9658d07a --- /dev/null +++ b/.github/workflows/artifacts-publish.yml @@ -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 "github-actions@github.com" + 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 \ No newline at end of file diff --git a/packages/artifacts/README.md b/packages/artifacts/README.md index 54e7bc44..9cd2b3ca 100644 --- a/packages/artifacts/README.md +++ b/packages/artifacts/README.md @@ -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.