build: use pnpm instead of npm #416
Workflow file for this run
This file contains 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: Continuous Deployment | |
on: | |
push: | |
branches: | |
- main | |
pull_request: | |
jobs: | |
continuous-integration: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4.1.1 | |
- name: Install pnpm | |
uses: pnpm/action-setup@v2.4.0 | |
with: | |
version: 8.14 | |
- name: Set up Node.js version | |
uses: actions/setup-node@v4.0.1 | |
with: | |
node-version-file: .nvmrc | |
cache: pnpm | |
- name: Install dependencies | |
run: | | |
pnpm install | |
pnpm ls --recursive | |
- name: "Continuous Integration: lint" | |
run: | | |
pnpm run --if-present lint | |
- name: "Continuous Integration: build" | |
run: | | |
pnpm run --if-present build | |
- name: "Continuous Integration: test" | |
run: | | |
pnpm run --if-present test | |
publish-npm: | |
runs-on: ubuntu-latest | |
needs: continuous-integration | |
if: github.ref == 'refs/heads/main' | |
steps: | |
- uses: actions/checkout@v4.1.1 | |
with: | |
token: ${{ secrets.GH_REPO_TOKEN }} | |
- name: Install pnpm | |
uses: pnpm/action-setup@v2.4.0 | |
with: | |
version: 8.14 | |
- name: Set up Node.js version | |
uses: actions/setup-node@v4.0.1 | |
with: | |
node-version-file: .nvmrc | |
cache: pnpm | |
- name: "Continuous Deployment: install" | |
run: | | |
pnpm install | |
pnpm ls --recursive | |
- name: "Continuous Deployment: build" | |
run: | | |
pnpm run --if-present build | |
- name: "Continuous Deployment: publish to GitHub repository" | |
env: | |
GITHUB_TOKEN: ${{ secrets.GH_REPO_TOKEN }} | |
GIT_AUTHOR_EMAIL: ${{ secrets.GIT_AUTHOR_EMAIL }} | |
GIT_AUTHOR_NAME: "NL Design System" | |
GIT_COMMITTER_EMAIL: ${{ secrets.GIT_COMMITTER_EMAIL }} | |
GIT_COMMITTER_NAME: "NL Design System" | |
run: | | |
git push --set-upstream origin HEAD | |
pnpm run release -- --yes | |
- name: "Continuous Deployment: publish to npm" | |
env: | |
NPM_TOKEN: ${{ secrets.NPM_TOKEN }} | |
run: | | |
pnpm config set "//registry.npmjs.org/:_authToken" "${NPM_TOKEN}" | |
pnpm run publish -- --no-verify-access --yes | |
pnpm config delete "//registry.npmjs.org/:_authToken" |