Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 12 additions & 10 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,27 +4,25 @@ on:
push:
branches:
- main
pull_request:
branches:
- main

jobs:
versioning:
runs-on: ubuntu-latest
steps:
# Checkout the code
- name: Checkout code
uses: actions/checkout@v2
uses: actions/checkout@v3

# Set up Node.js environment
- name: Set up Node.js
uses: actions/setup-node@v3
with:
node-version: '20'
registry-url: 'https://registry.npmjs.org/'

# Install dependencies
# Install all dependencies (including devDependencies for lint/test/build)
- name: Install dependencies
run: yarn install --frozen-lockfile --production
run: yarn install

# Run linting
- name: Run lint
Expand All @@ -43,14 +41,18 @@ jobs:
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
run: |
yarn release
run: yarn release

# Optionally, you can include a job to deploy to npm
publish:
needs: release
needs: versioning
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3

- name: Install production dependencies
run: yarn install --frozen-lockfile --production

# Publish to npm
- name: Publish to npm
run: yarn publish --non-interactive
Expand Down