Update CI
This commit is contained in:
parent
22fa4c6df4
commit
b8dc1b5a23
3 changed files with 99 additions and 66 deletions
34
.forgejo/workflows/checks.yml
Normal file
34
.forgejo/workflows/checks.yml
Normal file
|
|
@ -0,0 +1,34 @@
|
||||||
|
name: CI
|
||||||
|
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
branches: [main]
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
build:
|
||||||
|
runs-on: [docker]
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- name: Checkout code
|
||||||
|
uses: actions/checkout@v3
|
||||||
|
|
||||||
|
- name: Setup Node.js
|
||||||
|
uses: actions/setup-node@v3
|
||||||
|
with:
|
||||||
|
node-version: '20'
|
||||||
|
|
||||||
|
- name: Install dependencies
|
||||||
|
run: npm ci
|
||||||
|
|
||||||
|
- name: Prettier
|
||||||
|
run: npm run prettier:check
|
||||||
|
|
||||||
|
- name: ES Lint
|
||||||
|
run: npm run lint
|
||||||
|
|
||||||
|
- name: Test
|
||||||
|
run: npm run test
|
||||||
|
|
||||||
|
- name: Build
|
||||||
|
run: npm run build
|
||||||
|
|
||||||
|
|
@ -1,66 +0,0 @@
|
||||||
name: CI
|
|
||||||
|
|
||||||
on:
|
|
||||||
push:
|
|
||||||
branches: [main]
|
|
||||||
workflow_dispatch:
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
build:
|
|
||||||
runs-on: [docker]
|
|
||||||
|
|
||||||
steps:
|
|
||||||
- name: Checkout code
|
|
||||||
uses: actions/checkout@v3
|
|
||||||
|
|
||||||
- name: Setup Node.js
|
|
||||||
uses: actions/setup-node@v3
|
|
||||||
with:
|
|
||||||
node-version: '20'
|
|
||||||
|
|
||||||
- name: Install dependencies
|
|
||||||
run: npm ci
|
|
||||||
|
|
||||||
- name: Prettier
|
|
||||||
run: npm run prettier:check
|
|
||||||
|
|
||||||
- name: ES Lint
|
|
||||||
run: npm run lint
|
|
||||||
|
|
||||||
- name: Test
|
|
||||||
run: npm run test
|
|
||||||
|
|
||||||
- name: Build
|
|
||||||
run: npm run build
|
|
||||||
|
|
||||||
- name: Upload artifact
|
|
||||||
uses: actions/upload-artifact@v3
|
|
||||||
with:
|
|
||||||
name: lib-${{ github.sha }}
|
|
||||||
path: ./dist/
|
|
||||||
|
|
||||||
# Uncomment if you need deploy
|
|
||||||
|
|
||||||
# deploy:
|
|
||||||
# needs: build
|
|
||||||
# runs-on: [docker]
|
|
||||||
# environment: production
|
|
||||||
|
|
||||||
# steps:
|
|
||||||
# - name: Download artifact
|
|
||||||
# uses: actions/download-artifact@v3
|
|
||||||
# with:
|
|
||||||
# name: lib-${{ github.sha }}
|
|
||||||
# path: ./artifact
|
|
||||||
|
|
||||||
# - name: Setup Node.js
|
|
||||||
# uses: actions/setup-node@v4
|
|
||||||
# with:
|
|
||||||
# node-version: '20'
|
|
||||||
# registry-url: ${{ vars.VERDACCIO_URL }}
|
|
||||||
|
|
||||||
# - name: Publish to NPM
|
|
||||||
# run: npm publish ./artifact --registry ${{ vars.VERDACCIO_URL }}
|
|
||||||
# env:
|
|
||||||
# VERDACCIO_URL: ${{ vars.VERDACCIO_URL }}
|
|
||||||
# NODE_AUTH_TOKEN: ${{ secrets.VERDACCIO_TOKEN }}
|
|
||||||
65
.forgejo/workflows/release.yml
Normal file
65
.forgejo/workflows/release.yml
Normal file
|
|
@ -0,0 +1,65 @@
|
||||||
|
name: CI
|
||||||
|
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
tags:
|
||||||
|
- "*.*.*"
|
||||||
|
workflow_dispatch:
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
build:
|
||||||
|
runs-on: [docker]
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- name: Checkout code
|
||||||
|
uses: actions/checkout@v3
|
||||||
|
|
||||||
|
- name: Setup Node.js
|
||||||
|
uses: actions/setup-node@v3
|
||||||
|
with:
|
||||||
|
node-version: '20'
|
||||||
|
|
||||||
|
- name: Install dependencies
|
||||||
|
run: npm ci
|
||||||
|
|
||||||
|
- name: Prettier
|
||||||
|
run: npm run prettier:check
|
||||||
|
|
||||||
|
- name: ES Lint
|
||||||
|
run: npm run lint
|
||||||
|
|
||||||
|
- name: Test
|
||||||
|
run: npm run test
|
||||||
|
|
||||||
|
- name: Build
|
||||||
|
run: npm run build
|
||||||
|
|
||||||
|
- name: Upload artifact
|
||||||
|
uses: actions/upload-artifact@v3
|
||||||
|
with:
|
||||||
|
name: gxc-math-${{ github.sha }}
|
||||||
|
path: ./dist/
|
||||||
|
|
||||||
|
deploy:
|
||||||
|
needs: build
|
||||||
|
runs-on: [docker]
|
||||||
|
environment: production
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- name: Download artifact
|
||||||
|
uses: actions/download-artifact@v3
|
||||||
|
with:
|
||||||
|
name: gxc-math-${{ github.sha }}
|
||||||
|
path: ./artifact
|
||||||
|
|
||||||
|
- name: Setup Node.js
|
||||||
|
uses: actions/setup-node@v4
|
||||||
|
with:
|
||||||
|
node-version: '20'
|
||||||
|
registry-url: ${{ vars.VERDACCIO_URL }}
|
||||||
|
|
||||||
|
- name: Publish to NPM
|
||||||
|
run: npm publish ./artifact --registry ${{ vars.VERDACCIO_URL }}
|
||||||
|
env:
|
||||||
|
VERDACCIO_URL: ${{ vars.VERDACCIO_URL }}
|
||||||
|
NODE_AUTH_TOKEN: ${{ secrets.VERDACCIO_TOKEN }}
|
||||||
Loading…
Add table
Add a link
Reference in a new issue