-
Notifications
You must be signed in to change notification settings - Fork 0
75 lines (68 loc) · 2.08 KB
/
Copy pathtypescript-release.yaml
File metadata and controls
75 lines (68 loc) · 2.08 KB
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
70
71
72
73
74
75
name: TypeScript Release
on:
push:
tags:
- "ts-v*"
permissions:
contents: read
defaults:
run:
working-directory: reference/typescript
jobs:
test:
name: Test
runs-on: ubuntu-latest
strategy:
matrix:
node-version: ["20", "22"]
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0
with:
node-version: ${{ matrix.node-version }}
- run: npm ci
- run: npx vitest run
conformance:
name: Conformance
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0
with:
node-version: "22"
- run: npm ci
- run: npx vitest run __tests__/conformance.test.ts
build:
name: Build Package
runs-on: ubuntu-latest
needs: [test, conformance]
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0
with:
node-version: "22"
registry-url: "https://registry.npmjs.org"
- run: npm ci
- run: npx tsc
publish:
name: Publish to npm
runs-on: ubuntu-latest
needs: build
permissions:
id-token: write
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0
with:
node-version: "22"
registry-url: "https://registry.npmjs.org"
- run: npm ci
- run: npx tsc
- name: Extract version from tag
id: version
run: echo "VERSION=${GITHUB_REF#refs/tags/ts-v}" >> $GITHUB_OUTPUT
- name: Set package version
run: npm version ${{ steps.version.outputs.VERSION }} --no-git-tag-version
- run: npm publish --provenance --access public
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}