Skip to content

Commit ce4ed60

Browse files
committed
Update publish workflow to build on Windows, publish on Ubuntu
This PR attempts to separate the publihs process into two steps, the first part verifying the codegen is up to date (on Windows), the second part doing the actual yarn build and publish on ubuntu.
1 parent 5318b8e commit ce4ed60

File tree

1 file changed

+18
-29
lines changed

1 file changed

+18
-29
lines changed

.github/workflows/publish.yml

Lines changed: 18 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -9,24 +9,14 @@ on:
99
workflow_dispatch:
1010

1111
jobs:
12-
publish:
13-
12+
run-codegen:
1413
runs-on: windows-latest
1514

1615
steps:
1716
- uses: actions/checkout@v2
1817
- uses: nuget/setup-nuget@v1
1918
- name: setup-msbuild
2019
uses: microsoft/setup-msbuild@v1
21-
- name: Use Node.js
22-
uses: actions/setup-node@v1
23-
with:
24-
node-version: 16
25-
registry-url: https://registry.npmjs.org/
26-
27-
28-
- name: yarn install
29-
run: yarn install
3020

3121
- name: NuGet restore
3222
run: nuget restore example\windows\example.sln
@@ -41,29 +31,29 @@ jobs:
4131
$changed = git status --porcelain=v1
4232
if ($changed -ne $null) { throw "CodeGen detected changes" }
4333
34+
publish-npm:
35+
runs-on: ubuntu-latest
36+
needs: run-codegen
37+
38+
steps:
39+
- uses: actions/checkout@v2
40+
- name: Use Node.js
41+
uses: actions/setup-node@v1
42+
with:
43+
node-version: 16
44+
registry-url: https://registry.npmjs.org/
45+
46+
- name: yarn install
47+
run: yarn install
4448

4549
- name: build TS
4650
run: yarn build
4751

48-
# - name: login
49-
# run: npm login --verbose
50-
# env:
51-
# NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
52-
53-
# - name: whoami
54-
# run: npm whoami --verbose
55-
# env:
56-
# NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
57-
58-
- name: config
59-
run: npm config list --all
52+
- name: publish to npm
53+
run: npm publish
6054
env:
6155
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
62-
63-
- uses: JS-DevTools/npm-publish@v1
64-
with:
65-
token: ${{ secrets.NPM_TOKEN }}
66-
check-version: true
56+
working-directory: package
6757

6858
- name: upload node logs
6959
uses: actions/[email protected]
@@ -72,4 +62,3 @@ jobs:
7262
path: C:\npm\cache\_logs
7363
continue-on-error: true
7464
if: always()
75-

0 commit comments

Comments
 (0)