Update string utils and the randomizer #284
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: EasyData.JS Pipeline | |
on: | |
workflow_dispatch: | |
inputs: | |
release_mode: | |
description: 'Release mode (none, dev, prod)' | |
required: true | |
default: 'none' | |
release: | |
types: [published] | |
push: | |
branches: | |
- master | |
paths: | |
- .github/workflows/js-build.yml | |
- easydata.js/** | |
pull_request: | |
branches: | |
- master | |
- dev | |
paths: | |
- .github/workflows/js-build.yml | |
- easydata.js/** | |
jobs: | |
build_and_test: | |
name: Build & Test | |
runs-on: windows-latest | |
defaults: | |
run: | |
working-directory: ./easydata.js | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Use Node.js | |
uses: actions/setup-node@v1 | |
with: | |
node-version: 14.x | |
- name: Install dependencies | |
run: npm run installall | |
- name: Set version | |
run: npm run setver | |
- name: Build | |
run: npm run build:prod | |
- name: Test | |
run: npm test | |
continue-on-error: true | |
- name: Upload packs artifacts | |
uses: actions/upload-artifact@v2 | |
with: | |
name: packs | |
path: | | |
./easydata.js/packs/*/dist/**/*.* | |
./easydata.js/packs/*/package.json | |
./easydata.js/packs/*/LICENSE.md | |
./easydata.js/packs/*/README.md | |
./easydata.js/packs/*/tsconfig.json | |
./easydata.js/packs/*/*.js | |
!./easydata.js/packs/**/node_modules/**/*.* | |
- name: Upload browser artifacts | |
uses: actions/upload-artifact@v2 | |
with: | |
name: browser | |
path: | | |
./easydata.js/packs/crud/dist/browser/*.js | |
./easydata.js/packs/crud/dist/browser/*.css | |
release_dev: | |
name: Development Release | |
needs: [ build_and_test ] | |
if: github.event.inputs.release_mode == 'dev' && needs.build_and_test.result == 'success' | |
runs-on: windows-latest | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Download browser artifacts | |
uses: actions/download-artifact@v2 | |
with: | |
name: browser | |
path: browser | |
- name: Read version.json to env | |
uses: antifree/[email protected] | |
with: | |
filename: ./easydata.js/version.json | |
prefix: ed | |
- name: Publish to CDN | |
uses: SamKirkland/[email protected] | |
with: | |
server: ${{ secrets.CDN_FTP_SERVER }} | |
username: ${{ secrets.CDN_FTP_USER }} | |
password: ${{ secrets.CDN_FTP_PWD }} | |
local-dir: './browser/' | |
server-dir: 'cdn.korzh.com/ed/${{ env.ed_baseVersion }}/' | |
- name: Download packs artifacts | |
uses: actions/download-artifact@v2 | |
with: | |
name: packs | |
path: packs | |
- name: Use Node.js | |
uses: actions/setup-node@v1 | |
with: | |
registry-url: 'https://www.myget.org/F/korzh-npm/npm/' | |
- name: Publish @easydata/core | |
run: npm publish packs/core | |
env: | |
NODE_AUTH_TOKEN: ${{ secrets.MYGET_ACCESS_TOKEN }} | |
- name: Publish @easydata/ui | |
run: npm publish packs/ui | |
env: | |
NODE_AUTH_TOKEN: ${{ secrets.MYGET_ACCESS_TOKEN }} | |
- name: Publish @easydata/crud | |
run: npm publish packs/crud | |
env: | |
NODE_AUTH_TOKEN: ${{ secrets.MYGET_ACCESS_TOKEN }} | |
release_prod: | |
name: Production Release | |
needs: [ build_and_test ] | |
if: (github.event.inputs.release_mode == 'prod' || github.event_name == 'release') && needs.build_and_test.result == 'success' | |
runs-on: windows-latest | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Download browser artifacts | |
uses: actions/download-artifact@v2 | |
with: | |
name: browser | |
path: browser | |
- name: Read version.json to env | |
uses: antifree/[email protected] | |
with: | |
filename: ./easydata.js/version.json | |
prefix: ed | |
- name: Publish to CDN | |
uses: SamKirkland/[email protected] | |
with: | |
server: ${{ secrets.CDN_FTP_SERVER }} | |
username: ${{ secrets.CDN_FTP_USER }} | |
password: ${{ secrets.CDN_FTP_PWD }} | |
local-dir: './browser/' | |
server-dir: 'cdn.korzh.com/ed/${{ env.ed_baseVersion }}/' | |
- name: Download packs artifacts | |
uses: actions/download-artifact@v2 | |
with: | |
name: packs | |
path: packs | |
- name: Use Node.js | |
uses: actions/setup-node@v1 | |
with: | |
registry-url: 'https://registry.npmjs.org' | |
- name: Publish @easydata/core | |
run: npm publish packs/core --access public --tag ${{ env.ed_tag }} | |
env: | |
NODE_AUTH_TOKEN: ${{ secrets.NPM_ACCESS_TOKEN }} | |
- name: Publish @easydata/ui | |
run: npm publish packs/ui --access public --tag ${{ env.ed_tag }} | |
env: | |
NODE_AUTH_TOKEN: ${{ secrets.NPM_ACCESS_TOKEN }} | |
- name: Publish @easydata/crud | |
run: npm publish packs/crud --access public --tag ${{ env.ed_tag }} | |
env: | |
NODE_AUTH_TOKEN: ${{ secrets.NPM_ACCESS_TOKEN }} |