Skip to content

Commit

Permalink
build: publish package in CI
Browse files Browse the repository at this point in the history
  • Loading branch information
fi3ework committed Dec 12, 2022
1 parent f0b78fa commit 8c638cf
Show file tree
Hide file tree
Showing 4 changed files with 48 additions and 40 deletions.
47 changes: 47 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
name: Release

on:
push:
tags:
- 'vite-plugin-checker@*'

jobs:
release:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0

- name: Install pnpm
uses: pnpm/action-setup@v2

- name: Set node
uses: actions/setup-node@v3
with:
node-version: 18
cache: pnpm
registry-url: 'https://registry.npmjs.org'

- run: npx changelogithub
continue-on-error: true
env:
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}

- name: Install Dependencies
run: pnpm i

- name: PNPM build
run: |
pnpm run format
pnpm run lint
pnpm run type-check
pnpm run clean
pnpm run build
cp README.md packages/vite-plugin-checker/README.md
cd packages/vite-plugin-checker
- name: Publish to NPM
run: pnpm publish --access public
env:
NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}}
12 changes: 1 addition & 11 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,14 +26,4 @@ npm run release -- --version=1.2.3 --dry

## Publish

Publish in @latest dist tag

```bash
npm run ci:publish
```

Or publish in other dist tag

```bash
npm run ci:publish -- dist-tag=beta
```
Package is automated published in CI, see `.github/workflows/release.yml`.
1 change: 0 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@
"test-build-cjs": "cross-env VITEST_TEST_CJS=1 pnpm run test-build",
"test-unit:watch": "vitest",
"type-check": "pnpm -r --parallel --filter \"vite-plugin-checker\" exec tsc --noEmit",
"ci:publish": "zx scripts/publish.mjs",
"docs:dev": "pnpm --filter docs exec vitepress dev .",
"docs:build": "pnpm --filter docs exec vitepress build .",
"docs:serve": "pnpm --filter docs exec vitepress serve ."
Expand Down
28 changes: 0 additions & 28 deletions scripts/publish.mjs

This file was deleted.

0 comments on commit 8c638cf

Please sign in to comment.