Skip to content

Commit

Permalink
chore: add publish package workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
sebastianwessel committed Feb 23, 2024
1 parent 23e7d60 commit 2356201
Show file tree
Hide file tree
Showing 2 changed files with 62 additions and 0 deletions.
61 changes: 61 additions & 0 deletions .github/workflows/release_version.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
name: Publish Package to npmjs
on:
workflow_dispatch:
inputs:
version:
description: 'version'
required: true
default: 'patch'
type: choice
options:
- patch
- minor
- major

jobs:
# Build job
build:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0 # Not needed if lastUpdated is not enabled
# - uses: pnpm/action-setup@v2 # Uncomment this if you're using pnpm
# - uses: oven-sh/setup-bun@v1 # Uncomment this if you're using Bun
- name: Setup Node
uses: actions/setup-node@v4
with:
node-version: 20
cache: npm # or pnpm / yarn
- name: Install dependencies
run: npm ci # or pnpm install / yarn install / bun install
- name: Lint
run: |
npm run lint
- name: Build purista core
run: |
npm run build -w packages/core
- name: Build purista packages
run: |
npm run build
- name: Test
run: |
npm run test:unit
- name: Bump version
run: |
npm version ${{ inputs.version }} --no-git-tag-version --workspaces
git config --global user.name '${{ env.CI_COMMIT_AUTHOR }}'
git config --global user.email '[email protected]'
git config --global push.followTags true
scripts/commitVersion.sh
- name: Dry run publish
run: |
npm publish --access public --dry-run
- name: Commit version
run: |
git push
- name: Publish
run: npm publish --access public
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
"start": "npm run dev -w examples/fullexample",
"build": "npm run build --workspaces --if-present",
"lint": "eslint . --ext .ts,.json --cache . --fix",
"lint:fix": "eslint . --ext .ts,.json --cache .",
"test": "npm run test:unit && npm run test:integration",
"test:unit": "vitest -c vite.config.ts",
"test:integration": "vitest -c vite.config.integration.ts",
Expand Down

0 comments on commit 2356201

Please sign in to comment.