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.
This commit is contained in:
Jon Thysell (JAUNTY) 2022-01-26 10:54:43 -08:00
Родитель 5318b8eab3
Коммит ce4ed60c9e
1 изменённых файлов: 18 добавлений и 29 удалений

47
.github/workflows/publish.yml поставляемый
Просмотреть файл

@ -9,8 +9,7 @@ on:
workflow_dispatch: workflow_dispatch:
jobs: jobs:
publish: run-codegen:
runs-on: windows-latest runs-on: windows-latest
steps: steps:
@ -18,15 +17,6 @@ jobs:
- uses: nuget/setup-nuget@v1 - uses: nuget/setup-nuget@v1
- name: setup-msbuild - name: setup-msbuild
uses: microsoft/setup-msbuild@v1 uses: microsoft/setup-msbuild@v1
- name: Use Node.js
uses: actions/setup-node@v1
with:
node-version: 16
registry-url: https://registry.npmjs.org/
- name: yarn install
run: yarn install
- name: NuGet restore - name: NuGet restore
run: nuget restore example\windows\example.sln run: nuget restore example\windows\example.sln
@ -41,29 +31,29 @@ jobs:
$changed = git status --porcelain=v1 $changed = git status --porcelain=v1
if ($changed -ne $null) { throw "CodeGen detected changes" } if ($changed -ne $null) { throw "CodeGen detected changes" }
publish-npm:
runs-on: ubuntu-latest
needs: run-codegen
steps:
- uses: actions/checkout@v2
- name: Use Node.js
uses: actions/setup-node@v1
with:
node-version: 16
registry-url: https://registry.npmjs.org/
- name: yarn install
run: yarn install
- name: build TS - name: build TS
run: yarn build run: yarn build
# - name: login - name: publish to npm
# run: npm login --verbose run: npm publish
# env:
# NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
# - name: whoami
# run: npm whoami --verbose
# env:
# NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
- name: config
run: npm config list --all
env: env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
working-directory: package
- uses: JS-DevTools/npm-publish@v1
with:
token: ${{ secrets.NPM_TOKEN }}
check-version: true
- name: upload node logs - name: upload node logs
uses: actions/upload-artifact@v2.3.1 uses: actions/upload-artifact@v2.3.1
@ -72,4 +62,3 @@ jobs:
path: C:\npm\cache\_logs path: C:\npm\cache\_logs
continue-on-error: true continue-on-error: true
if: always() if: always()