feat(ci): publish monorepo libs to npm (#2951)
This commit is contained in:
parent
0a5fb9d917
commit
abf69786ba
2
.github/workflows/generate-queries.yml
vendored
2
.github/workflows/generate-queries.yml
vendored
@ -19,7 +19,7 @@ jobs:
|
||||
id: Node
|
||||
uses: actions/setup-node@v2
|
||||
with:
|
||||
node-version: 16.14.0
|
||||
node-version: 16.15.1
|
||||
- name: Install root dependencies
|
||||
run: yarn install
|
||||
- name: Generate queries
|
||||
|
2
.github/workflows/lint_pr.yml
vendored
2
.github/workflows/lint_pr.yml
vendored
@ -16,7 +16,7 @@ jobs:
|
||||
id: Node
|
||||
uses: actions/setup-node@v2
|
||||
with:
|
||||
node-version: 16.14.0
|
||||
node-version: 16.15.1
|
||||
- name: Install root dependencies
|
||||
run: yarn install
|
||||
- name: Check PR title
|
||||
|
2
.github/workflows/process-tranches.yml
vendored
2
.github/workflows/process-tranches.yml
vendored
@ -19,7 +19,7 @@ jobs:
|
||||
id: Node
|
||||
uses: actions/setup-node@v2
|
||||
with:
|
||||
node-version: 16.14.0
|
||||
node-version: 16.15.1
|
||||
- name: Install root dependencies
|
||||
run: yarn install
|
||||
- name: Generate queries
|
||||
|
47
.github/workflows/publish-npm.yml
vendored
Normal file
47
.github/workflows/publish-npm.yml
vendored
Normal file
@ -0,0 +1,47 @@
|
||||
name: Publish libs to npm
|
||||
|
||||
on:
|
||||
workflow_dispatch:
|
||||
inputs:
|
||||
project:
|
||||
description: 'Monorepo project to publish'
|
||||
required: true
|
||||
type: choice
|
||||
options:
|
||||
- ui-toolkit
|
||||
- react-helpers
|
||||
- tailwindcss-config
|
||||
- types
|
||||
|
||||
jobs:
|
||||
publish:
|
||||
name: Build & Publish - Tag
|
||||
runs-on: ubuntu-latest
|
||||
permissions:
|
||||
contents: 'read'
|
||||
actions: 'read'
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v3
|
||||
with:
|
||||
fetch-depth: 0
|
||||
- name: User Node.js 16
|
||||
id: Node
|
||||
uses: actions/setup-node@v3
|
||||
with:
|
||||
node-version: 16.15.1
|
||||
- name: Restore node_modules from cache
|
||||
uses: actions/cache@v3
|
||||
with:
|
||||
path: '**/node_modules'
|
||||
key: node_modules-${{ hashFiles('**/yarn.lock') }}
|
||||
- name: Install root dependencies
|
||||
run: yarn install --frozen-lockfile
|
||||
- name: Build project
|
||||
run: yarn nx build ${{inputs.project}}
|
||||
- name: Publish project to @vegaprotocol
|
||||
uses: JS-DevTools/npm-publish@v1
|
||||
with:
|
||||
token: ${{ secrets.NPM_TOKEN }}
|
||||
package: dist/libs/${{inputs.project}}/package.json
|
||||
access: public
|
2
.github/workflows/test.yml
vendored
2
.github/workflows/test.yml
vendored
@ -26,7 +26,7 @@ jobs:
|
||||
id: Node
|
||||
uses: actions/setup-node@v3
|
||||
with:
|
||||
node-version: 16.14.0
|
||||
node-version: 16.15.1
|
||||
- name: Restore node_modules from cache
|
||||
uses: actions/cache@v3
|
||||
with:
|
||||
|
@ -8,6 +8,7 @@
|
||||
"executor": "@nrwl/web:rollup",
|
||||
"outputs": ["{options.outputPath}"],
|
||||
"options": {
|
||||
"buildableProjectDepsInPackageJsonType": "dependencies",
|
||||
"outputPath": "dist/libs/react-helpers",
|
||||
"tsConfig": "libs/react-helpers/tsconfig.lib.json",
|
||||
"project": "libs/react-helpers/package.json",
|
||||
|
@ -10,7 +10,8 @@
|
||||
"outputPath": "dist/libs/tailwindcss-config",
|
||||
"main": "libs/tailwindcss-config/src/index.js",
|
||||
"tsConfig": "libs/tailwindcss-config/tsconfig.lib.json",
|
||||
"assets": ["libs/tailwindcss-config/*.md"]
|
||||
"assets": ["libs/tailwindcss-config/*.md"],
|
||||
"buildableProjectDepsInPackageJsonType": "dependencies"
|
||||
}
|
||||
},
|
||||
"lint": {
|
||||
|
@ -21,7 +21,8 @@
|
||||
"input": ".",
|
||||
"output": "."
|
||||
}
|
||||
]
|
||||
],
|
||||
"buildableProjectDepsInPackageJsonType": "dependencies"
|
||||
}
|
||||
},
|
||||
"lint": {
|
||||
|
@ -8,6 +8,7 @@
|
||||
"executor": "@nrwl/web:rollup",
|
||||
"outputs": ["{options.outputPath}"],
|
||||
"options": {
|
||||
"buildableProjectDepsInPackageJsonType": "dependencies",
|
||||
"outputPath": "dist/libs/ui-toolkit",
|
||||
"tsConfig": "libs/ui-toolkit/tsconfig.lib.json",
|
||||
"project": "libs/ui-toolkit/package.json",
|
||||
|
Loading…
Reference in New Issue
Block a user