-
Notifications
You must be signed in to change notification settings - Fork 146
44 lines (37 loc) · 1.12 KB
/
release.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
name: Release
on:
workflow_dispatch:
inputs:
version:
description: 'npm version. Examples: "2.0.0", "2.0.0-beta.0". To deploy an experimental version, type "experimental".'
default: 'experimental'
required: true
dry-run:
description: 'Only create a tarball, do not publish to npm or create a release on GitHub.'
default: true
type: boolean
required: true
jobs:
test:
uses: ./.github/workflows/_test.yml
release:
runs-on: ubuntu-latest
needs: test
steps:
- name: Git checkout
uses: actions/checkout@v3
- name: Use Node.js
uses: actions/setup-node@v3
with:
node-version: 20
- run: npm ci
- run: ./scripts/release.js --version ${{ github.event.inputs.version }} ${{ github.event.inputs.dry-run == 'true' && '--dry-run' || '' }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
- name: Archive npm package tarball
uses: actions/upload-artifact@v3
with:
name: npm
path: |
*.tgz