-
Notifications
You must be signed in to change notification settings - Fork 4
122 lines (102 loc) · 3 KB
/
nodejs.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
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
name: Node CI
on:
pull_request:
branches:
- main
push:
tags:
- '*.*.*'
jobs:
build:
runs-on: windows-latest
strategy:
matrix:
node-version: [ '20' ]
steps:
- name: Checkout
uses: actions/[email protected]
- name: Setup NodeJS
uses: actions/[email protected]
with:
node-version: ${{ matrix.node-version }}
cache: npm
env:
NPM_AUTH_TOKEN: ${{ secrets.NPM_AUTH_TOKEN }}
- name: setup-msbuild
uses: microsoft/[email protected]
- name: Dependencies Install
run: npm ci
env:
CI: true
NPM_AUTH_TOKEN: ${{ secrets.NPM_AUTH_TOKEN }}
- name: Test
run: npm run test
env:
CI: true
NPM_AUTH_TOKEN: ${{ secrets.NPM_AUTH_TOKEN }}
- name: Codecov
if: matrix.node-version == '20'
uses: codecov/[email protected]
with:
fail_ci_if_error: true
publish:
runs-on: windows-latest
if: startsWith(github.ref, 'refs/tags/')
needs: build
strategy:
matrix:
node-version: [ '20' ]
steps:
- name: Checkout
uses: actions/[email protected]
- name: Setup Windows SDK
uses: GuillaumeFalourd/[email protected]
- name: Add signtool.exe path to PATH environment variable
uses: myci-actions/export-env-var-powershell@1
with:
name: PATH
value: $env:PATH;C:\Program Files (x86)\Windows Kits\10\bin\10.0.17763.0\x86\
- name: Setup NodeJS
uses: actions/[email protected]
with:
node-version: ${{ matrix.node-version }}
cache: npm
env:
NPM_AUTH_TOKEN: ${{ secrets.NPM_AUTH_TOKEN }}
- name: setup-msbuild
uses: microsoft/[email protected]
- name: Dependencies Install
run: npm ci
env:
CI: true
NPM_AUTH_TOKEN: ${{ secrets.NPM_AUTH_TOKEN }}
- name: Build
run: npm run build:no-test:ci
env:
CI: true
NPM_AUTH_TOKEN: ${{ secrets.NPM_AUTH_TOKEN }}
- name: Pre-Publish - install package globally
run: |
FOR /F "tokens=*" %%g IN ('node -e "console.log(require(""./package.json"").version)"') do (SET VERSION=%%g)
npm i -g create-windowless-app-%VERSION%.tgz
shell: cmd
env:
NPM_AUTH_TOKEN: ${{ secrets.NPM_AUTH_TOKEN }}
- name: Pre-Publish - test package globally
run: |
create-windowless-app pre-commit-test-app
cd pre-commit-test-app
npm run build
shell: cmd
env:
NPM_AUTH_TOKEN: ${{ secrets.NPM_AUTH_TOKEN }}
- name: Publish
run: npm publish
env:
NPM_AUTH_TOKEN: ${{ secrets.NPM_AUTH_TOKEN }}
- name: Release
uses: softprops/action-gh-release@v1
with:
files: create-windowless-app-*.tgz
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}