From e2f051a2120176c1f53c18ab69ffd53bf90b1e0c Mon Sep 17 00:00:00 2001 From: A Farzat Date: Mon, 9 Mar 2026 16:55:11 +0300 Subject: Add basic GitLab CI workflow --- .gitlab-ci.yml | 49 +++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 49 insertions(+) create mode 100644 .gitlab-ci.yml diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml new file mode 100644 index 0000000..bbae1fc --- /dev/null +++ b/.gitlab-ci.yml @@ -0,0 +1,49 @@ +stages: + - check + - test + - release + +default: + image: rust:1.93 + cache: + key: "$CI_COMMIT_REF_SLUG" + paths: + - target + - .cargo/registry + - .cargo/git + +check: + stage: check + script: + - cargo fmt --all -- --check + - cargo clippy --all-targets --all-features -- -D warnings + only: + - branches + - tags + +test: + stage: test + script: + - cargo test --all + needs: + - check + only: + - branches + - tags + +release: + stage: release + needs: + - test + # Only run on tags starting with "v" + rules: + - if: '$CI_COMMIT_TAG =~ /^v\d+\.\d+\.\d+$/' + script: + - cargo build --release + - mkdir -p dist + - cp target/release/oreilly-epub dist/oreilly-epub-linux-x86_64 + artifacts: + name: "oreilly-epub-$CI_COMMIT_TAG-linux-x86_64" + paths: + - dist/oreilly-epub-linux-x86_64 + expire_in: 1 week -- cgit v1.2.3-70-g09d2