chore: update release flow #21
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: Monorepo Release | |
on: | |
push: | |
branches: | |
- master | |
jobs: | |
monorepo_release: | |
name: Monorepo Semantic Release | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
- name: Setup Node.js | |
uses: actions/setup-node@v4 | |
with: | |
node-version: '20' | |
- name: Authenticate to npm | |
run: echo "//registry.npmjs.org/:_authToken=${{ secrets.NPM_TOKEN }}" > ~/.npmrc | |
- name: Install dependencies | |
run: npm install | |
- name: Run Semantic Release for Monorepo | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
run: npx semantic-release | |
publish_admin_ui: | |
name: Publish Admin UI | |
needs: monorepo_release | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
- name: Setup Node.js | |
uses: actions/setup-node@v4 | |
with: | |
node-version: '20' | |
- name: Authenticate to npm | |
run: echo "//registry.npmjs.org/:_authToken=${{ secrets.NPM_TOKEN }}" > ~/.npmrc | |
- name: Install admin-ui dependencies | |
run: yarn --prefix apps/admin-ui | |
- name: Publish Admin UI to npm | |
run: | | |
cd apps/admin-ui | |
npm version patch | |
npm publish --access public | |
publish_course: | |
name: Publish Course | |
needs: monorepo_release | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
- name: Setup Node.js | |
uses: actions/setup-node@v4 | |
with: | |
node-version: '20' | |
- name: Authenticate to npm | |
run: echo "//registry.npmjs.org/:_authToken=${{ secrets.NPM_TOKEN }}" > ~/.npmrc | |
- name: Install course dependencies | |
run: npm install --prefix apps/course | |
- name: Publish Course to npm | |
run: | | |
cd apps/course | |
npm version patch | |
npm publish --access public |