Skip to content

Commit

Permalink
Chore/build/pnpm (#997)
Browse files Browse the repository at this point in the history
* chore(node): switching to pnpm

* chore(build): updating actions to use pnpm

* chore(build): updating action node-setup

* chore(build): setting packagemanager

* fix(pnpm): updating types and deps for pnpm
  • Loading branch information
eikeland authored Feb 19, 2024
1 parent 045d013 commit a8a2c1f
Show file tree
Hide file tree
Showing 8 changed files with 10,971 additions and 20,527 deletions.
21 changes: 21 additions & 0 deletions .github/workflows/actions/node-setup/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
name: Setup Node
description: General setup of node
inputs:
node-version:
default: '18'
description: Node version for environment

runs:
using: composite
steps:
- uses: pnpm/action-setup@v2

- uses: actions/setup-node@v4
with:
node-version: ${{ inputs.node-version }}
cache: 'pnpm'
registry-url: "https://registry.npmjs.org"

- name: Install Node Dependencies
shell: bash
run: pnpm install
23 changes: 10 additions & 13 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,17 +8,14 @@ on:
jobs:
build:
runs-on: ubuntu-latest

strategy:
matrix:
node-version: [18.x]
steps:
- uses: actions/checkout@v2
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v2
with:
node-version: ${{ matrix.node-version }}
- name: npm install
run: |
npm ci --legacy-peer-deps
npm run build
- uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Setup node and install deps
uses: ./.github/workflows/actions/node-setup

- name: Build project
run:
pnpm run build
33 changes: 14 additions & 19 deletions .github/workflows/prePublish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,25 +8,20 @@ on:
jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [18.x]
steps:
- uses: actions/checkout@v2

- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v2
with:
registry-url: https://registry.npmjs.org
- uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Setup node and install deps
uses: ./.github/workflows/actions/node-setup

- name: npm install, update version.ts, run tsc
run: |
npm ci --legacy-peer-deps
npm run update-templates
npm run build
- name: pnpm build
run:
pnpm run build

- name: npm publish
run: npm publish --access public --tag next
env:
CI: true
NODE_AUTH_TOKEN: ${{ secrets.NPM_AUTH_TOKEN }}
- name: pnpm publish
run: pnpm publish --access public --tag next
env:
CI: true
NODE_AUTH_TOKEN: ${{ secrets.NPM_AUTH_TOKEN }}
35 changes: 16 additions & 19 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,23 +9,20 @@ jobs:
build:
if: "!github.event.release.prerelease"
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [18.x]
steps:
- uses: actions/checkout@v2

- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v2
with:
registry-url: https://registry.npmjs.org
- name: npm build and publish
run: |
npm ci --legacy-peer-deps
npm run update-templates
npm run build
npm config set //registry.npmjs.org/:_authToken=$NODE_AUTH_TOKEN
npm publish --access public
env:
CI: true
NODE_AUTH_TOKEN: ${{ secrets.NPM_AUTH_TOKEN }}
- uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Setup node and install deps
uses: ./.github/workflows/actions/node-setup
- name: pnpm build and publish
run: |
pnpm run update-templates
pnpm run build
pnpm config set //registry.npmjs.org/:_authToken=$NODE_AUTH_TOKEN
pnpm publish --access public
env:
CI: true
NODE_AUTH_TOKEN: ${{ secrets.NPM_AUTH_TOKEN }}
Loading

0 comments on commit a8a2c1f

Please sign in to comment.