chore: update release flow #13
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: Semantic Release | |
on: | |
push: | |
branches: | |
- master | |
jobs: | |
release: | |
name: 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: Install admin-ui dependencies with yarn | |
run: yarn --cwd apps/admin-ui install | |
- name: Install course dependencies with npm | |
run: npm install --prefix apps/course | |
- name: Lint commit messages | |
run: npx commitlint --from=HEAD~1 --to=HEAD | |
continue-on-error: true | |
- name: Check Git Status | |
run: git status | |
- name: Stage all changes | |
run: git add -A | |
- name: Semantic Release Admin UI | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
NPM_TOKEN: ${{ secrets.NPM_TOKEN }} | |
DEBUG: semantic-release:* | |
run: npx semantic-release --no-verify --cwd apps/admin-ui | |
- name: Publish Admin UI to npm | |
run: | | |
cd apps/admin-ui | |
npm publish --access public | |
- name: Semantic Release Course | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
NPM_TOKEN: ${{ secrets.NPM_TOKEN }} | |
DEBUG: semantic-release:* | |
run: npx semantic-release --no-verify --cwd apps/course | |
- name: Publish Course to npm | |
run: | | |
cd apps/course | |
npm publish --access public | |
- name: Create GitHub Release | |
uses: softprops/action-gh-release@v1 | |
with: | |
token: ${{ secrets.GITHUB_TOKEN }} | |
tag_name: ${{ github.ref }} | |
release_name: Release ${{ github.ref_name }} | |
body: | | |
Release for admin-ui and course packages. |