From 68f3e8a36e99aa02361384b1732bb39d9311309a Mon Sep 17 00:00:00 2001 From: Andrew Gliga Date: Tue, 13 Feb 2024 16:20:29 -0800 Subject: [PATCH] chore: split up workflow --- .github/workflows/node.js.yml | 38 ++++++++++++++++++++++++++++++----- package.json | 5 +++-- 2 files changed, 36 insertions(+), 7 deletions(-) diff --git a/.github/workflows/node.js.yml b/.github/workflows/node.js.yml index d7d491b83a..04a29a4359 100644 --- a/.github/workflows/node.js.yml +++ b/.github/workflows/node.js.yml @@ -11,13 +11,41 @@ concurrency: cancel-in-progress: true jobs: + storybook: + runs-on: ubuntu-latest + permissions: + # Give the default GITHUB_TOKEN write permission to commit and push the + # added or changed files to the repository. + contents: write + steps: + - name: Checkout code + uses: actions/checkout@v4 + with: + ref: ${{ github.head_ref }} + - name: Use node + uses: actions/setup-node@v3 + with: + node-version: 20 + cache: npm + - name: Install dependencies + run: npm ci + - name: Format Code + run: npm run build:docs + - name: Commit changes + uses: stefanzweifel/git-auto-commit-action@v5 + with: + commit_message: "ci: update storybook" + commit_user_name: "github-actions[bot]" + commit_user_email: "github-actions[bot]@users.noreply.github.com" + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} build: runs-on: ubuntu-latest steps: - uses: actions/checkout@master - uses: actions/setup-node@master with: - node-version: "18" + node-version: 20 - uses: webfactory/ssh-agent@v0.5.4 with: ssh-private-key: ${{ secrets.SSH_PRIVATE_KEY }} @@ -36,7 +64,7 @@ jobs: path-to-lcov: .coverage/lcov.info release: runs-on: ubuntu-latest - needs: [build] + needs: [build, storybook] if: "${{ github.repository_owner == 'ebay' && github.event_name == 'push' }}" steps: - name: Checkout code @@ -44,7 +72,7 @@ jobs: - name: Setup node uses: actions/setup-node@v3 with: - node-version: "18" + node-version: 20 cache: npm - name: Install dependencies run: npm ci @@ -54,8 +82,8 @@ jobs: with: version: npm run version publish: npm run release - commit: "[ci] release" - title: "[ci] release" + commit: "ci: release" + title: "ci: release" env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} NPM_TOKEN: ${{ secrets.NPM_TOKEN }} diff --git a/package.json b/package.json index ab54ce86cb..04c34c8b0b 100644 --- a/package.json +++ b/package.json @@ -6,7 +6,8 @@ "installMarkoV5": "npm i marko@5 @marko/compiler@5 --force", "installMarkoV4": "npm remove @marko/compiler && npm i marko@4 --force", "prepublishOnly": "rm -rf dist && node scripts/prepublish", - "version": "npm run build:storybook && npm run build:readme && git add -A src docs && changeset version && npm i --package-lock-only", + "version": "changeset version && npm i --package-lock-only", + "build:docs": "npm run build:storybook && npm run build:readme", "postpublish": "node scripts/postpublish", "start": "storybook dev -p 6006", "start:prod": "NODE_ENV=production npm start", @@ -23,7 +24,7 @@ "lint:less": "stylelint \"src/**/*.{css,less}\" --config .stylelintrc", "lint:js": "eslint .", "lint:whitespace": "lintspaces *.md src/**/*.md src/**/*.marko src/**/*.less --newline --maxnewlines 1 --trailingspaces --spaces 4", - "release": "ENTRY=master:npm npm run set-entry && npm run build && changeset publish && ENTRY=master:dev npm run set-entry && npm ci", + "release": "ENTRY=master:npm npm run set-entry && changeset publish && ENTRY=master:dev npm run set-entry && npm ci", "set-entry": "npm exec --ws -c 'dot-json package.json master $(dot-json package.json $ENTRY)'", "build": "rm -rf dist && mtc && npm run lint && node scripts/check-postpublish && npm test", "build:ci": "npm run lint && node scripts/check-postpublish && npm test && npm run build",