Skip to content

armgit / mocha

Public Imported from GitHub
0

☕️ Classic, reliable, trusted test framework for Node.js and the browser

ci: automate releases (#5186)

Pelle Wessmana777fd1587b6
diff --git a/.github/release-please/config.json b/.github/release-please/config.json
new file mode 100644
index 00000000..336265d4
--- /dev/null
+++ b/.github/release-please/config.json
@@ -0,0 +1,21 @@
+{
+ "$schema": "https://raw.githubusercontent.com/googleapis/release-please/v16.12.0/schemas/config.json",
+ "release-type": "node",
+ "include-component-in-tag": false,
+ "changelog-sections": [
+ { "type": "feat", "section": "🌟 Features", "hidden": false },
+ { "type": "fix", "section": "🩹 Fixes", "hidden": false },
+ { "type": "docs", "section": "📚 Documentation", "hidden": false },
+
+ { "type": "chore", "section": "🧹 Chores", "hidden": false },
+ { "type": "perf", "section": "🧹 Chores", "hidden": false },
+ { "type": "refactor", "section": "🧹 Chores", "hidden": false },
+ { "type": "test", "section": "🧹 Chores", "hidden": false },
+
+ { "type": "build", "section": "🤖 Automation", "hidden": false },
+ { "type": "ci", "section": "🤖 Automation", "hidden": true }
+ ],
+ "packages": {
+ ".": {}
+ }
+}
diff --git a/.github/release-please/manifest.json b/.github/release-please/manifest.json
new file mode 100644
index 00000000..fec78d6a
--- /dev/null
+++ b/.github/release-please/manifest.json
@@ -0,0 +1 @@
+{".":"10.7.0"}
diff --git a/.github/workflows/release-please.yml b/.github/workflows/release-please.yml
new file mode 100644
index 00000000..f4ab2854
--- /dev/null
+++ b/.github/workflows/release-please.yml
@@ -0,0 +1,49 @@
+name: Release Please
+
+on:
+ push:
+ branches:
+ - main
+
+permissions:
+ contents: read
+
+jobs:
+ release_please:
+ name: release-please
+ runs-on: ubuntu-latest
+ outputs:
+ releaseCreated: ${{ steps.release.outputs.release_created }}
+ permissions:
+ contents: write
+ pull-requests: write
+ steps:
+ - uses: googleapis/release-please-action@v4
+ id: release
+ with:
+ config-file: .github/release-please/config.json
+ manifest-file: .github/release-please/manifest.json
+
+ npm_publish:
+ name: Publish to npm
+ runs-on: ubuntu-latest
+ environment: npm
+ needs: release_please
+ if: needs.release_please.outputs.releaseCreated
+ permissions:
+ id-token: write
+ steps:
+ - uses: actions/checkout@v4
+ with:
+ show-progress: false
+ - uses: actions/setup-node@v4
+ with:
+ node-version: lts/*
+ registry-url: 'https://registry.npmjs.org'
+
+ - name: Install dependencies
+ run: npm ci --ignore-scripts --force --no-fund --no-audit
+
+ - run: npm publish --provenance --access public
+ env:
+ NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}