From 847e8afd5940257a32dd33cd779afcbef43deb94 Mon Sep 17 00:00:00 2001 From: "Nicholas C. Zakas" Date: Tue, 16 Jul 2024 13:00:48 -0400 Subject: [PATCH] build: Update release-please (#258) * build: Update release-please * Fix lint errors --- .github/workflows/release-please.yml | 16 +++------------- .release-please-manifest.json | 3 +++ lib/index.js | 5 ++--- lib/processor.js | 5 ++--- release-please-config.json | 12 ++++++++++++ 5 files changed, 22 insertions(+), 19 deletions(-) create mode 100644 .release-please-manifest.json create mode 100644 release-please-config.json diff --git a/.github/workflows/release-please.yml b/.github/workflows/release-please.yml index 5f7df7bb..6bc1f651 100644 --- a/.github/workflows/release-please.yml +++ b/.github/workflows/release-please.yml @@ -11,18 +11,8 @@ jobs: pull-requests: write id-token: write steps: - - uses: google-github-actions/release-please-action@v3 + - uses: googleapis/release-please-action@v4 id: release - with: - release-type: node - package-name: 'eslint-plugin-markdown' - pull-request-title-pattern: 'chore: release ${version}' - changelog-types: > - [ - { "type": "feat", "section": "Features", "hidden": false }, - { "type": "fix", "section": "Bug Fixes", "hidden": false }, - { "type": "perf", "section": "Performance Improvements", "hidden": false } - ] - uses: actions/checkout@v4 if: ${{ steps.release.outputs.release_created }} - uses: actions/setup-node@v4 @@ -34,14 +24,14 @@ jobs: env: NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} if: ${{ steps.release.outputs.release_created }} - - run: 'npx @humanwhocodes/tweet "eslint-plugin-markdown ${{ steps.release.outputs.tag_name }} has been released: ${{ steps.release.outputs.html_url }}"' + - run: 'npx @humanwhocodes/tweet "eslint-plugin-markdown v${{ steps.release.outputs.major }}.${{ steps.release.outputs.minor }}.${{ steps.release.outputs.patch }} has been released: ${{ steps.release.outputs.html_url }}"' if: ${{ steps.release.outputs.release_created }} env: TWITTER_CONSUMER_KEY: ${{ secrets.TWITTER_CONSUMER_KEY }} TWITTER_CONSUMER_SECRET: ${{ secrets.TWITTER_CONSUMER_SECRET }} TWITTER_ACCESS_TOKEN_KEY: ${{ secrets.TWITTER_ACCESS_TOKEN_KEY }} TWITTER_ACCESS_TOKEN_SECRET: ${{ secrets.TWITTER_ACCESS_TOKEN_SECRET }} - - run: 'npx @humanwhocodes/toot "eslint-plugin-markdown ${{ steps.release.outputs.tag_name }} has been released: ${{ steps.release.outputs.html_url }}"' + - run: 'npx @humanwhocodes/toot "eslint-plugin-markdown v${{ steps.release.outputs.major }}.${{ steps.release.outputs.minor }}.${{ steps.release.outputs.patch }} has been released: ${{ steps.release.outputs.html_url }}"' if: ${{ steps.release.outputs.release_created }} env: MASTODON_ACCESS_TOKEN: ${{ secrets.MASTODON_ACCESS_TOKEN }} diff --git a/.release-please-manifest.json b/.release-please-manifest.json new file mode 100644 index 00000000..affd1ab3 --- /dev/null +++ b/.release-please-manifest.json @@ -0,0 +1,3 @@ +{ + ".": "5.1.0" +} diff --git a/lib/index.js b/lib/index.js index 992db15e..b210d72d 100644 --- a/lib/index.js +++ b/lib/index.js @@ -6,7 +6,6 @@ "use strict"; const processor = require("./processor"); -const pkg = require("../package.json"); const rulesConfig = { @@ -33,8 +32,8 @@ const rulesConfig = { const plugin = { meta: { - name: pkg.name, - version: pkg.version + name: "eslint-plugin-markdown", + version: "5.1.0" // x-release-please-version }, processors: { markdown: processor diff --git a/lib/processor.js b/lib/processor.js index b4ff61d6..93f56ada 100644 --- a/lib/processor.js +++ b/lib/processor.js @@ -28,7 +28,6 @@ "use strict"; const parse = require("mdast-util-from-markdown"); -const pkg = require("../package.json"); const UNSATISFIABLE_RULES = new Set([ "eol-last", // The Markdown parser strips trailing newlines in code fences @@ -412,8 +411,8 @@ function postprocess(messages, filename) { module.exports = { meta: { - name: `${pkg.name}/markdown`, - version: pkg.version + name: "eslint-plugin-markdown/markdown", + version: "5.1.0" // x-release-please-version }, preprocess, postprocess, diff --git a/release-please-config.json b/release-please-config.json new file mode 100644 index 00000000..829aeaf7 --- /dev/null +++ b/release-please-config.json @@ -0,0 +1,12 @@ +{ + "packages": { + ".": { + "release-type": "node", + "pull-request-title-pattern": "chore: release ${version} 🚀", + "extra-files": [ + "lib/index.js", + "lib/processor.js" + ] + } + } +}