-
Notifications
You must be signed in to change notification settings - Fork 74
56 lines (53 loc) · 1.52 KB
/
publish_web-features.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
name: Publish web-features
on:
push:
# Tags on the form v1.2.3 are for releases. Any other tags are ignored.
tags:
- 'v[0-9]+.[0-9]+.[0-9]+'
env:
package_dir: "packages/web-features"
jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version-file: .node-version
cache: npm
- run: npm ci
- run: npm test
artifacts:
if: github.repository == 'web-platform-dx/web-features'
runs-on: ubuntu-latest
needs: "test"
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version-file: .node-version
cache: npm
registry-url: "https://registry.npmjs.org"
- run: npm ci
- run: npm run build
- run: npm run build:extended
- run: gh release upload ${{ github.ref_name }} packages/web-features/data.json schemas/data.schema.json data.extended.json
env:
GH_TOKEN: ${{ github.token }}
publish:
if: github.repository == 'web-platform-dx/web-features'
runs-on: ubuntu-latest
needs: "test"
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version-file: .node-version
cache: npm
registry-url: "https://registry.npmjs.org"
- run: npm ci
- run: npm run build
- run: npm publish
working-directory: ${{ env.package_dir }}
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}