From 5fcbdf3b6fc7fdf52e1ccf90408f1fe122796b84 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nacho=20Cord=C3=B3n?= Date: Wed, 25 Oct 2023 08:57:44 +0100 Subject: [PATCH] Adds job to publish --- .github/workflows/ci.yaml | 1 + ...emirror.yaml => publish-npm-packages.yaml} | 21 +++++++++---------- package.json | 1 + 3 files changed, 12 insertions(+), 11 deletions(-) rename .github/workflows/{publish-cypher-codemirror.yaml => publish-npm-packages.yaml} (58%) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 520c3baa7..7f1c6886c 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -1,3 +1,4 @@ +name: Run Tests on: push: branches: diff --git a/.github/workflows/publish-cypher-codemirror.yaml b/.github/workflows/publish-npm-packages.yaml similarity index 58% rename from .github/workflows/publish-cypher-codemirror.yaml rename to .github/workflows/publish-npm-packages.yaml index d87f07ba9..25f63c084 100644 --- a/.github/workflows/publish-cypher-codemirror.yaml +++ b/.github/workflows/publish-npm-packages.yaml @@ -1,12 +1,10 @@ name: Publish react-codemirror package to npm on: - # Runs on pushes targeting the default branch - # push: - # branches: ['main'] - - # Allows you to run this workflow manually from the Actions tab - workflow_dispatch: + # Run the workflow on push only after the unit tests have passed + workflow_run: + workflows: ['Run Tests'] + branches: [] env: NODE_OPTIONS: '--max_old_space_size=4096' @@ -32,9 +30,10 @@ jobs: - name: Build project run: npm run build - - name: Publish on updated version number - uses: JS-DevTools/npm-publish@v2 + - name: Create Release Pull Request or Publish to npm + id: changesets + uses: changesets/action@v1 with: - token: ${{ secrets.NPM_TOKEN }} - package: 'packages/react-codemirror/package.json' - access: 'restricted' + publish: npm run release + # env: + # GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/package.json b/package.json index 07fa6322d..3f744b28c 100644 --- a/package.json +++ b/package.json @@ -15,6 +15,7 @@ "scripts": { "prepare": "husky install", "build": "turbo run build", + "release": "turbo run build && npx changeset publish", "clean": "turbo run clean", "watch": "turbo run watch", "test": "turbo run test",