From c97d40b068a407a1f93f4a823275eb66ece6e6bb Mon Sep 17 00:00:00 2001 From: changchichung Date: Wed, 2 Sep 2026 09:56:39 +0800 Subject: [PATCH] ci: re-enable Gitea Actions (RCE hook cleaned, clone verified) --- .github/workflows/ci.yml | 28 +++++++++++++++++++++++++ .github/workflows/release.yml | 39 +++++++++++++++++++++++++++++++++++ 2 files changed, 67 insertions(+) create mode 100644 .github/workflows/ci.yml create mode 100644 .github/workflows/release.yml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..43645d8 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,28 @@ +name: CI + +on: + push: + branches: [ main, master ] + pull_request: + branches: [ main, master ] + +jobs: + check: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: dtolnay/rust-toolchain@stable + with: + components: clippy, rustfmt + - name: Format check + run: cargo fmt --check + - name: Check + run: cargo check + - name: Test + run: cargo test --all-features + - name: Clippy + run: cargo clippy --all-targets --all-features -- -D warnings + - name: Build release + run: cargo build --release + - name: Verify binary + run: ./target/release/wipe --help diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..0c31016 --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,39 @@ +name: Release + +on: + push: + tags: + - 'v*' + workflow_dispatch: + +permissions: + contents: write + +jobs: + build: + runs-on: ubuntu-latest + strategy: + matrix: + target: [x86_64-unknown-linux-gnu] + # aarch64-unknown-linux-gnu can be added when cross compilation is stable + steps: + - uses: actions/checkout@v4 + - uses: dtolnay/rust-toolchain@stable + - name: Install target + run: rustup target add ${{ matrix.target }} + - name: Build release + run: cargo build --release --target ${{ matrix.target }} + - name: Package binary + run: | + mkdir -p dist + cp target/${{ matrix.target }}/release/wipe dist/wipe-${{ matrix.target }} + cp target/${{ matrix.target }}/release/wipe dist/wipe + tar -czf dist/wipe-${{ matrix.target }}.tar.gz -C dist wipe-${{ matrix.target }} + sha256sum dist/* > dist/SHA256SUMS + ls -lh dist/ + - name: Create Release + if: startsWith(github.ref, 'refs/tags/') + uses: softprops/action-gh-release@v2 + with: + files: dist/* + generate_release_notes: true