Release monorepo packages #200
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: Release monorepo packages | |
on: | |
workflow_dispatch: | |
branches: | |
- main | |
env: | |
CPU_CORES: 2 | |
jobs: | |
release: | |
name: Release | |
runs-on: ubuntu-latest | |
env: | |
HUSKY: 0 # disabled husky and lint staged; https://typicode.github.io/husky/#/?id=with-env-variables | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
token: ${{ secrets.SWAGGER_BOT_GITHUB_TOKEN }} | |
- name: Setup Node.js | |
uses: actions/setup-node@v4 | |
with: | |
node-version: 22 | |
registry-url: https://registry.npmjs.org | |
cache: 'npm' | |
cache-dependency-path: 'package-lock.json' | |
- name: Install monorepo dependencies | |
run: npm ci --engine-strict=false | |
- name: Build monorepo | |
run: npm run build | |
- name: Check TypeScript types | |
run: npm run typescript:check-types | |
- name: Execute tests in monorepo | |
run: npm run test | |
- name: Version bump & GitHub release | |
run: | | |
git config user.email "[email protected]" | |
git config user.name "swagger-bot" | |
npx lerna version prerelease --preid beta --no-private --yes --force-publish | |
env: | |
GH_TOKEN: ${{ secrets.SWAGGER_BOT_GITHUB_TOKEN }} | |
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} | |
- name: Publish monorepo npm packages | |
run: npx lerna publish from-package --no-private --yes | |
env: | |
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} |