build(core): publishing react in CI #2
Workflow file for this run
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: React CI | |
env: | |
NODE_VERSION: 20 | |
on: | |
push: | |
branches: | |
- "**" | |
paths: | |
- "*" | |
- "core/**" | |
- "website/**" | |
- "react/**" | |
permissions: | |
actions: read | |
checks: write # allow dependabot-triggered runs to create checks | |
contents: write # allow dependabot-triggered runs to create releases | |
deployments: read | |
issues: write | |
discussions: none | |
packages: read | |
pages: none | |
pull-requests: write # allow dependabot-triggered runs to comment on PRs | |
repository-projects: read | |
security-events: none | |
statuses: write | |
jobs: | |
test: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Setup Node | |
uses: actions/setup-node@v4 | |
with: | |
node-version: ${{ env.NODE_VERSION }} | |
cache: npm | |
- name: Install Dependencies | |
run: npm ci | |
- name: Run React Tests | |
run: npm run react:test | |
publish: | |
needs: [test] | |
name: Publish NPM Package | |
runs-on: ubuntu-latest | |
env: | |
GIT_AUTHOR_NAME: "im-pipeline-bot" | |
GIT_AUTHOR_EMAIL: ${{ secrets.COMMIT_BOT_EMAIL }} | |
GIT_COMMITTER_NAME: "im-pipeline-bot" | |
GIT_COMMITTER_EMAIL: ${{ secrets.COMMIT_BOT_EMAIL }} | |
GITHUB_TOKEN: ${{ secrets.PIPELINE_BOT_PAT }} | |
GH_TOKEN: ${{ secrets.PIPELINE_BOT_PAT }} | |
NPM_TOKEN: ${{ secrets.NPM_TOKEN }} | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
with: | |
token: ${{ secrets.PIPELINE_BOT_PAT }} | |
fetch-depth: 0 | |
persist-credentials: true | |
- name: Setup Node | |
uses: actions/setup-node@v4 | |
with: | |
node-version: ${{ env.NODE_VERSION }} | |
cache: npm | |
- name: Install Dependencies | |
run: npm ci | |
- name: Build | |
run: | | |
npm run core:build | |
npm run react:build | |
npm run website:build | |
git add -A | |
- name: Semantic Release - core | |
run: npx cross-env PACKAGE_NAME=core npx semantic-release | |
- name: Semantic Release - react | |
run: npx cross-env PACKAGE_NAME=react npx semantic-release |