Skip to content

Commit

Permalink
change ci
Browse files Browse the repository at this point in the history
  • Loading branch information
CGQAQ committed Nov 29, 2023
1 parent 5e53229 commit c8fccd7
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 57 deletions.
48 changes: 9 additions & 39 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
28 changes: 10 additions & 18 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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 //...

0 comments on commit c8fccd7

Please sign in to comment.