Merge pull request #1130 from web3ui/dk-exports-package-json #443
This file contains hidden or 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
| name: PNPM Create PR or Publish | |
| on: | |
| push: | |
| branches: | |
| - master | |
| env: | |
| CI: true | |
| PNPM_CACHE_FOLDER: .pnpm-store | |
| jobs: | |
| release: | |
| timeout-minutes: 15 | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout repo | |
| uses: actions/checkout@v2 | |
| with: | |
| # This makes action fetch all Git history so that Changesets can generate changelogs with the correct commits | |
| fetch-depth: 0 | |
| #Install pnpm | |
| - name: Install pnpm | |
| uses: pnpm/action-setup@v2.2.2 | |
| with: | |
| version: 7.28.0 | |
| - name: Use Node ${{ matrix.node }} | |
| uses: actions/setup-node@v2 | |
| with: | |
| node-version: ${{ matrix.node }} | |
| - name: Setup npmrc | |
| run: echo "//registry.npmjs.org/:_authToken=${{ secrets.NPM_TOKEN }}" > .npmrc | |
| - name: setup pnpm config | |
| run: pnpm config set store-dir $PNPM_CACHE_FOLDER | |
| - name: Install | |
| run: pnpm install | |
| env: | |
| NPM_TOKEN: ${{ secrets.NPM_TOKEN }} | |
| - name: Set Username | |
| run: git config --global user.name "GitHub CD bot" | |
| - name: Set Email | |
| run: git config --global user.email "dmitrii@moralis.io" | |
| - name: Build | |
| run: pnpm run build | |
| # run tests just in case | |
| - name: Test | |
| run: pnpm vitest --run | |
| # Publish using changeset | |
| - name: create PR or publish | |
| uses: changesets/action@v1 | |
| with: | |
| publish: pnpm ci:publish | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| NPM_TOKEN: ${{ secrets.NPM_TOKEN }} |