Skip to content

Commit

Permalink
Set test npm publishing workflow to trigger when Gutenberg RC1 is out
Browse files Browse the repository at this point in the history
  • Loading branch information
gziolo committed Mar 9, 2022
1 parent f74fdf3 commit d7c77dc
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 44 deletions.
35 changes: 0 additions & 35 deletions .github/workflows/static-checks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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 [email protected]
- 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
Expand Down
26 changes: 17 additions & 9 deletions .github/workflows/upload-release-to-plugin-repo.yml
Original file line number Diff line number Diff line change
Expand Up @@ -95,33 +95,41 @@ 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 [email protected]
- name: Setup Node
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 }}

Expand Down

0 comments on commit d7c77dc

Please sign in to comment.