forked from google/earthengine-api
-
Notifications
You must be signed in to change notification settings - Fork 2
51 lines (49 loc) · 1.43 KB
/
publish-to-npm.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: Publish to NPM
on:
release:
types: [published]
# Enables running this workflow manually from the Actions tab.
workflow_dispatch:
jobs:
smoke-test:
if: "!github.event.release.prerelease" # Only run if not a prerelease.
runs-on: ubuntu-latest
permissions:
id-token: write
steps:
- uses: actions/checkout@v4
- name: Authenticate with Google Cloud
id: "auth"
uses: 'google-github-actions/auth@v2'
with:
service_account: ${{ secrets.SERVICE_ACCOUNT }}
workload_identity_provider: ${{ secrets.WORKLOAD_IDENTITY_PROVIDER }}
token_format: "access_token"
- uses: actions/setup-node@v4
with:
node-version: 16
registry-url: https://registry.npmjs.org/
- run: |
cd javascript/
npm install
npm run build
npm run test
env:
EE_ACCESS_TOKEN: ${{ steps.auth.outputs.access_token }}
publish-npm:
if: "!github.event.release.prerelease" # Only run if not a prerelease.
needs: smoke-test
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 16
registry-url: https://registry.npmjs.org/
- run: |
cd javascript/
npm install
npm run build
npm publish
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_API_TOKEN }}