From e9059f2bdff827c01b3dd54a2adae0490fab52a1 Mon Sep 17 00:00:00 2001 From: Akulij Date: Sat, 31 May 2025 14:01:12 +0500 Subject: [PATCH 1/2] create build.yaml workflow to test build on dev branch --- .gitea/workflows/build.yaml | 67 +++++++++++++++++++++++++++++++++++++ 1 file changed, 67 insertions(+) create mode 100644 .gitea/workflows/build.yaml diff --git a/.gitea/workflows/build.yaml b/.gitea/workflows/build.yaml new file mode 100644 index 0000000..49ad2f4 --- /dev/null +++ b/.gitea/workflows/build.yaml @@ -0,0 +1,67 @@ +name: Build && Deploy +on: + push: + branches: + - dev + +jobs: + build: + name: cargo build + runs-on: ubuntu-latest + steps: + - name: Install clang to compile quickjs-ng + run: apt update && apt install -y clang libclang-dev + - name: Restore cached toolchain + id: cache-toolchain + uses: actions/cache/restore@v4 + with: + path: | + ~/.rustup + ~/.cargo + key: linux-rust-toolchainv2 + - name: Install minimal stable with clippy and rustfmt + uses: actions-rs/toolchain@v1 + with: + profile: minimal + toolchain: stable + - name: Save cached toolchain + id: cache-toolchain-save + uses: actions/cache/save@v4 + with: + path: | + ~/.rustup + ~/.cargo + key: ${{ steps.cache-toolchain.outputs.cache-primary-key }} + + - uses: actions/checkout@v4 + + - name: Restore cached cargo dependencies + id: cache-project-dependencies + uses: actions/cache/restore@v4 + with: + path: | + ~/.cargo/bin/ + ~/.cargo/registry/index/ + ~/.cargo/registry/cache/ + ~/.cargo/git/db/ + target + key: linux-project-dependencies + - run: cargo build --release --target x86_64-unknown-linux-gnu + - name: Save cached cargo dependencies + id: cache-project-dependencies-restore + uses: actions/cache/save@v4 + with: + path: | + ~/.cargo/bin/ + ~/.cargo/registry/index/ + ~/.cargo/registry/cache/ + ~/.cargo/git/db/ + target + key: ${{ steps.cache-project-dependencies.outputs.cache-primary-key }} + + - name: Upload Release Binary + id: bot-artifact + uses: christopherhx/gitea-upload-artifact@v4 + with: + name: botrunner + path: target/x86_64-unknown-linux-gnu/release/gongbotrs -- 2.47.2 From 689d191d539bfa5c5966a2c601ba8d269f93e59c Mon Sep 17 00:00:00 2001 From: Akulij Date: Sat, 31 May 2025 14:09:48 +0500 Subject: [PATCH 2/2] cd.yaml: install clang for quickjs-ng compilation --- .gitea/workflows/cd.yaml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.gitea/workflows/cd.yaml b/.gitea/workflows/cd.yaml index cd6fb6d..fbc35b1 100644 --- a/.gitea/workflows/cd.yaml +++ b/.gitea/workflows/cd.yaml @@ -9,6 +9,8 @@ jobs: name: cargo build runs-on: ubuntu-latest steps: + - name: Install clang to compile quickjs-ng + run: apt update && apt install -y clang libclang-dev - name: Restore cached toolchain id: cache-toolchain uses: actions/cache/restore@v4 -- 2.47.2