[workspace]
resolver = "2"
members = [".", "ghactions-core", "ghactions-derive", "ghactions-toolcache"]

[workspace.package]
version = "0.19.0"
license = "MIT"
description = "GitHub Actions Crate"
keywords = ["github", "actions"]
categories = ["development-tools"]

homepage = "https://github.com/42ByteLabs/ghactions"
repository = "https://github.com/42ByteLabs/ghactions"
documentation = "https://docs.rs/ghactions/latest/ghactions/index.html"
authors = ["GeekMasher"]

edition = "2024"
rust-version = "1.85"

readme = "README.md"

[package]
name = "ghactions"
readme = "README.md"
description = "GitHub Actions Crate"

version.workspace = true
documentation.workspace = true
repository.workspace = true
license.workspace = true
edition.workspace = true
rust-version.workspace = true

categories.workspace = true
keywords.workspace = true
authors.workspace = true

[package.metadata.release]
shared-version = true
tag-name = "v{{version}}"

[features]
default = ["log", "macros", "octocrab", "toolcache"]
generate = ["ghactions-derive/generate"]

# Toolcache features
toolcache = ["dep:ghactions-toolcache"]
toolcache-all = ["toolcache", "ghactions-toolcache/all"]
toolcache-tarball = ["toolcache", "ghactions-toolcache/tarball"]
toolcache-zip = ["toolcache", "ghactions-toolcache/zip"]

# Logging
log = ["ghactions-derive/log", "ghactions-core/log", "dep:log"]
dotenvy = ["ghactions-derive/dotenvy"]
# Macros
macros = ["ghactions-core/macros"]
# Octocrab
octocrab = ["ghactions-core/octocrab", "ghactions-toolcache/api"]

[dependencies]
ghactions-core = { version = "^0.19", path = "ghactions-core" }
ghactions-derive = { version = "^0.19", path = "ghactions-derive" }
ghactions-toolcache = { version = "^0.19", path = "ghactions-toolcache", optional = true }

log = { version = "0.4", optional = true }

[dev-dependencies]
ghactions = { path = "./" }
anyhow = "1"
log = "0.4"
dotenvy = "0.15"
octocrab = "^0.49"
http = "^1"
tokio = { version = "1.49", default-features = false, features = [
    "macros",
    "rt-multi-thread",
    "time",
] }

[[example]]
name = "basic"
path = "./examples/basic/src/main.rs"
required-features = ["dotenvy", "octocrab"]

[[example]]
name = "advanced"
path = "./examples/advanced/src/main.rs"
required-features = ["dotenvy", "generate"]

[[example]]
name = "entrypoint"
path = "./examples/entrypoint/src/main.rs"
required-features = ["dotenvy", "generate"]

[[example]]
name = "installer"
path = "./examples/installer/src/main.rs"
required-features = ["dotenvy", "generate"]

[[example]]
name = "jit-compile"
path = "./examples/jit-compile/src/main.rs"
required-features = ["dotenvy", "generate"]

[[example]]
name = "toolcache"
path = "./examples/toolcache.rs"
required-features = ["toolcache"]

