diff --git a/.changeset/config.json b/.changeset/config.json index 89b8c20..d8265e1 100644 --- a/.changeset/config.json +++ b/.changeset/config.json @@ -1,6 +1,5 @@ { "$schema": "https://unpkg.com/@changesets/config@2.1.0/schema.json", - "changelog": "@changesets/cli/changelog", "commit": false, "fixed": [], "linked": [], diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..f346dfe --- /dev/null +++ b/.github/workflows/release.yml @@ -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 }} diff --git a/package.json b/package.json index 1b18b2c..5a8469e 100644 --- a/package.json +++ b/package.json @@ -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", diff --git a/packages/reacord/package.json b/packages/reacord/package.json index 30f386b..9d50dc1 100644 --- a/packages/reacord/package.json +++ b/packages/reacord/package.json @@ -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", diff --git a/packages/reacord/scripts/release.sh b/packages/reacord/scripts/release.sh deleted file mode 100755 index 943a261..0000000 --- a/packages/reacord/scripts/release.sh +++ /dev/null @@ -1,4 +0,0 @@ -pnpm run build -cp ../../README.md . -cp ../../LICENSE . -pnpm release-it