From b1806780a3a0283bdf8a01903da092ccbbb20098 Mon Sep 17 00:00:00 2001 From: gitlawr Date: Sun, 16 Jun 2024 11:07:55 +0800 Subject: [PATCH] ci: test --- .github/workflows/ci.yml | 59 ++-------------------------------------- scripts/build | 4 +++ 2 files changed, 7 insertions(+), 56 deletions(-) create mode 100755 scripts/build diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index dcf19ad8..76085d2b 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -4,6 +4,7 @@ on: push: branches: - 'main' + - 'ci' tags: - 'v*.*.*' pull_request: @@ -44,52 +45,7 @@ jobs: path: | ${{ github.workspace }}/node_modules - ci-hosted: - needs: - - deps - timeout-minutes: 30 - runs-on: ubuntu-22.04 - steps: - - name: Checkout - uses: actions/checkout@v4 - with: - fetch-depth: 1 - persist-credentials: false - - name: Setup Pnpm - uses: pnpm/action-setup@v4 - with: - version: 9.3.0 - - name: Setup Node - uses: actions/setup-node@v4 - with: - node-version: '${{ env.NODE_VERSION }}' - cache: 'pnpm' - - name: Unarchive Modules - timeout-minutes: 5 - uses: actions/cache/restore@v4 - with: - key: node-modules-${{ runner.os }}-${{ hashFiles('pnpm-lock.yaml') }} - path: | - ${{ github.workspace }}/node_modules - - name: Build - run: scripts/build - env: - COS_BUCKET: '${{ secrets.COS_BUCKET }}' - COS_REGION: '${{ secrets.COS_REGION }}' - - name: Release - uses: TencentCloud/cos-action@b0aa648235fb35a1bdd6a77f529eb0ac4c2f1c25 - if: github.event_name == 'push' - with: - secret_id: '${{ secrets.CI_TECENTCOS_SECRET_ID }}' - secret_key: '${{ secrets.CI_TECENTCOS_SECRET_KEY }}' - cos_bucket: '${{ secrets.COS_BUCKET }}' - cos_region: '${{ secrets.COS_REGION }}' - local_path: dist - remote_path: latest - accelerate: true - clean: false - - ci-emebeded: + publish: needs: - deps if: github.event_name == 'push' @@ -100,22 +56,13 @@ jobs: version: ['latest', '${{ github.ref_name }}'] exclude: - version: 'main' + - version: 'ci' steps: - name: Checkout uses: actions/checkout@v4 with: fetch-depth: 1 persist-credentials: false - - name: Setup Pnpm - uses: pnpm/action-setup@v4 - with: - version: 9.3.0 - - name: Setup Node - timeout-minutes: 5 - uses: actions/setup-node@v4 - with: - node-version: '${{ env.NODE_VERSION }}' - cache: 'pnpm' - name: Unarchive Node Modules timeout-minutes: 5 uses: actions/cache/restore@v4 diff --git a/scripts/build b/scripts/build new file mode 100755 index 00000000..b84955c1 --- /dev/null +++ b/scripts/build @@ -0,0 +1,4 @@ +#!/bin/bash +set -ex + +npm run build ${BASE_ARGS:-} \ No newline at end of file