aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--.gitlab-ci.yml50
-rw-r--r--Cargo.lock2
-rw-r--r--Cargo.toml2
3 files changed, 52 insertions, 2 deletions
diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
new file mode 100644
index 0000000..ac9c060
--- /dev/null
+++ b/.gitlab-ci.yml
@@ -0,0 +1,50 @@
+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:
+ - rustup component add rustfmt
+ - 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
diff --git a/Cargo.lock b/Cargo.lock
index 431dc95..854c173 100644
--- a/Cargo.lock
+++ b/Cargo.lock
@@ -916,7 +916,7 @@ checksum = "04744f49eae99ab78e0d5c0b603ab218f515ea8cfe5a456d7629ad883a3b6e7d"
[[package]]
name = "oreilly-epub"
-version = "0.1.1"
+version = "0.1.2"
dependencies = [
"anyhow",
"clap",
diff --git a/Cargo.toml b/Cargo.toml
index 8f8c301..253dc9e 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -1,6 +1,6 @@
[package]
name = "oreilly-epub"
-version = "0.1.1"
+version = "0.1.2"
edition = "2024"
[dependencies]