-
Notifications
You must be signed in to change notification settings - Fork 622
69 lines (55 loc) · 2.12 KB
/
publish.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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
# This workflow handles releasing all of the packages in samples.
name: publish
on:
workflow_dispatch: # Manually trigger. Colon is required.
schedule:
- cron: '5 17 * * 4' # Thursdays at 17:05 UTC (09:05 PST / 10:05 PDT)
permissions:
contents: write # For checkout and tag.
packages: write # For publish.
jobs:
publish:
runs-on: ubuntu-latest
# Don't try to publish from a fork of google/blockly-samples.
if: ${{ github.repository_owner == 'google' }}
# Environment specific to releasing so we can isolate the npm token.
environment: release
steps:
- name: Checkout
uses: actions/checkout@v3
# fetch all tags and commits so that lerna can version appropriately
with:
fetch-depth: 0
ref: 'master'
# This uses a reverse-engineered email for the github actions bot. See
# https://github.com/actions/checkout/issues/13#issuecomment-724415212
- name: Git Identity
run: |
git config --global user.name 'github-actions[bot]'
git config --global user.email '<41898282+github-actions[bot]@users.noreply.github.com'
- name: Setup Node
uses: actions/setup-node@v3
with:
node-version: 20
- name: Configure npm
run: npm config set //wombat-dressing-room.appspot.com/:_authToken=$NODE_AUTH_TOKEN
env:
NODE_AUTH_TOKEN: ${{ secrets.RELEASE_BACKED_NPM_TOKEN }}
- name: NPM install
# Use CI so that we don't update dependencies in this step.
run: npm ci
- name: Build
run: npm run build
- name: Test
run: npm run test
- name: Publish
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: cd plugins && npx lerna publish --no-private --conventional-commits --create-release github --yes
update-gh-pages:
name: Update GitHub Pages
# Call the Update gh-pages workflow only if publishing succeeds
needs: [publish]
# Don't try to auto-update if on a fork of google/blockly-samples.
if: ${{ github.repository_owner == 'google' }}
uses: ./.github/workflows/update_gh_pages.yml