From 30cc67a5ce6ff884b6450cccce90e90957e9f908 Mon Sep 17 00:00:00 2001 From: Olivier Lando Date: Thu, 5 May 2022 11:03:37 +0200 Subject: [PATCH] Add npm workspaces CI --- .../create-release-from-changelog.yml | 16 ++++++++++++++++ .github/workflows/release.yml | 18 ++++++++++++------ 2 files changed, 28 insertions(+), 6 deletions(-) create mode 100644 .github/workflows/create-release-from-changelog.yml diff --git a/.github/workflows/create-release-from-changelog.yml b/.github/workflows/create-release-from-changelog.yml new file mode 100644 index 0000000..216e67f --- /dev/null +++ b/.github/workflows/create-release-from-changelog.yml @@ -0,0 +1,16 @@ +name: Create draft release if needed +on: + push: + branches: + - main +jobs: + create-draft-release-if-needed: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - name: Create draft releases if needed + uses: apivideo/api.video-release-from-workspaces-changelogs-action@0.0.3 + with: + github-auth-token: ${{ secrets.GITHUB_TOKEN }} + package-name-suffix-to-ignore: "@" + \ No newline at end of file diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 51f4481..01c9b7f 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -1,17 +1,23 @@ -name: Release packages +name: Release package to npmjs on: release: types: [published] jobs: - deploy: + publish-npm-package: runs-on: ubuntu-latest steps: - uses: actions/checkout@v2 - uses: actions/setup-node@v2 with: registry-url: 'https://registry.npmjs.org' - - run: yarn - - name: Publish to npm - run: npm publish --workspace=packages/ui/react + - name: Retrieve the NPM workspace path + id: get-workspace-path + uses: apivideo/api.video-get-npm-workspace-path-from-release-action@0.0.4 + with: + github-auth-token: ${{ secrets.GITHUB_TOKEN }} + package-name-suffix-to-ignore: "@" + - run: yarn + - name: Publish workspace to NPM + run: npm publish --worspace ${{ steps.get-workspace-path.outputs.packagePath }} --access=public env: - NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} \ No newline at end of file + NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}