From 11d94872d6a7f2695834303179f30a53b4574837 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ti=E1=BA=BFn=20Nguy=E1=BB=85n=20Kh=E1=BA=AFc?= Date: Tue, 11 Jun 2024 17:58:16 +1200 Subject: [PATCH] ci: workflow for publishing snapshot packages --- .github/workflows/packages.yml | 25 ++++++++++++++++++++++++ apps/docs/docs/getting-started/setup.mdx | 6 +++--- 2 files changed, 28 insertions(+), 3 deletions(-) create mode 100644 .github/workflows/packages.yml diff --git a/.github/workflows/packages.yml b/.github/workflows/packages.yml new file mode 100644 index 00000000..84308e0c --- /dev/null +++ b/.github/workflows/packages.yml @@ -0,0 +1,25 @@ +name: Packages + +on: + push: + branches: [main] + +jobs: + publish-snapshot: + if: github.event_name == 'push' + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + with: + # https://github.com/yarnpkg/berry/issues/4014 + fetch-depth: 0 + + - uses: ./.github/actions/setup + + - run: yarn nx run-many -t build --projects="packages/*" + + - run: yarn workspaces foreach -At --no-private version 0.0.0-snapshot.$(git rev-parse --short HEAD) --immediate + + - run: yarn workspaces foreach -At --no-private npm publish --access public --tag snapshot --tolerate-republish + env: + YARN_NPM_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} diff --git a/apps/docs/docs/getting-started/setup.mdx b/apps/docs/docs/getting-started/setup.mdx index 8e715406..429166c6 100644 --- a/apps/docs/docs/getting-started/setup.mdx +++ b/apps/docs/docs/getting-started/setup.mdx @@ -18,17 +18,17 @@ First add React DOT, along with required packages as dependencies to your React ```sh - npm add @reactive-dot/react polkadot-api + npm add @reactive-dot/react@snapshot polkadot-api ``` ```sh - yarn add @reactive-dot/react polkadot-api + yarn add @reactive-dot/react@snapshot polkadot-api ``` ```sh - pnpm add @reactive-dot/react polkadot-api + pnpm add @reactive-dot/react@snapshot polkadot-api ```