mirror of
https://github.com/Ionaru/easy-markdown-editor
synced 2025-10-09 05:52:11 -06:00
67 lines
1.4 KiB
YAML
67 lines
1.4 KiB
YAML
name: Test & Deploy v3 alpha
|
|
|
|
on:
|
|
workflow_dispatch:
|
|
push:
|
|
branches:
|
|
- v3
|
|
pull_request:
|
|
branches:
|
|
- v3
|
|
|
|
jobs:
|
|
audit:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/setup-node@v4
|
|
with:
|
|
node-version: current
|
|
- uses: actions/checkout@v4
|
|
- run: npm audit --omit=dev
|
|
|
|
lint:
|
|
needs: [audit]
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/setup-node@v4
|
|
with:
|
|
node-version: current
|
|
- uses: actions/checkout@v4
|
|
- run: npm ci
|
|
- name: Lint
|
|
run: npm run check
|
|
|
|
test:
|
|
needs: [audit]
|
|
runs-on: ubuntu-latest
|
|
strategy:
|
|
matrix:
|
|
node-version: ["20", "22"]
|
|
steps:
|
|
- uses: actions/setup-node@v4
|
|
with:
|
|
node-version: ${{ matrix.node-version }}
|
|
- uses: actions/checkout@v4
|
|
- run: npm ci
|
|
- name: Test
|
|
run: npm test
|
|
|
|
deploy:
|
|
needs: [lint, test]
|
|
runs-on: ubuntu-latest
|
|
if: github.event_name == 'push'
|
|
steps:
|
|
- uses: actions/setup-node@v4
|
|
with:
|
|
node-version: current
|
|
- uses: actions/checkout@v4
|
|
- run: npm ci
|
|
- run: npm run build
|
|
- name: Update @v3-alpha version
|
|
run: npm version premajor --no-git-tag-version --preid "alpha.$GITHUB_RUN_NUMBER"
|
|
- name: Deploy @v3-alpha version to npm
|
|
uses: JS-DevTools/npm-publish@v3
|
|
with:
|
|
tag: v3-alpha
|
|
token: ${{ secrets.NPM_TOKEN }}
|