Skip to content

Build

Build #37

Workflow file for this run

name: Build
on:
push:
branches: [ "main" ]
workflow_dispatch:
inputs:
release:
type: choice
required: true
description: Create a release
default: 'no'
options:
- 'no'
- 'yes'
jobs:
build-node18:
runs-on: ubuntu-latest
steps:
- uses: actions/setup-node@v4
with:
node-version: '18.x'
- name: Checkout
uses: actions/checkout@v4.1.1
- name: Install, build, check and test
run: |
npm install
npm run build
npm run test
build:
runs-on: ubuntu-latest
needs: build-node18
steps:
- uses: actions/setup-node@v4
with:
node-version: '20.x'
registry-url: 'https://registry.npmjs.org'
- name: Checkout
uses: actions/checkout@v4.1.1
- name: Install, build, check and test
run: |
npm install
npm run build
cd docs/samples
npm install
cd ../..
npm run build-web
npm run test
npm pack
echo RELEASE_TAG=v`node scripts/show-version.mjs` >> "$GITHUB_ENV"
sudo apt-get install zip
cd dist/browser
zip -r ../../con-reg-exp-browser.zip *
- name: Release
uses: softprops/action-gh-release@v1
if: "${{ github.event.inputs.release == 'yes' }}"
with:
files: |
./con-reg-exp-*.tgz
./con-reg-exp-*.zip
draft: false
tag_name: ${{ env.RELEASE_TAG }}
fail_on_unmatched_files: true
generate_release_notes: true
- name: NPM Publish
if: "${{ github.event.inputs.release == 'yes' }}"
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
run: |
npm publish
- name: Prepare an Artifact
run: |
cd web
zip -r ../web.zip *
- name: Upload an Artifact
uses: actions/upload-artifact@v4
with:
name: result
path: |
./*.zip
./*.gz
./*.tgz