-
Notifications
You must be signed in to change notification settings - Fork 41
51 lines (48 loc) · 1.94 KB
/
release-wp-now.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
name: Release wp-now
on:
workflow_dispatch:
jobs:
release:
# Only run this workflow from the trunk branch and when it's triggered by dmsnell OR adamziel
if: >
github.ref == 'refs/heads/trunk' && (
github.actor == 'adamziel' ||
github.actor == 'dmsnell' ||
github.actor == 'bgrgicak' ||
github.actor == 'sejas' ||
github.actor == 'danielbachchuber'
)
# Specify runner + deployment step
runs-on: ubuntu-latest
environment:
name: npm
env:
NPM_TOKEN: ${{ secrets.NPM_AUTOMATION_TOKEN }}
steps:
- uses: actions/checkout@v3
with:
ref: ${{ github.event.pull_request.head.ref }}
clean: true
fetch-depth: 0
persist-credentials: false
- name: Setup SSH Keys
uses: webfactory/[email protected]
with:
ssh-private-key: ${{ secrets.GH_DEPLOY_KEY }}
- name: Config git user
run: |
git config --global user.name "deployment_bot"
git config --global user.email "[email protected]"
git remote set-url origin [email protected]:WordPress/playground-tools.git
- name: Authenticate with Registry
run: |
echo "@wp-now:registry=https://registry.npmjs.org/" >> ~/.npmrc
echo "registry=https://registry.npmjs.org/" >> ~/.npmrc
echo "//registry.npmjs.org/:_authToken=$NPM_TOKEN" >> ~/.npmrc
- uses: ./.github/actions/prepare-playground
# Version bump, release, tag a new version on GitHub
- name: Release new version of NPM packages
shell: bash
run: |
npm run build
npm run release:wp-now