diff --git a/.github/actions/setup/action.yaml b/.github/actions/setup/action.yaml new file mode 100644 index 00000000..516ca41b --- /dev/null +++ b/.github/actions/setup/action.yaml @@ -0,0 +1,28 @@ +name: 'setup' +description: Prepare the environment + +runs: + using: composite + steps: + - name: Checkout code repository + uses: actions/checkout@v3 + with: + fetch-depth: 0 + + - name: Setup node.js + uses: actions/setup-node@v3 + with: + node-version: 16 + + - name: Setup pnpm + uses: pnpm/action-setup@v2 + id: pnpm-install + with: + version: 8 + run_install: false + + - name: Setup pnpm config + run: pnpm config set store-dir .pnpm-store + + - name: Install dependencies + run: pnpm install diff --git a/.github/workflows/docs.yaml b/.github/workflows/docs.yaml new file mode 100644 index 00000000..dae55183 --- /dev/null +++ b/.github/workflows/docs.yaml @@ -0,0 +1,25 @@ +name: Deploy docs +on: + push: + branches: + - dev + +jobs: + release: + name: deploy docs + if: github.repository == 'node-real/walletkit' + timeout-minutes: 10 + runs-on: ubuntu-latest + steps: + - uses: ./.github/actions/setup + + - name: Build docs + run: pnpm build:docs + + - name: Deploy docs + uses: JamesIves/github-pages-deploy-action@v4 + with: + folder: ./website/dist + branch: 'docs' + clean: true + force: true diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index 391aa96e..74ce80ce 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -5,33 +5,17 @@ on: - main - 0.x -env: - CI: true - PNPM_CACHE_FOLDER: .pnpm-store - jobs: release: name: release if: github.repository == 'node-real/walletkit' - timeout-minutes: 15 + timeout-minutes: 10 runs-on: ubuntu-latest steps: - - name: Checkout code repository - uses: actions/checkout@v3 - with: - fetch-depth: 0 + - uses: ./.github/actions/setup - - name: Setup node.js - uses: actions/setup-node@v3 - with: - node-version: 16 - - - name: Setup pnpm - uses: pnpm/action-setup@v2 - id: pnpm-install - with: - version: 8 - run_install: false + - name: Build packages + run: pnpm build - name: Creating .npmrc run: | @@ -41,15 +25,6 @@ jobs: env: NPM_TOKEN: ${{ secrets.NPM_TOKEN }} - - name: Setup pnpm config - run: pnpm config set store-dir $PNPM_CACHE_FOLDER - - - name: Install dependencies - run: pnpm install - - - name: Build packages - run: pnpm --filter "@totejs/**" build - - name: Create and publish versions uses: changesets/action@v1 with: diff --git a/package.json b/package.json index eb808576..b4829f73 100644 --- a/package.json +++ b/package.json @@ -9,7 +9,10 @@ "scripts": { "prepare": "husky install", "lint": "pnpm eslint .", - "dev": "pnpm --filter @totejs/walletkit dev", + "dev": "pnpm --F @totejs/walletkit dev", + "build": "pnpm --F @totejs/walletkit build", + "dev:docs": "pnpm --F @totejs/walletkit build:watch & pnpm --F website dev", + "build:docs": "pnpm --F @totejs/walletkit build && pnpm --F website build", "ci:version": "pnpm changeset version && pnpm install && cp README.md packages/walletkit/README.md", "ci:publish": "pnpm publish -r" }, diff --git a/website/package.json b/website/package.json index 910fc279..07514fb8 100644 --- a/website/package.json +++ b/website/package.json @@ -4,6 +4,7 @@ "author": "node-real", "private": true, "type": "module", + "homepage": "https://node-real.github.io/walletkit", "scripts": { "dev": "vite --host 0.0.0.0", "build": "tsc && vite build"