From e10c5097547b66c9b587b6e67f0d601669fa71b1 Mon Sep 17 00:00:00 2001 From: David Sanders Date: Mon, 16 Dec 2024 17:32:33 -0800 Subject: [PATCH 1/2] ci: switch to GHA --- .circleci/config.yml | 35 ----------------------------- .github/workflows/release.yml | 35 +++++++++++++++++++++++++++++ .github/workflows/test.yml | 42 +++++++++++++++++++++++++++++++++++ README.md | 2 +- package.json | 5 ++++- 5 files changed, 82 insertions(+), 37 deletions(-) delete mode 100644 .circleci/config.yml create mode 100644 .github/workflows/release.yml create mode 100644 .github/workflows/test.yml diff --git a/.circleci/config.yml b/.circleci/config.yml deleted file mode 100644 index aed1659..0000000 --- a/.circleci/config.yml +++ /dev/null @@ -1,35 +0,0 @@ -version: 2.1 - -orbs: - cfa: continuousauth/npm@2.1.1 - node: electronjs/node@2.3.1 - -workflows: - test_and_release: - # Run the test jobs first, then the release only when all the test jobs are successful - jobs: - - node/test: - name: test-<< matrix.executor >>-<< matrix.node-version >> - test-steps: - - run: yarn prettier:check - - run: yarn build - - run: yarn test - use-test-steps: true - matrix: - alias: test - parameters: - executor: - - node/linux - - node/macos - - node/windows - node-version: - - '22.9' - - '20.11' - - cfa/release: - requires: - - test - filters: - branches: - only: - - main - context: cfa-release diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..a4b607d --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,35 @@ +name: Release + +on: + push: + branches: + - main + +jobs: + test: + uses: ./.github/workflows/test.yml + + release: + name: Release + runs-on: ubuntu-latest + needs: test + environment: npm + permissions: + id-token: write # for CFA and npm provenance + steps: + - name: Checkout + uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 + with: + persist-credentials: false + - name: Setup Node.js + uses: actions/setup-node@39370e3970a6d050c480ffad4ff0ed4d3fdee5af # v4.1.0 + with: + node-version: 20.x + cache: 'yarn' + - name: Install + run: yarn install --frozen-lockfile + - uses: continuousauth/action@4e8a2573eeb706f6d7300d6a9f3ca6322740b72d # v1.0.5 + with: + project-id: ${{ secrets.CFA_PROJECT_ID }} + secret: ${{ secrets.CFA_SECRET }} + npm-token: ${{ secrets.NPM_TOKEN }} diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml new file mode 100644 index 0000000..86ed648 --- /dev/null +++ b/.github/workflows/test.yml @@ -0,0 +1,42 @@ +name: Test + +on: + pull_request: + branches: + - main + schedule: + - cron: '0 22 * * 3' + workflow_call: + +permissions: + contents: read + +jobs: + test: + name: Test + strategy: + matrix: + node-version: + - '22.9' + - '20.11' + os: + - macos-latest + - ubuntu-latest + - windows-latest + runs-on: "${{ matrix.os }}" + steps: + - name: Checkout + uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 + - name: Setup Node.js + uses: actions/setup-node@39370e3970a6d050c480ffad4ff0ed4d3fdee5af # v4.1.0 + with: + node-version: "${{ matrix.node-version }}" + cache: 'yarn' + - name: Install + run: yarn install --frozen-lockfile + - name: Prettier + run: yarn prettier:check + - name: Build + run: yarn build + - name: Test + run: yarn test diff --git a/README.md b/README.md index 6bf83a5..3ae6151 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # Electron Docs Parser -[![CircleCI build status](https://circleci.com/gh/electron/docs-parser/tree/main.svg?style=shield)](https://circleci.com/gh/electron/docs-parser/tree/main) +[![Test](https://github.com/electron/docs-parser/actions/workflows/test.yml/badge.svg)](https://github.com/electron/docs-parser/actions/workflows/test.yml) [![npm version](http://img.shields.io/npm/v/@electron/docs-parser.svg)](https://npmjs.org/package/@electron/docs-parser) > Generate a structured JSON API file from Electron's free-form documentation diff --git a/package.json b/package.json index 48257dc..bb64ad7 100644 --- a/package.json +++ b/package.json @@ -9,6 +9,9 @@ "engines": { "node": "^20.11.0 || >= 21.2.0" }, + "publishConfig": { + "provenance": true + }, "scripts": { "build": "tsc", "prepublishOnly": "npx yarn build", @@ -68,4 +71,4 @@ "url": "https://github.com/electron/docs-parser/issues" }, "homepage": "https://github.com/electron/docs-parser#readme" -} +} \ No newline at end of file From 8ac722a9ac9ee839117efd478f9d8263b8dc3d6c Mon Sep 17 00:00:00 2001 From: David Sanders Date: Thu, 19 Dec 2024 11:38:33 -0800 Subject: [PATCH 2/2] Update package.json Co-authored-by: Erick Zhao --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index bb64ad7..23880a7 100644 --- a/package.json +++ b/package.json @@ -71,4 +71,4 @@ "url": "https://github.com/electron/docs-parser/issues" }, "homepage": "https://github.com/electron/docs-parser#readme" -} \ No newline at end of file +}