setup releasing in CI

This commit is contained in:
itsMapleLeaf
2022-07-22 17:10:14 -05:00
committed by Darius
parent 1e527993e5
commit c93815b9f9
5 changed files with 38 additions and 9 deletions

View File

@@ -1,6 +1,5 @@
{
"$schema": "https://unpkg.com/@changesets/config@2.1.0/schema.json",
"changelog": "@changesets/cli/changelog",
"commit": false,
"fixed": [],
"linked": [],

34
.github/workflows/release.yml vendored Normal file
View File

@@ -0,0 +1,34 @@
# https://github.com/changesets/action#with-publishing
name: Release
on:
push:
branches:
- main
concurrency: ${{ github.workflow }}-${{ github.ref }}
jobs:
release:
name: Release
runs-on: ubuntu-latest
steps:
- name: Checkout Repo
uses: actions/checkout@v2
- name: Setup Node.js
uses: actions/setup-node@v2
with:
node-version: 16.x
- name: Install Dependencies
run: pnpm install --frozen-lockfile
- name: Create Release Pull Request or Publish to npm
id: changesets
uses: changesets/action@v1
with:
publish: pnpm run release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}

View File

@@ -5,9 +5,9 @@
"lint": "eslint --ext js,ts,tsx .",
"lint-fix": "pnpm lint -- --fix",
"format": "prettier --write .",
"release": "pnpm -C packages/reacord run release",
"build": "pnpm -C packages/website run build",
"start": "pnpm -C packages/website run start"
"build": "pnpm -r run build",
"start": "pnpm -C packages/website run start",
"release": "pnpm run build && changeset release"
},
"devDependencies": {
"@changesets/cli": "^2.24.0",

View File

@@ -35,7 +35,7 @@
}
},
"scripts": {
"build": "tsup library/main.ts --target node16 --format cjs,esm --dts --sourcemap",
"build": "cp ../../README.md . && cp ../../LICENSE . && tsup library/main.ts --target node16 --format cjs,esm --dts --sourcemap",
"build-watch": "pnpm build -- --watch",
"test": "vitest --coverage --no-watch",
"test-dev": "vitest",

View File

@@ -1,4 +0,0 @@
pnpm run build
cp ../../README.md .
cp ../../LICENSE .
pnpm release-it