-
Notifications
You must be signed in to change notification settings - Fork 0
97 lines (89 loc) · 2.58 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
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
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
name: Release CI
on:
release:
types:
- created
env:
CI: true
GITHUB_BRANCH: ${{ github.ref }}
GITHUB_HEAD_REF: ${{ github.head_ref }}
GITHUB_BASE_REF: ${{ github.base_ref }}
GITHUB_COMMIT: ${{ github.sha }}
jobs:
build:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest]
node-version: [18.x]
steps:
- uses: actions/checkout@v4.1.1
with:
ref: ${{ github.event.release.target_commitish }}
submodules: recursive
- name: Use Node.js ${{ matrix.node-version }} on ${{ matrix.os }}
uses: actions/setup-node@v4.0.0
with:
node-version: ${{ matrix.node-version }}
registry-url: 'https://registry.npmjs.org/'
- name: nodejs project information
id: projectinfo
uses: gregoranders/nodejs-project-info@master
- name: npm install
run: |
npm install
- name: npm test
run: |
npm test
- name: npm run build
run: |
npm run build
- name: upload index.js
id: uploadmain
uses: gregoranders/nodejs-upload-asset@master
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
id: ${{ steps.createrelease.outputs.id }}
path: dist/index.js
name: index.js
- name: upload index.d.ts
id: uploadtype
uses: gregoranders/nodejs-upload-asset@master
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
id: ${{ steps.createrelease.outputs.id }}
path: dist/index.d.ts
name: index.d.ts
# publish-gpr:
# needs: build
# runs-on: ${{ matrix.os }}
# strategy:
# matrix:
# os: [ubuntu-latest]
# node-version: [16.x]
# steps:
# - uses: actions/checkout@v4.1.1
# - name: Use Node.js ${{ matrix.node-version }} on ${{ matrix.os }}
# uses: actions/setup-node@v3.5.1
# with:
# node-version: ${{ matrix.node-version }}
# - run: npm init -y --scope ${{ github.repository_owner }}
# - name: npm install
# run: |
# npm install
# - name: npm test
# run: |
# npm test
# - name: npm run build
# run: |
# npm run build
# - uses: actions/setup-node@v3.5.1
# with:
# node-version: ${{ matrix.node-version }}
# registry-url: https://npm.pkg.github.com/
# # scope: '@gregoranders/ts-playground'
# - run: npm publish
# env:
# NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }}