due to change in pnpm@v9, set up .npmrc to link workspace packages ex… #1
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: Deploy Package | ||
on: | ||
workflow_call: | ||
secrets: | ||
GH_REGISTRY_PAT: | ||
required: true | ||
jobs: | ||
deployment: | ||
runs-on: ubuntu-latest | ||
env: | ||
## Secrets | ||
# Organizational | ||
GH_REGISTRY_PAT: ${{ secrets.GH_REGISTRY_PAT }} | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
- name: Set up .npmrc | ||
run: 'echo 'link-workspace-packages=true' > .npmrc' | ||
- id: "git-setup" | ||
name: Set up Git | ||
run: | | ||
git config user.email "actions@github.com" | ||
git config user.name "GitHub Actions" | ||
- uses: pnpm/action-setup@v4 | ||
with: | ||
version: 9 | ||
- run: | | ||
pnpm config set @lost-worlds:registry=https://npm.pkg.github.com | ||
pnpm config set //npm.pkg.github.com/:_authToken "$GH_REGISTRY_PAT" | ||
pnpm install | ||
- run: pnpm build | ||
- run: pnpm version patch --no-git-tag-version | ||
- uses: actions/setup-node@v3 | ||
with: | ||
registry-url: "https://npm.pkg.github.com" | ||
scope: "@lost-worlds" | ||
- run: pnpm publish --no-git-checks | ||
env: | ||
NODE_AUTH_TOKEN: ${{ secrets.GH_REGISTRY_PAT }} | ||
- name: commit | ||
run: | | ||
NEW_VERSION=$(node -p "require('./package.json').version") | ||
git add package.json | ||
git commit -m "[no ci] $NEW_VERSION" | ||
git push |