From 77a989f8921df255597c5f3d224ab30eb06941e5 Mon Sep 17 00:00:00 2001 From: yosuke ota Date: Thu, 1 May 2025 15:26:35 +0900 Subject: [PATCH 1/2] chore: introduce changesets --- .changeset/README.md | 8 ++++++++ .changeset/config.json | 15 +++++++++++++++ .github/workflows/Release.yml | 33 +++++++++++++++++++++++++++++++++ package.json | 9 +++++++-- 4 files changed, 63 insertions(+), 2 deletions(-) create mode 100644 .changeset/README.md create mode 100644 .changeset/config.json create mode 100644 .github/workflows/Release.yml diff --git a/.changeset/README.md b/.changeset/README.md new file mode 100644 index 000000000..e5b6d8d6a --- /dev/null +++ b/.changeset/README.md @@ -0,0 +1,8 @@ +# Changesets + +Hello and welcome! This folder has been automatically generated by `@changesets/cli`, a build tool that works +with multi-package repos, or single-package repos to help you version and publish your code. You can +find the full documentation for it [in our repository](https://github.com/changesets/changesets) + +We have a quick list of common questions to get you started engaging with this project in +[our documentation](https://github.com/changesets/changesets/blob/main/docs/common-questions.md) diff --git a/.changeset/config.json b/.changeset/config.json new file mode 100644 index 000000000..43b72b358 --- /dev/null +++ b/.changeset/config.json @@ -0,0 +1,15 @@ +{ + "$schema": "https://unpkg.com/@changesets/config/schema.json", + "changelog": [ + "@svitejs/changesets-changelog-github-compact", + { + "repo": "vuejs/eslint-plugin-vue" + } + ], + "commit": false, + "linked": [], + "access": "public", + "baseBranch": "master", + "bumpVersionsWithWorkspaceProtocolOnly": true, + "ignore": [] +} diff --git a/.github/workflows/Release.yml b/.github/workflows/Release.yml new file mode 100644 index 000000000..5f9a8784e --- /dev/null +++ b/.github/workflows/Release.yml @@ -0,0 +1,33 @@ +name: Release + +on: + push: + branches: + - master + +jobs: + release: + # prevents this action from running on forks + if: github.repository == 'vuejs/eslint-plugin-vue' + permissions: + contents: write # to create release (changesets/action) + pull-requests: write # to create pull request (changesets/action) + name: Release + runs-on: ubuntu-latest + steps: + - name: Checkout Repo + uses: actions/checkout@v4 + - name: Setup Node.js + uses: actions/setup-node@v4 + - name: Install Dependencies + run: npm install -f + + - name: Create Release Pull Request or Publish to npm + id: changesets + uses: changesets/action@v1 + with: + version: npm run changeset:version + publish: npm run changeset:publish + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + NPM_TOKEN: ${{ secrets.NPM_TOKEN }} diff --git a/package.json b/package.json index 7e44aeb84..ff0a4b00a 100644 --- a/package.json +++ b/package.json @@ -18,12 +18,15 @@ "lint:fix": "eslint . --fix && markdownlint \"**/*.md\" --fix", "tsc": "tsc", "preversion": "npm test && git add .", - "version": "env-cmd -e version npm run update && npm run lint -- --fix && git add .", + "version": "npm run generate:version && git add .", "update": "node ./tools/update.js", "update-resources": "node ./tools/update-resources.js", "docs:watch": "vitepress dev docs", "predocs:build": "npm run update", - "docs:build": "vitepress build docs" + "docs:build": "vitepress build docs", + "generate:version": "env-cmd -e version npm run update && npm run lint -- --fix", + "changeset:version": "changeset version && npm run generate:version && git add --all", + "changeset:publish": "changeset publish" }, "files": [ "lib" @@ -66,8 +69,10 @@ "xml-name-validator": "^4.0.0" }, "devDependencies": { + "@changesets/cli": "^2.29.2", "@ota-meshi/site-kit-eslint-editor-vue": "^0.2.4", "@stylistic/eslint-plugin": "^2.12.1", + "@svitejs/changesets-changelog-github-compact": "^1.2.0", "@types/eslint": "^8.56.2", "@types/natural-compare": "^1.4.3", "@types/node": "^14.18.63", From db00d5f8e1a8f53d6286ff032426a2949ae45a77 Mon Sep 17 00:00:00 2001 From: yosuke ota Date: Thu, 1 May 2025 15:35:24 +0900 Subject: [PATCH 2/2] update workflow --- .github/workflows/Release.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/Release.yml b/.github/workflows/Release.yml index 5f9a8784e..260b73582 100644 --- a/.github/workflows/Release.yml +++ b/.github/workflows/Release.yml @@ -5,6 +5,8 @@ on: branches: - master +permissions: {} + jobs: release: # prevents this action from running on forks