mirror of
https://github.com/danbulant/monaco-yaml
synced 2026-07-08 12:30:39 +00:00
Automate publishing to npm
Also the `lint` job has been split into `eslint` and `prettier`. Closes #6
This commit is contained in:
parent
13a21cba5d
commit
d1c499b224
2 changed files with 24 additions and 4 deletions
25
.github/workflows/ci.yaml
vendored
25
.github/workflows/ci.yaml
vendored
|
|
@ -7,6 +7,15 @@ on:
|
||||||
tags: ['*']
|
tags: ['*']
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
|
eslint:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v2
|
||||||
|
- uses: actions/setup-node@v2
|
||||||
|
with: { node-version: 16 }
|
||||||
|
- run: npm ci
|
||||||
|
- run: npx eslint .
|
||||||
|
|
||||||
pack:
|
pack:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
|
|
@ -16,14 +25,14 @@ jobs:
|
||||||
- run: npm ci
|
- run: npm ci
|
||||||
- run: npm pack
|
- run: npm pack
|
||||||
|
|
||||||
lint:
|
prettier:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v2
|
- uses: actions/checkout@v2
|
||||||
- uses: actions/setup-node@v2
|
- uses: actions/setup-node@v2
|
||||||
with: { node-version: 16 }
|
with: { node-version: 16 }
|
||||||
- run: npm ci
|
- run: npm ci
|
||||||
- run: npm run lint
|
- run: npx prettier --check .
|
||||||
|
|
||||||
tsc:
|
tsc:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
|
@ -33,3 +42,15 @@ jobs:
|
||||||
with: { node-version: 16 }
|
with: { node-version: 16 }
|
||||||
- run: npm ci
|
- run: npm ci
|
||||||
- run: npx tsc
|
- run: npx tsc
|
||||||
|
|
||||||
|
release:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
needs: [eslint, pack, prettier, tsc]
|
||||||
|
if: startsWith(github.ref, 'refs/tags/')
|
||||||
|
steps:
|
||||||
|
- uses: actions/setup-node@v2
|
||||||
|
with: { node-version: 16 }
|
||||||
|
- run: npm ci
|
||||||
|
- run: npm publish
|
||||||
|
env:
|
||||||
|
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
|
||||||
|
|
|
||||||
|
|
@ -5,8 +5,7 @@
|
||||||
"homepage": "https://monaco-yaml.js.org",
|
"homepage": "https://monaco-yaml.js.org",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"prepack": "node build.js",
|
"prepack": "node build.js",
|
||||||
"prepare": "husky install",
|
"prepare": "husky install"
|
||||||
"lint": "eslint . && prettier --check ."
|
|
||||||
},
|
},
|
||||||
"main": "./lib/esm/monaco.contribution.js",
|
"main": "./lib/esm/monaco.contribution.js",
|
||||||
"module": "./lib/esm/monaco.contribution.js",
|
"module": "./lib/esm/monaco.contribution.js",
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue