NPM Publish #67
Workflow file for this run
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: NPM Publish | |
on: | |
release: | |
types: [published] | |
jobs: | |
platform_release: | |
defaults: | |
run: | |
working-directory: client | |
name: Build all packages for multiple platforms | |
runs-on: ${{ matrix.config.os }} | |
strategy: | |
matrix: | |
config: | |
- os: windows-latest | |
- os: macos-latest | |
- os: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2 | |
with: | |
# "ref" specifies the branch to check out. | |
# "github.event.release.target_commitish" is a global variable and specifies the branch the release targeted | |
ref: ${{ github.event.release.target_commitish }} | |
- name: Use Node 16 | |
uses: actions/setup-node@v3 | |
with: | |
node-version: '16.14.2' | |
# Specifies the registry, this field is required! | |
registry-url: https://registry.npmjs.org/ | |
- run: yarn install --frozen-lockfile | |
- run: git config --global user.name "GitHub Bot" | |
- run: git config --global user.email "[email protected]" | |
- run: yarn lint | |
- name: Unit tests | |
run: yarn test | |
if: ${{ matrix.config.os != 'windows-latest' }} | |
- run: yarn build:lib | |
if: ${{ matrix.config.os == 'ubuntu-latest' }} | |
- run: yarn build:cli | |
if: ${{ matrix.config.os == 'ubuntu-latest' }} | |
- run: chmod +x bin/platform/desktop/backend/cli.js | |
if: ${{ matrix.config.os == 'ubuntu-latest' }} | |
- run: yarn build:electron | |
# push the version changes to GitHub | |
- name: Upload Release Asset | |
uses: alexellis/[email protected] | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
asset_paths: '["./client/dist_electron/DIVE-Desktop*"]' | |
- name: Publish to NPM | |
run: yarn publish --new-version ${{ github.event.release.tag_name }} | |
if: ${{ matrix.config.os == 'ubuntu-latest' }} | |
continue-on-error: true | |
env: | |
# Use a token to publish to NPM. Must configure this! | |
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} | |
docs: | |
name: Deploy docs | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2 | |
with: | |
# "ref" specifies the branch to check out. | |
# "github.event.release.target_commitish" is a global variable and specifies the branch the release targeted | |
ref: ${{ github.event.release.target_commitish }} | |
# Deploy docs | |
- name: Deploy docs | |
uses: mhausenblas/mkdocs-deploy-gh-pages@master | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
CONFIG_FILE: mkdocs.yml | |
EXTRA_PACKAGES: build-base |