-
Notifications
You must be signed in to change notification settings - Fork 69
55 lines (53 loc) · 1.76 KB
/
esbuild-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
name: esbuild Compilation & npm Publish Workflow
on:
workflow_run:
workflows:
- create-github-release
types:
- completed
workflow_dispatch:
inputs:
branch:
description: 'Set the branch to use for automation tests'
type: string
required: false
default: 'main'
nodeVersion:
description: version of node to use. It's better to specify latest, lts/* or lts/-1 than to hardode numbers
type: string
default: lts/*
required: false
jobs:
build:
runs-on: ubuntu-latest
if: ${{ inputs.branch || (github.event_name == 'workflow_run' && github.event.workflow_run.conclusion == 'success')}}
steps:
- uses: actions/checkout@v4
with:
ref: ${{ inputs.branch }}
- uses: actions/setup-node@v4
with:
node-version: ${{ inputs.nodeVersion }}
registry-url: 'https://registry.npmjs.org'
cache: yarn
- uses: salesforcecli/github-workflows/.github/actions/yarnInstallWithRetries@main
- name: Install esbuild Dependencies
run: |
yarn add -D esbuild@^0.19.5 esbuild-plugin-pino@^2.1.0 npm-dts@^1.3.12 esbuild-plugin-tsc@^0.4.0
- uses: salesforcecli/github-workflows/.github/actions/yarnInstallWithRetries@main
- name: Update for Bundling
run: |
node scripts/updateForBundling.js
- name: Generate Bundle
run: |
yarn build
node scripts/build.js
- name: Post Bundling Update
run: |
node scripts/postBundlingUpdate.js
- name: Publish a Package
run: |
npm config set //registry.npmjs.org/:_authToken=$NODE_AUTH_TOKEN
npm publish
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}