From ebea027add39d4695aa9059e4143ede12f86942a Mon Sep 17 00:00:00 2001 From: Amin Yahyaabadi Date: Tue, 10 Sep 2024 01:06:48 -0700 Subject: [PATCH] ci: install pnpm before publishing --- .github/workflows/CI.yml | 27 ++++++++++++++++++++++++--- 1 file changed, 24 insertions(+), 3 deletions(-) diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index 52af5fe..503d30b 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -36,8 +36,10 @@ jobs: path: | ~/.dub ~/AppData/Local/dub + ~/.pnpm ~/.pnpm-store D:\.pnpm-store + D:\.pnpm ./.dub key: "cache-OS:${{ matrix.os }}-D:${{ matrix.d }}-CXX:${{ matrix.compiler }}-${{ hashFiles('./dub.selections.json', './pnpm-lock.yaml')}} }}" restore-keys: | @@ -90,10 +92,18 @@ jobs: with: name: minijson-${{ runner.os }}-${{ runner.arch }} path: ./dist + retention-days: 1 Release: + if: startsWith(github.ref, 'refs/tags/') runs-on: ubuntu-latest needs: build + strategy: + matrix: + node: + - 20 + pnpm: + - 9 steps: - name: Merge Artifacts uses: actions/upload-artifact/merge@v4 @@ -106,7 +116,7 @@ jobs: name: merged-artifacts path: dist/ - - name: Prepare + - name: Prepare Dist run: | chmod +x ./dist/*/minijson zip -9 -j ./dist/minijson-windows-x64.zip ./dist/win32-x64/minijson.exe @@ -116,7 +126,6 @@ jobs: ls -l ./dist - name: Draft the release - if: startsWith(github.ref, 'refs/tags/') uses: meeDamian/github-release@2.0 with: token: ${{ secrets.GITHUB_TOKEN }} @@ -128,8 +137,20 @@ jobs: dist/minijson-macos-arm64.tar.gz dist/minijson-linux-x64.tar.gz + - name: Setup Node + uses: actions/setup-node@v4 + with: + node-version: ${{ matrix.node }} + + - name: Setup Pnpm + uses: pnpm/action-setup@v4 + with: + version: ${{ matrix.pnpm }} + + - name: Install dependencies + run: pnpm install + - name: Publish to npm - if: startsWith(github.ref, 'refs/tags/') run: pnpm publish env: NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}