From c8fccd7eb341bb43d26d3781008b141c2bce5692 Mon Sep 17 00:00:00 2001 From: CGQAQ Date: Wed, 29 Nov 2023 14:07:42 +0800 Subject: [PATCH] change ci --- .github/workflows/deploy.yml | 48 +++++++---------------------------- .github/workflows/release.yml | 28 ++++++++------------ 2 files changed, 19 insertions(+), 57 deletions(-) diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index eddf3cd..a7bc73d 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -29,50 +29,20 @@ jobs: build: runs-on: ubuntu-latest steps: - - name: Checkout - uses: actions/checkout@v3 - - name: Detect package manager - id: detect-package-manager - run: | - if [ -f "${{ github.workspace }}/yarn.lock" ]; then - echo "manager=yarn" >> $GITHUB_OUTPUT - echo "command=install" >> $GITHUB_OUTPUT - echo "runner=yarn" >> $GITHUB_OUTPUT - exit 0 - elif [ -f "${{ github.workspace }}/package.json" ]; then - echo "manager=npm" >> $GITHUB_OUTPUT - echo "command=ci" >> $GITHUB_OUTPUT - echo "runner=npx --no-install" >> $GITHUB_OUTPUT - exit 0 - else - echo "Unable to determine package manager" - exit 1 - fi - - name: Setup Node - uses: actions/setup-node@v3 - with: - node-version: "lts/*" - cache: ${{ steps.detect-package-manager.outputs.manager }} - - name: Setup Pages - uses: actions/configure-pages@v3 - - name: Restore cache + - uses: actions/checkout@v3 + - uses: bazelbuild/setup-bazelisk@v2 + - name: Mount bazel cache # Optional uses: actions/cache@v3 with: - path: | - .next/cache - # Generate a new cache whenever packages or source files change. - key: ${{ runner.os }}-nextjs-${{ hashFiles('**/package-lock.json', '**/yarn.lock') }}-${{ hashFiles('**.[jt]s', '**.[jt]sx') }} - # If source files changed but packages didn't, rebuild from a prior cache. - restore-keys: | - ${{ runner.os }}-nextjs-${{ hashFiles('**/package-lock.json', '**/yarn.lock') }}- - - name: Install dependencies - run: ${{ steps.detect-package-manager.outputs.manager }} ${{ steps.detect-package-manager.outputs.command }} - - name: Build with Next.js - run: ${{ steps.detect-package-manager.outputs.runner }} next build + path: "~/.cache/bazel" + key: bazel + - shell: bash + run: bazel build //editor:next_build + - name: Upload artifact uses: actions/upload-pages-artifact@v1 with: - path: ./out + path: ./editor/out # Deployment job deploy: diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 04bfaaa..30ea4cb 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -25,21 +25,13 @@ jobs: artifact_name: b3_server asset_name: b3_server-macos - steps: - - uses: actions/checkout@v1 - - - uses: actions-rs/toolchain@v1 - with: - profile: minimal - toolchain: stable - - - name: Build Server - run: cargo build --release --manifest-path=local_server/Cargo.toml - - - name: Upload binaries to release - uses: svenstaro/upload-release-action@v2 - with: - repo_token: ${{ secrets.GITHUB_TOKEN }} - file: local_server/target/release/${{ matrix.artifact_name }} - asset_name: ${{ matrix.asset_name }} - tag: ${{ github.ref }} + steps: + - uses: actions/checkout@v3 + - uses: bazelbuild/setup-bazelisk@v2 + - name: Mount bazel cache # Optional + uses: actions/cache@v3 + with: + path: "~/.cache/bazel" + key: bazel + # - shell: bash + # run: bazel build //... \ No newline at end of file