Skip to content

Commit

Permalink
Moved to pnpm.
Browse files Browse the repository at this point in the history
  • Loading branch information
SamTV12345 committed Mar 12, 2024
1 parent 184c518 commit d9dddaa
Show file tree
Hide file tree
Showing 4 changed files with 4,609 additions and 5,221 deletions.
55 changes: 41 additions & 14 deletions .github/workflows/npmpublish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -60,10 +60,25 @@ jobs:
timeout-minutes: 30
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
-
uses: actions/setup-node@v4
- uses: pnpm/action-setup@v3
name: Install pnpm
with:
version: 8
run_install: false
- name: Get pnpm store directory
shell: bash
run: |
echo "STORE_PATH=$(pnpm store path --silent)" >> $GITHUB_ENV
- uses: actions/cache@v4
name: Setup pnpm cache
with:
node-version: 21
- run: npm ci
path: ${{ env.STORE_PATH }}
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}-pnpm-store-
- run: pnpm i

# Verify databases are reachable.
- name: MySQL client and server check
Expand All @@ -75,11 +90,11 @@ jobs:
psql --version &&
psql -d postgresql://ueberdb:[email protected]/ueberdb -c '\dt'
- name: Create javascript files from typescript
run: npm run build
- run: npm test
run: pnpm run build
- run: pnpm run test
env:
SURREALDB_CI: false
- run: npm run lint
- run: pnpm run lint

publish-npm:
if: github.event_name == 'push'
Expand All @@ -93,15 +108,27 @@ jobs:
fetch-depth: 0
-
uses: actions/setup-node@v4
- uses: pnpm/action-setup@v3
name: Install pnpm
with:
version: 8
run_install: false
- name: Get pnpm store directory
shell: bash
run: |
echo "STORE_PATH=$(pnpm store path --silent)" >> $GITHUB_ENV
- uses: actions/cache@v4
name: Setup pnpm cache
with:
node-version: 21
registry-url: https://registry.npmjs.org/
cache: 'npm'
path: ${{ env.STORE_PATH }}
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}-pnpm-store-
# This is required if the package has a prepare script that uses something
# in dependencies or devDependencies. This is also needed for bumping the
# version.
-
run: npm ci
run: pnpm i
-
name: Bump version (patch)
run: |
Expand All @@ -110,7 +137,7 @@ jobs:
[ "${NEW_COMMITS}" -gt 0 ] || exit 0
git config user.name 'github-actions[bot]'
git config user.email '41898282+github-actions[bot]@users.noreply.github.com'
npm version patch
pnpm version patch
# Update the branch before pushing the tag in case the branch can't be
# fast-forwarded.
git push
Expand All @@ -127,13 +154,13 @@ jobs:
# the second's will succeed.
-
name: Convert typescript and create dist folder
run: npm run build
run: pnpm run build
-
run: npm publish
run: pnpm publish
env:
NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}}
-
name: Add package to etherpad organization
run: npm access grant read-write etherpad:developers ueberdb2
run: pnpm access grant read-write etherpad:developers ueberdb2
env:
NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}}
Loading

0 comments on commit d9dddaa

Please sign in to comment.