Skip to content

Prepare for 1st release #2

Prepare for 1st release

Prepare for 1st release #2

Workflow file for this run

name: ci-cd
on:
push:
branches:
- main
workflow_dispatch:
pull_request:
branches:
- main
jobs:
build-and-test:
name: Build and Test
strategy:
matrix:
os: [ubuntu-latest]
node: ['18']
java: ['11']
runs-on: ${{ matrix.os }}
timeout-minutes: 10
steps:
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 1
- name: Use Node.js ${{ matrix.node }}
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node }}
registry-url: 'https://registry.npmjs.org'
- name: Use Java ${{ matrix.java }}
uses: actions/setup-java@v3
with:
distribution: 'adopt'
java-version: ${{ matrix.java }}
- name: Run Tests
if: matrix.tests != 'skip'
shell: bash
run: |
yarn
yarn test
publish:
needs: build-and-test
if: |
github.ref =='refs/heads/main' &&
github.event_name == 'push' &&
github.repository == 'eclipse-dash/nodejs-wrapper' &&
startsWith(github.event.head_commit.message, '[Release]:')
runs-on: ubuntu-latest
strategy:
matrix:
node: ['18']
steps:
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0
- 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
run: |
yarn
- name: Publish to npm
uses: nick-invision/retry@v2
with:
timeout_minutes: 5
retry_wait_seconds: 60
max_attempts: 3
retry_on: error
command: yarn publish:ci
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_AUTH_TOKEN }}