diff options
Diffstat (limited to '.gitlab-ci.yml')
| -rw-r--r-- | .gitlab-ci.yml | 49 |
1 files changed, 49 insertions, 0 deletions
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 |
