From d2c2ba56dfdd4188fb23845f53cae1d94dd8fdc8 Mon Sep 17 00:00:00 2001 From: mathuo <6710312+mathuo@users.noreply.github.com> Date: Sun, 22 Oct 2023 13:35:58 +0100 Subject: [PATCH] chore: configure publish action --- .github/workflows/experimental.yml | 45 ++++++++++++++++++++++++------ 1 file changed, 36 insertions(+), 9 deletions(-) diff --git a/.github/workflows/experimental.yml b/.github/workflows/experimental.yml index 5e6ec9aaf..f9186b2e4 100644 --- a/.github/workflows/experimental.yml +++ b/.github/workflows/experimental.yml @@ -1,16 +1,47 @@ name: Publish Experimental Package to npmjs env: - NPM_CONFIG_PROVENANCE: true + NPM_CONFIG_PROVENANCE: true on: workflow_dispatch: - # release: - # types: [published] + release: + types: [published] jobs: - build: + publish: + if: github.event_name == 'release' runs-on: ubuntu-latest + env: + NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} permissions: - id-token: write + id-token: write + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-node@v3 + with: + node-version: '18.x' + registry-url: 'https://registry.npmjs.org' + + - uses: actions/cache@v3 + with: + path: ~/.npm + key: ${{ runner.os }}-node-${{ hashFiles('**/yarn.lock') }} + restore-keys: | + ${{ runner.os }}-node- + + - run: yarn + - name: Publish dockview-core + run: npm publish --provenance + working-directory: packages/dockview-core + - name: Publish dockview + run: npm publish --provenance + working-directory: packages/dockview + publish-experimental: + if: github.event_name == 'workflow_dispatch' + runs-on: ubuntu-latest + env: + NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} + permissions: + id-token: write steps: - uses: actions/checkout@v4 - uses: actions/setup-node@v3 @@ -30,10 +61,6 @@ jobs: - name: Publish dockview-core run: npm publish --provenance --tag experimental working-directory: packages/dockview-core - env: - NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} - name: Publish dockview run: npm publish --provenance --tag experimental working-directory: packages/dockview - env: - NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}