Bladeren bron

test: update actions/checkout and actions/setup-node from v2 to v3

shijia.me 3 jaren geleden
bovenliggende
commit
7f86d8201a

+ 37 - 37
.github/workflows/chromatic.yml

@@ -5,43 +5,43 @@ name: 'test:chromatic'
 
 # Event for the workflow
 on:
-  pull_request:
-    branches: [ main, test-chromatic ]
-    paths:
-      - 'packages/**/*.scss'
-      - '!packages/**/_story/**'
-      - '!packages/**/__test__/**'
-      - '!packages/**/*.stories.[tj]sx?'
-      - '!packages/**/*.story.[tj]sx?'
-      - '!packages/**/*.test.[tj]sx?'
-      - '!packages/**/*.md'
-  push:
-    branches: [ main, test-chromatic ]
-    paths:
-      - 'packages/**/*.scss'
-      - '!packages/**/*.md'
+    pull_request:
+        branches: [main, test-chromatic]
+        paths:
+            - 'packages/**/*.scss'
+            - '!packages/**/_story/**'
+            - '!packages/**/__test__/**'
+            - '!packages/**/*.stories.[tj]sx?'
+            - '!packages/**/*.story.[tj]sx?'
+            - '!packages/**/*.test.[tj]sx?'
+            - '!packages/**/*.md'
+    push:
+        branches: [main, test-chromatic]
+        paths:
+            - 'packages/**/*.scss'
+            - '!packages/**/*.md'
 
 # List of jobs
 jobs:
-  chromatic-deployment:
-    # Operating System
-    runs-on: ubuntu-latest
-    if: github.event_name == 'push' && github.repository_owner == 'DouyinFE' || github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name == 'DouyinFE/semi-design'
-    # Job steps
-    steps:
-      - uses: actions/checkout@v1
-      - uses: actions/setup-node@v2
-        with:
-          node-version: '14'
-      - name: Install dependencies
-        run: npx lerna bootstrap
-      - name: Pre-build libs
-        run: npx lerna run build:lib
-      - name: Publish to Chromatic
-        uses: chromaui/action@v1
-        # Chromatic GitHub Action options
-        with:
-          token: ${{ secrets.GITHUB_TOKEN }}
-          # 👇 Chromatic projectToken, refer to the manage page to obtain it.
-          projectToken: ${{ secrets.CHROMATIC_PROJECT_TOKEN }}
-          buildScriptName: 'build-storybook'
+    chromatic-deployment:
+        # Operating System
+        runs-on: ubuntu-latest
+        if: github.event_name == 'push' && github.repository_owner == 'DouyinFE' || github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name == 'DouyinFE/semi-design'
+        # Job steps
+        steps:
+            - uses: actions/checkout@v1
+            - uses: actions/setup-node@v3
+              with:
+                  node-version: '16'
+            - name: Install dependencies
+              run: npx lerna bootstrap
+            - name: Pre-build libs
+              run: npx lerna run build:lib
+            - name: Publish to Chromatic
+              uses: chromaui/action@v1
+              # Chromatic GitHub Action options
+              with:
+                  token: ${{ secrets.GITHUB_TOKEN }}
+                  # 👇 Chromatic projectToken, refer to the manage page to obtain it.
+                  projectToken: ${{ secrets.CHROMATIC_PROJECT_TOKEN }}
+                  buildScriptName: 'build-storybook'

+ 3 - 3
.github/workflows/cypress.yml

@@ -28,7 +28,7 @@ jobs:
         if: ${{ github.repository_owner == 'DouyinFE' }}
         steps:
             - name: Checkout
-              uses: actions/checkout@v2
+              uses: actions/checkout@3
             - name: Install global packages
               run: npm i -g lerna yarn
             - name: Build storybook
@@ -54,7 +54,7 @@ jobs:
         needs: install
         steps:
             - name: Checkout
-              uses: actions/checkout@v2
+              uses: actions/checkout@v3
             - name: Download the build folders
               uses: actions/download-artifact@v2
               with:
@@ -86,7 +86,7 @@ jobs:
         needs: install
         steps:
             - name: Checkout
-              uses: actions/checkout@v2
+              uses: actions/checkout@v3
             - name: Download the build folders
               uses: actions/download-artifact@v2
               with:

+ 25 - 25
.github/workflows/lighthouse.yml

@@ -1,30 +1,30 @@
 name: 'lighthouse test'
 
 on:
-  pull_request:
-    branches: [ main, release, milestone**, feat/a11y-aria ]
-  push:
-    branches: [ main, release, milestone** ]
+    pull_request:
+        branches: [main, release, milestone**, feat/a11y-aria]
+    push:
+        branches: [main, release, milestone**]
 
 jobs:
