Skip to content

[FIX] config spliting #39

[FIX] config spliting

[FIX] config spliting #39

Workflow file for this run

name: Node.js CI/CD
on:
push:
branches:
- main
pull_request:
jobs:
build:
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Enable Corepack
run: corepack enable
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: 22
registry-url: 'https://registry.npmjs.org'
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
- name: Install dependencies (Yarn Berry)
run: yarn install --immutable
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
- name: Run tests (if test script exists)
run: yarn workspaces foreach --all --topological --parallel --no-private run test
continue-on-error: true
- name: Build project (if build script exists)
run: yarn workspaces foreach --all --topological --parallel --no-private run build
- name: Bump version & commit (only on main)
if: github.ref == 'refs/heads/main'
run: |
yarn workspaces foreach --all version patch
git config user.name "github-actions[bot]"
git config user.email "github-actions[bot]@users.noreply.github.com"
git add -A
git commit -m "chore(release): bump versions"
git tag v$(jq -r .version package.json)
git remote set-url origin https://x-access-token:${{ secrets.GITHUB_TOKEN }}@github.com/${{ github.repository }}
git push --follow-tags
- name: Publish to npm using yarn workspaces
if: github.ref == 'refs/heads/main'
run: yarn workspaces foreach --verbose --all --topological --no-private npm publish --access public
get-version:
runs-on: ubuntu-latest
outputs:
version: ${{ steps.get-version.outputs.version }}
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Get version from package.json
id: get-version
run: |
VERSION=$(jq -r .version package.json)
echo "version=$VERSION" >> $GITHUB_OUTPUT
call-publish:
needs: [build, get-version]
uses: ./.github/workflows/release.yml
permissions:
contents: write
with:
version: ${{ needs.get-version.outputs.version }}