Move rimraf dependency from prod to dev #271
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
# inspired from https://github.com/eclipse-theia/theia-cpp-extensions/raw/master/.github/workflows/ci-cd.yml | |
# and https://github.com/eclipse-cdt-cloud/theia-trace-extension/raw/master/.github/workflows/build.yml | |
name: CI-CD | |
on: | |
push: | |
branches: | |
- master | |
pull_request: | |
branches: | |
- master | |
workflow_dispatch: | |
jobs: | |
build: | |
runs-on: ${{ matrix.os }} | |
strategy: | |
fail-fast: false | |
matrix: | |
os: [ubuntu-20.04] | |
node: [16.x] | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v2 | |
with: | |
persist-credentials: false | |
- name: Use Node.js ${{ matrix.node }} | |
uses: actions/setup-node@v3 | |
with: | |
node-version: ${{ matrix.node }} | |
- name: Build | |
shell: bash | |
# Note: `yarn build` is done as part of `yarn install` already. | |
run: | | |
yarn install --no-lockfile | |
env: | |
NODE_OPTIONS: --max_old_space_size=4096 | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # https://github.com/microsoft/vscode-ripgrep/issues/9 | |
- name: Test | |
shell: bash | |
run: | | |
yarn test | |
publish: | |
needs: build | |
if: github.ref == 'refs/heads/master' && github.event_name == 'push' && github.repository == 'eclipse-cdt-cloud/tsp-typescript-client' | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
node: [16.x] | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v2 | |
with: | |
persist-credentials: false | |
- name: Use Node.js ${{ matrix.node }} | |
uses: actions/setup-node@v3 | |
with: | |
node-version: ${{ matrix.node }} | |
registry-url: 'https://registry.npmjs.org' | |
- name: Pre-Publish | |
shell: bash | |
# Note: `yarn build` is done as part of `yarn install` already. | |
run: | | |
yarn install --no-lockfile | |
env: | |
NODE_OPTIONS: --max_old_space_size=4096 | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # https://github.com/microsoft/vscode-ripgrep/issues/9 | |
- name: Publish | |
uses: nick-invision/retry@v2 | |
with: | |
timeout_minutes: 5 | |
retry_wait_seconds: 60 | |
max_attempts: 3 | |
retry_on: error | |
command: yarn run publish:next | |
env: | |
# The variable name comes from here: | |
# https://github.com/actions/setup-node/blob/70b9252472eee7495c93bb1588261539c3c2b98d/src/authutil.ts#L48 | |
NODE_AUTH_TOKEN: ${{ secrets.NPM_AUTH_TOKEN }} |