-  lhci:
-    name: Lighthouse
-    runs-on: ubuntu-latest
-    steps:
-      - uses: actions/checkout@v2
-      - name: Use Node.js 14.x
-        uses: actions/setup-node@v1
-        with:
-          node-version: 14.x
-      - name: npm install, build
-        run: |
-          npm i -g lerna gulp
-          lerna bootstrap
-          lerna run build:lib
-          npm run build-storybook
-      - name: run Lighthouse CI
-        env:
-          LHCI_GITHUB_APP_TOKEN: ${{ secrets.LHCI_GITHUB_APP_TOKEN }}
-        run: |
-          npm install -g @lhci/[email protected]
-          lhci autorun
+    lhci:
+        name: Lighthouse
+        runs-on: ubuntu-latest
+        steps:
+            - uses: actions/checkout@v3
+            - name: Use Node.js 16
+              uses: actions/setup-node@v3
+              with:
+                  node-version: 16
+            - name: npm install, build
+              run: |
+                  npm i -g lerna gulp
+                  lerna bootstrap
+                  lerna run build:lib
+                  npm run build-storybook
+            - name: run Lighthouse CI
+              env:
+                  LHCI_GITHUB_APP_TOKEN: ${{ secrets.LHCI_GITHUB_APP_TOKEN }}
+              run: |
+                  npm install -g @lhci/[email protected]
+                  lhci autorun

+ 39 - 40
.github/workflows/publish.yml

@@ -1,48 +1,47 @@
-name: "publish"
+name: 'publish'
 
 on:
-  workflow_dispatch:
-    inputs:
-      release_type:
-        description: 'release type: minor | patch | beta'
-        required: true
+    workflow_dispatch:
+        inputs:
+            release_type:
+                description: 'release type: minor | patch | beta'
+                required: true
 
 jobs:
-  publish-new-version:
-    name: "publish a new version"
-    runs-on: ubuntu-latest
-    steps:
-      - uses: actions/checkout@v2
-        with:
-          token: ${{ secrets.PAT }}
+    publish-new-version:
+        name: 'publish a new version'
+        runs-on: ubuntu-latest
+        steps:
+            - uses: actions/checkout@v3
+              with:
+                  token: ${{ secrets.PAT }}
 
-      - name: npm install
-        run: npm i -g lerna && npm run bootstrap
+            - name: npm install
+              run: npm i -g lerna && npm run bootstrap
 
-      - name: get version list
-        run: |
-          PKG_NAME=@douyinfe/semi-ui
-          echo "VERSION_LIST="$(npm view $PKG_NAME versions --json)"" >> $GITHUB_ENV
-        
+            - name: get version list
+              run: |
+                  PKG_NAME=@douyinfe/semi-ui
+                  echo "VERSION_LIST="$(npm view $PKG_NAME versions --json)"" >> $GITHUB_ENV
 
-      - name: get version
-        run: echo "RELEASE_VERSION="$(node scripts/version.js)"" >> $GITHUB_ENV
-        env:
-            RELEASE_TYPE: ${{ github.event.inputs.release_type }}
+            - name: get version
+              run: echo "RELEASE_VERSION="$(node scripts/version.js)"" >> $GITHUB_ENV
+              env:
+                  RELEASE_TYPE: ${{ github.event.inputs.release_type }}
 
-      - name: publish
-        run: |
-          git config --global user.name 'semi-bot'
-          git config --global user.email '[email protected]'
-          npm config set registry=https://registry.npmjs.org/
-          npm config set //registry.npmjs.org/:_authToken=${{ secrets.NPM_TOKEN }}
-          npm whoami
-          DIST_TAG=latest
-          if [[ ${{ github.event.inputs.release_type }} == 'beta' ]]; then
-            DIST_TAG=beta
-          fi
-          echo "$RELEASE_VERSION"
-          echo "$DIST_TAG"
-          lerna version $RELEASE_VERSION --exact --force-publish --yes --no-push
-          lerna publish from-package --dist-tag $DIST_TAG --yes
-          git push -o ci.skip --follow-tags --no-verify --atomic
+            - name: publish
+              run: |
+                  git config --global user.name 'semi-bot'
+                  git config --global user.email '[email protected]'
+                  npm config set registry=https://registry.npmjs.org/
+                  npm config set //registry.npmjs.org/:_authToken=${{ secrets.NPM_TOKEN }}
+                  npm whoami
+                  DIST_TAG=latest
+                  if [[ ${{ github.event.inputs.release_type }} == 'beta' ]]; then
+                    DIST_TAG=beta
+                  fi
+                  echo "$RELEASE_VERSION"
+                  echo "$DIST_TAG"
+                  lerna version $RELEASE_VERSION --exact --force-publish --yes --no-push
+                  lerna publish from-package --dist-tag $DIST_TAG --yes
+                  git push -o ci.skip --follow-tags --no-verify --atomic

+ 16 - 17
.github/workflows/release.yml

@@ -1,21 +1,20 @@
 name: release
 
-on:
-  create
+on: create
 
 jobs:
-  release:
-    runs-on: ubuntu-latest
-    if: github.event.ref_type == 'tag' && !contains(github.event.ref, 'alpha')
-    steps:
-      - uses: actions/checkout@v2
-      - name: release
-        uses: actions/setup-node@v2
-        with:
-          node-version: 14
-      - run: |
-            npm i -g lerna && npm run bootstrap
-            node scripts/release.js
-        env:
-            GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
-            CHANGELOG_PATH: content/start/changelog/index.md, content/start/changelog/index-en-US.md
+    release:
+        runs-on: ubuntu-latest
+        if: github.event.ref_type == 'tag' && !contains(github.event.ref, 'alpha')
+        steps:
+            - uses: actions/checkout@v3
+            - name: release
+              uses: actions/setup-node@v3
+              with:
+                  node-version: 16
+            - run: |
+                  npm i -g lerna && npm run bootstrap
+                  node scripts/release.js
+              env:
+                  GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
+                  CHANGELOG_PATH: content/start/changelog/index.md, content/start/changelog/index-en-US.md