From d7c77dc1409ce8c58325c831d38184e0685bb3c9 Mon Sep 17 00:00:00 2001 From: Grzegorz Ziolkowski Date: Wed, 9 Mar 2022 12:25:55 +0100 Subject: [PATCH] Set test npm publishing workflow to trigger when Gutenberg RC1 is out --- .github/workflows/static-checks.yml | 35 ------------------- .../upload-release-to-plugin-repo.yml | 26 +++++++++----- 2 files changed, 17 insertions(+), 44 deletions(-) diff --git a/.github/workflows/static-checks.yml b/.github/workflows/static-checks.yml index 6a43ff4e18b93..299c3656a25ed 100644 --- a/.github/workflows/static-checks.yml +++ b/.github/workflows/static-checks.yml @@ -16,41 +16,6 @@ concurrency: cancel-in-progress: true jobs: - test-npm-publish: - name: Publish WordPress packages to npm (Work In Progress) - runs-on: ubuntu-latest - steps: - - name: Checkout (for CLI) - uses: actions/checkout@5a4ac9002d0be2fb38bd78e4b4dbde5606d7042f # v2.3.4 - with: - path: main - - - name: Checkout (for publishing) - uses: actions/checkout@5a4ac9002d0be2fb38bd78e4b4dbde5606d7042f # v2.3.4 - with: - path: publish - ref: trunk - token: ${{ secrets.GUTENBERG_TOKEN }} - - - name: Configure git user name and email (for publishing) - run: | - cd publish - git config user.name "Gutenberg Repository Automation" - git config user.email gutenberg@wordpress.org - - - name: Setup Node - uses: actions/setup-node@38d90ce44d5275ad62cc48384b3d8a58c500bb5f # v2.2.2 - with: - node-version: 14 - registry-url: 'https://registry.npmjs.org' - - - name: Publish packages to npm - run: | - cd main - npm ci - ./bin/plugin/cli.js npm-next --ci --repository-path ../publish - env: - NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} check: name: All runs-on: ubuntu-latest diff --git a/.github/workflows/upload-release-to-plugin-repo.yml b/.github/workflows/upload-release-to-plugin-repo.yml index 3248803a1cb4a..4b7863368eb9b 100644 --- a/.github/workflows/upload-release-to-plugin-repo.yml +++ b/.github/workflows/upload-release-to-plugin-repo.yml @@ -95,18 +95,27 @@ jobs: path: ./changelog.txt npm-publish: - name: Publish WordPress packages to npm (Work In Progress) + name: Publish WordPress packages to npm runs-on: ubuntu-latest needs: update-changelog if: ${{ github.event.release.prerelease && endsWith( github.event.release.tag_name, '-rc.1' ) && github.event.release.assets[0] }} steps: - - name: Checkout + - name: Checkout (for CLI) uses: actions/checkout@5a4ac9002d0be2fb38bd78e4b4dbde5606d7042f # v2.3.4 with: + path: main + ref: trunk + + - name: Checkout (for publishing) + uses: actions/checkout@5a4ac9002d0be2fb38bd78e4b4dbde5606d7042f # v2.3.4 + with: + path: publish + ref: trunk token: ${{ secrets.GUTENBERG_TOKEN }} - - name: Configure git user name and email + - name: Configure git user name and email (for publishing) run: | + cd publish git config user.name "Gutenberg Repository Automation" git config user.email gutenberg@wordpress.org @@ -114,14 +123,13 @@ jobs: uses: actions/setup-node@38d90ce44d5275ad62cc48384b3d8a58c500bb5f # v2.2.2 with: node-version: 14 - cache: npm registry-url: 'https://registry.npmjs.org' - - name: Install dependencies - run: npm ci - - - name: Publish packages to npm - run: npm whoami + - name: Publish packages to npm ("next" dist-tag) + run: | + cd main + npm ci + ./bin/plugin/cli.js npm-next --semver minor --ci --repository-path ../publish env: NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}