Deploy typings #72
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Deploy typings | |
on: | |
push: | |
branches: | |
- dev | |
- rc | |
- release | |
paths: | |
- types | |
workflow_dispatch: | |
jobs: | |
deploy-typings: | |
name: Deploy typings | |
runs-on: ubuntu-20.04 | |
steps: | |
- name: Set up Node.js | |
uses: actions/setup-node@v3 | |
with: | |
node-version: 18.x | |
- name: Checkout repository | |
uses: actions/checkout@v3 | |
- name: Check package version | |
id: versions | |
working-directory: ./types | |
run: | | |
cd shared | |
echo "SHARED_LOCAL=$(node -p -e "require('./package.json').version")" >> $GITHUB_OUTPUT | |
echo "SHARED_REMOTE=$(yarn info -s $(node -p -e "require('./package.json').name") version)" >> $GITHUB_OUTPUT | |
cd ../client | |
echo "CLIENT_LOCAL=$(node -p -e "require('./package.json').version")" >> $GITHUB_OUTPUT | |
echo "CLIENT_REMOTE=$(yarn info -s $(node -p -e "require('./package.json').name") version)" >> $GITHUB_OUTPUT | |
cd ../server | |
echo "SERVER_LOCAL=$(node -p -e "require('./package.json').version")" >> $GITHUB_OUTPUT | |
echo "SERVER_REMOTE=$(yarn info -s $(node -p -e "require('./package.json').name") version)" >> $GITHUB_OUTPUT | |
cd ../natives | |
echo "NATIVES_LOCAL=$(node -p -e "require('./package.json').version")" >> $GITHUB_OUTPUT | |
echo "NATIVES_REMOTE=$(yarn info -s $(node -p -e "require('./package.json').name") version)" >> $GITHUB_OUTPUT | |
cd ../webview | |
echo "WEBVIEW_LOCAL=$(node -p -e "require('./package.json').version")" >> $GITHUB_OUTPUT | |
echo "WEBVIEW_REMOTE=$(yarn info -s $(node -p -e "require('./package.json').name") version)" >> $GITHUB_OUTPUT | |
- name: Publish shared package | |
if: ${{ steps.versions.outputs.SHARED_LOCAL != steps.versions.outputs.SHARED_REMOTE }} | |
uses: JS-DevTools/npm-publish@v1 | |
with: | |
token: ${{ secrets.NPM_AUTH_TOKEN }} | |
package: ./types/shared/package.json | |
access: public | |
- name: Publish client package | |
if: ${{ steps.versions.outputs.CLIENT_LOCAL != steps.versions.outputs.CLIENT_REMOTE }} | |
uses: JS-DevTools/npm-publish@v1 | |
with: | |
token: ${{ secrets.NPM_AUTH_TOKEN }} | |
package: ./types/client/package.json | |
access: public | |
- name: Publish server package | |
if: ${{ steps.versions.outputs.SERVER_LOCAL != steps.versions.outputs.SERVER_REMOTE }} | |
uses: JS-DevTools/npm-publish@v1 | |
with: | |
token: ${{ secrets.NPM_AUTH_TOKEN }} | |
package: ./types/server/package.json | |
access: public | |
- name: Publish natives package | |
if: ${{ steps.versions.outputs.NATIVES_LOCAL != steps.versions.outputs.NATIVES_REMOTE }} | |
uses: JS-DevTools/npm-publish@v1 | |
with: | |
token: ${{ secrets.NPM_AUTH_TOKEN }} | |
package: ./types/natives/package.json | |
access: public | |
- name: Publish webview package | |
if: ${{ steps.versions.outputs.WEBVIEW_LOCAL != steps.versions.outputs.WEBVIEW_REMOTE }} | |
uses: JS-DevTools/npm-publish@v1 | |
with: | |
token: ${{ secrets.NPM_AUTH_TOKEN }} | |
package: ./types/webview/package.json | |
access: public |