19 Commits

Author SHA1 Message Date
cuddle-please
384e575758 chore(release): 0.3.0
All checks were successful
continuous-integration/drone/pr Build is passing
continuous-integration/drone/push Build is passing
continuous-integration/drone/tag Build is passing
2023-08-13 12:23:58 +00:00
850ada11c2 chore: remove unnused arguments
All checks were successful
continuous-integration/drone/pr Build is passing
continuous-integration/drone/push Build is passing
Signed-off-by: kjuulh <contact@kjuulh.io>
2023-08-13 14:17:30 +02:00
56d33e2ca5 chore(ci): fix release step
Some checks failed
continuous-integration/drone/push Build is passing
continuous-integration/drone/pr Build is failing
Signed-off-by: kjuulh <contact@kjuulh.io>
2023-08-13 14:12:52 +02:00
d64a1d15dc feat(ci): with dagger-rust components
Some checks failed
continuous-integration/drone/push Build is passing
continuous-integration/drone/pr Build is failing
Signed-off-by: kjuulh <contact@kjuulh.io>
2023-08-13 14:10:40 +02:00
c2e0b548f6 chore: add dagger-rust and dagger-cuddle-please
All checks were successful
continuous-integration/drone/push Build is passing
Signed-off-by: kjuulh <contact@kjuulh.io>
2023-08-13 13:39:59 +02:00
51ca73a53b fix(git): make sure we always fail on exit code != 0
Some checks reported errors
continuous-integration/drone/push Build was killed
continuous-integration/drone Build is passing
Signed-off-by: kjuulh <contact@kjuulh.io>
2023-08-12 21:48:18 +02:00
675947ed1e feat: allow v in start of versions
All checks were successful
continuous-integration/drone/push Build is passing
Signed-off-by: kjuulh <contact@kjuulh.io>
2023-08-08 16:15:49 +02:00
bf3593eee4 chore(deps): update rust crate clap to 4.3.21
All checks were successful
continuous-integration/drone/pr Build is passing
continuous-integration/drone/push Build is passing
2023-08-08 02:23:16 +00:00
19d748702a chore(deps): update rust crate clap to 4.3.20
All checks were successful
continuous-integration/drone/pr Build is passing
continuous-integration/drone/push Build is passing
2023-08-08 01:34:57 +00:00
4276f4529c chore(deps): update rust crate parse-changelog to 0.6.2
All checks were successful
continuous-integration/drone/pr Build is passing
continuous-integration/drone/push Build is passing
2023-08-06 10:08:44 +00:00
d287a54cdf chore(deps): update rust crate regex to 1.9.3
All checks were successful
continuous-integration/drone/pr Build is passing
continuous-integration/drone/push Build is passing
2023-08-05 22:31:28 +00:00
7baf51c1f2 chore(deps): update rust crate regex to 1.9.2
All checks were successful
continuous-integration/drone/pr Build is passing
continuous-integration/drone/push Build is passing
2023-08-05 19:04:56 +00:00
56b44cf2e2 fix(json-edit): with actual arg instead of stupid str replace
All checks were successful
continuous-integration/drone/pr Build is passing
continuous-integration/drone/push Build is passing
Signed-off-by: kjuulh <contact@kjuulh.io>
2023-08-04 18:56:43 +02:00
2919ca9a04 chore: remove cr
All checks were successful
continuous-integration/drone/push Build is passing
continuous-integration/drone/pr Build is passing
Signed-off-by: kjuulh <contact@kjuulh.io>
2023-08-04 18:38:11 +02:00
ff2b59dd02 chore(json-edit): clarify errors
All checks were successful
continuous-integration/drone/push Build is passing
continuous-integration/drone/pr Build is passing
Signed-off-by: kjuulh <contact@kjuulh.io>
2023-08-04 18:37:32 +02:00
19dd0ff636 fix(ci): without token
All checks were successful
continuous-integration/drone/push Build is passing
continuous-integration/drone/pr Build is passing
Signed-off-by: kjuulh <contact@kjuulh.io>
2023-08-04 18:36:03 +02:00
c08918ad6f feat(json-edit): added json-edit to update some json content with next global version
Signed-off-by: kjuulh <contact@kjuulh.io>
2023-08-04 18:32:09 +02:00
19e7adfedb fix(docs): check fix version
All checks were successful
continuous-integration/drone/pr Build is passing
continuous-integration/drone/push Build is passing
Signed-off-by: kjuulh <contact@kjuulh.io>
2023-08-04 15:20:05 +02:00
27cb31f433 chore(docs): remove 0.2 checklist
All checks were successful
continuous-integration/drone/push Build is passing
Signed-off-by: kjuulh <contact@kjuulh.io>
2023-08-04 13:05:03 +00:00
16 changed files with 549 additions and 392 deletions

View File

@@ -90,7 +90,6 @@ steps:
- chmod -R 600 ~/.ssh
- ssh-add
- echo "$DOCKER_PASSWORD" | docker login --password-stdin --username="$DOCKER_USERNAME" docker.io
- ldd $CI_PREFIX
- apk add git
- cuddle x ci:main
environment:
@@ -127,18 +126,25 @@ steps:
path: /root/.ssh/
- name: dockersock
path: /var/run
- name: ci
path: /mnt/ci
commands:
- eval `ssh-agent`
- chmod -R 600 ~/.ssh
- ssh-add
- cuddle x build:release:all
- cuddle x deploy:docs:preview
- echo "$DOCKER_PASSWORD" | docker login --password-stdin --username="$DOCKER_USERNAME" docker.io
- apk add git
- cuddle x ci:release
environment:
DOCKER_BUILDKIT: 1
DOCKER_PASSWORD:
from_secret: docker_password
DOCKER_USERNAME:
from_secret: docker_username
CUDDLE_SECRETS_PROVIDER: 1password
CUDDLE_ONE_PASSWORD_DOT_ENV: ".env.ci"
CUDDLE_SSH_AGENT: "true"
CUDDLE_CI: "true"
CI_PREFIX: "/mnt/ci/ci"
CUDDLE_PLEASE_TOKEN:
from_secret: cuddle_please_token
OP_SERVICE_ACCOUNT_TOKEN:

View File

@@ -6,6 +6,34 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
## [Unreleased]
## [0.3.0] - 2023-08-13
### Added
- *(ci)* with dagger-rust components
- allow v in start of versions
- *(json-edit)* added json-edit to update some json content with next global version
### Fixed
- *(git)* make sure we always fail on exit code != 0
- *(json-edit)* with actual arg instead of stupid str replace
- *(ci)* without token
- *(docs)* check fix version
- *(crate)* initial pr always included the entire changelog
- *(crate)* always prefix with 'v' when creating prs, or releases (#9)
### Other
- remove unnused arguments
- *(ci)* fix release step
- add dagger-rust and dagger-cuddle-please
- *(deps)* update rust crate clap to 4.3.21
- *(deps)* update rust crate clap to 4.3.20
- *(deps)* update rust crate parse-changelog to 0.6.2
- *(deps)* update rust crate regex to 1.9.3
- *(deps)* update rust crate regex to 1.9.2
- remove cr
- *(json-edit)* clarify errors
- *(docs)* remove 0.2 checklist
## [0.2.1] - 2023-08-04
### Docs

172
Cargo.lock generated
View File

@@ -19,9 +19,9 @@ checksum = "f26201604c87b1e01bd3d98f8d5d9a8fcbb815e8cedb41ffccbeb4bf593a35fe"
[[package]]
name = "aho-corasick"
version = "1.0.2"
version = "1.0.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "43f6cb1bf222025340178f382c426f13757b2960e89779dfcb319c32542a5a41"
checksum = "86b8f9420f797f2d9e935edf629310eb938a0d839f984e25327f3c7eed22300c"
dependencies = [
"memchr",
]
@@ -82,9 +82,9 @@ dependencies = [
[[package]]
name = "anstyle-wincon"
version = "1.0.1"
version = "1.0.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "180abfa45703aebe0093f79badacc01b8fd4ea2e35118747e5811127f926e188"
checksum = "c677ab05e09154296dd37acecd46420c17b9713e8366facafa8fc0885167cf4c"
dependencies = [
"anstyle",
"windows-sys",
@@ -116,9 +116,9 @@ dependencies = [
[[package]]
name = "async-trait"
version = "0.1.72"
version = "0.1.73"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "cc6dde6e4ed435a4c1ee4e73592f5ba9da2151af10076cc04858746af9352d09"
checksum = "bc00ceb34980c03614e35a3a4e218276a0a824e911d07651cd0d858a51e8c0f0"
dependencies = [
"proc-macro2",
"quote",
@@ -160,9 +160,9 @@ checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a"
[[package]]
name = "bitflags"
version = "2.3.3"
version = "2.4.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "630be753d4e58660abd17930c71b647fe46c27ea6b63cc59e1e3851406972e42"
checksum = "b4682ae6287fcf752ecaabbfcc7b6f9b72aa33933dc23a554d853aea8eea8635"
[[package]]
name = "block-buffer"
@@ -203,11 +203,12 @@ checksum = "89b2fd2a0dcf38d7971e2194b6b6eebab45ae01067456a7fd93d5547a61b70be"
[[package]]
name = "cc"
version = "1.0.79"
version = "1.0.82"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "50d30906286121d95be3d479533b458f87493b30a4b5f79a607db8f5d11aa91f"
checksum = "305fe645edc1442a0fa8b6726ba61d422798d37a52e12eaecf4b022ebbb88f01"
dependencies = [
"jobserver",
"libc",
]
[[package]]
@@ -260,6 +261,8 @@ dependencies = [
"async-scoped",
"clap",
"color-eyre",
"dagger-cuddle-please",
"dagger-rust",
"dagger-sdk",
"dotenv",
"eyre",
@@ -269,9 +272,9 @@ dependencies = [
[[package]]
name = "clap"
version = "4.3.19"
version = "4.3.21"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "5fd304a20bff958a57f04c4e96a2e7594cc4490a0e809cbd48bb6437edaa452d"
checksum = "c27cdf28c0f604ba3f512b0c9a409f8de8513e4816705deb0498b627e7c3a3fd"
dependencies = [
"clap_builder",
"clap_derive",
@@ -280,9 +283,9 @@ dependencies = [
[[package]]
name = "clap_builder"
version = "4.3.19"
version = "4.3.21"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "01c6a3f08f1fe5662a35cfe393aec09c4df95f60ee93b7556505260f75eee9e1"
checksum = "08a9f1ab5e9f01a9b81f202e8562eb9a10de70abf9eaeac1be465c28b75aa4aa"
dependencies = [
"anstream",
"anstyle",
@@ -520,6 +523,19 @@ dependencies = [
"url",
]
[[package]]
name = "cuddle-please-release-strategy"
version = "0.1.0"
dependencies = [
"anyhow",
"pretty_assertions",
"semver",
"serde",
"tempdir",
"tracing",
"tracing-test",
]
[[package]]
name = "dagger-core"
version = "0.2.11"
@@ -546,6 +562,29 @@ dependencies = [
"tracing-subscriber",
]
[[package]]
name = "dagger-cuddle-please"
version = "0.2.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "e172f7c5561341f005b999d4eb28f07952e2bf6e305469e86ff19ee2f6054c9e"
dependencies = [
"async-trait",
"dagger-sdk",
"eyre",
]
[[package]]
name = "dagger-rust"
version = "0.2.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "43c459f3fb8e1e60912086f9bda6f71d9b83cb0803661deba7e35cf8f05ed5f1"
dependencies = [
"async-trait",
"dagger-sdk",
"eyre",
"tokio",
]
[[package]]
name = "dagger-sdk"
version = "0.2.22"
@@ -743,13 +782,13 @@ checksum = "6999dc1837253364c2ebb0704ba97994bd874e8f195d665c50b7548f6ea92764"
[[package]]
name = "filetime"
version = "0.2.21"
version = "0.2.22"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "5cbc844cecaee9d4443931972e1289c8ff485cb4cc2767cb03ca139ed6885153"
checksum = "d4029edd3e734da6fe05b6cd7bd2960760a616bd2ddd0d59a0124746d6272af0"
dependencies = [
"cfg-if",
"libc",
"redox_syscall 0.2.16",
"redox_syscall 0.3.5",
"windows-sys",
]
@@ -971,9 +1010,9 @@ checksum = "d2fabcfbdc87f4758337ca535fb41a6d701b65693ce38287d856d1674551ec9b"
[[package]]
name = "globset"
version = "0.4.12"
version = "0.4.13"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "aca8bbd8e0707c1887a8bbb7e6b40e228f251ff5d62c8220a4a7a53c73aff006"
checksum = "759c97c1e17c55525b57192c06a267cda0ac5210b222d6b82189a2338fa1c13d"
dependencies = [
"aho-corasick",
"bstr",
@@ -1137,9 +1176,9 @@ checksum = "d897f394bad6a705d5f4104762e116a75639e470d80901eed05a860a95cb1904"
[[package]]
name = "httpdate"
version = "1.0.2"
version = "1.0.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "c4a1e36c821dbe04574f602848a19f742f4fb3c98d40449f11bcad18d6b17421"
checksum = "df3b46402a9d5adb4c86a0cf463f42e19994e3ee891101b1841f30a545cb49a9"
[[package]]
name = "humansize"
@@ -1167,7 +1206,7 @@ dependencies = [
"httpdate",
"itoa",
"pin-project-lite",
"socket2",
"socket2 0.4.9",
"tokio",
"tower-service",
"tracing",
@@ -1420,9 +1459,9 @@ dependencies = [
[[package]]
name = "log"
version = "0.4.19"
version = "0.4.20"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "b06a4cde4c0f271a446782e3eff8de789548ce57dbc8eca9292c27f4a42004b4"
checksum = "b5e6163cb8c49088c2c36f57875e58ccd8c87c7427f7fbd50ea6710b2f3f2e8f"
[[package]]
name = "matchers"
@@ -1545,9 +1584,9 @@ checksum = "dd8b5dd2ae5ed71462c540258bedcb51965123ad7e7ccf4b9a8cafaa4a63576d"
[[package]]
name = "openssl"
version = "0.10.55"
version = "0.10.56"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "345df152bc43501c5eb9e4654ff05f794effb78d4efe3d53abc158baddc0703d"
checksum = "729b745ad4a5575dd06a3e1af1414bd330ee561c01b3899eb584baeaa8def17e"
dependencies = [
"bitflags 1.3.2",
"cfg-if",
@@ -1577,9 +1616,9 @@ checksum = "ff011a302c396a5197692431fc1948019154afc178baf7d8e37367442a4601cf"
[[package]]
name = "openssl-sys"
version = "0.9.90"
version = "0.9.91"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "374533b0e45f3a7ced10fcaeccca020e66656bc03dac384f852e4e5a7a8104a6"
checksum = "866b5f16f90776b9bb8dc1e1802ac6f0513de3a7a7465867bfbc563dc737faac"
dependencies = [
"cc",
"libc",
@@ -1624,9 +1663,9 @@ dependencies = [
[[package]]
name = "parse-changelog"
version = "0.6.1"
version = "0.6.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "39a24196a65fc15a0a747df8c041abc5a009f2c09c550b0a14f7eeb0c10255ef"
checksum = "4b9325ebdf7f45ff257f87e1ab938263ec03abfc5495f02d5445224b56c055a7"
dependencies = [
"anyhow",
"indexmap 2.0.0",
@@ -1744,18 +1783,18 @@ dependencies = [
[[package]]
name = "pin-project"
version = "1.1.2"
version = "1.1.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "030ad2bc4db10a8944cb0d837f158bdfec4d4a4873ab701a95046770d11f8842"
checksum = "fda4ed1c6c173e3fc7a83629421152e01d7b1f9b7f65fb301e490e8cfc656422"
dependencies = [
"pin-project-internal",
]
[[package]]
name = "pin-project-internal"
version = "1.1.2"
version = "1.1.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "ec2e072ecce94ec471b13398d5402c188e76ac03cf74dd1a975161b23a3f6d9c"
checksum = "4359fd9c9171ec6e8c62926d6faaf553a8dc3f64e1507e76da7911b4f6a04405"
dependencies = [
"proc-macro2",
"quote",
@@ -1764,9 +1803,9 @@ dependencies = [
[[package]]
name = "pin-project-lite"
version = "0.2.10"
version = "0.2.12"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "4c40d25201921e5ff0c862a505c6557ea88568a4e3ace775ab55e93f2f4f9d57"
checksum = "12cc1b0bf1727a77a54b6654e7b5f1af8604923edc8b81885f8ec92f9e3f0a05"
[[package]]
name = "pin-utils"
@@ -1922,13 +1961,13 @@ dependencies = [
[[package]]
name = "regex"
version = "1.9.1"
version = "1.9.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "b2eae68fc220f7cf2532e4494aded17545fce192d59cd996e0fe7887f4ceb575"
checksum = "81bc1d4caf89fac26a70747fe603c130093b53c773888797a6329091246d651a"
dependencies = [
"aho-corasick",
"memchr",
"regex-automata 0.3.4",
"regex-automata 0.3.6",
"regex-syntax 0.7.4",
]
@@ -1943,9 +1982,9 @@ dependencies = [
[[package]]
name = "regex-automata"
version = "0.3.4"
version = "0.3.6"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "b7b6d6190b7594385f61bd3911cd1be99dfddcfc365a4160cc2ab5bff4aed294"
checksum = "fed1ceff11a1dddaee50c9dc8e4938bd106e9d89ae372f192311e7da498e3b69"
dependencies = [
"aho-corasick",
"memchr",
@@ -2074,11 +2113,11 @@ checksum = "d626bb9dae77e28219937af045c257c28bfd3f69333c512553507f5f9798cb76"
[[package]]
name = "rustix"
version = "0.38.4"
version = "0.38.8"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "0a962918ea88d644592894bc6dc55acc6c0956488adcebbfb6e273506b7fd6e5"
checksum = "19ed4fa021d81c8392ce04db050a3da9a60299050b7ae1cf482d862b54a7218f"
dependencies = [
"bitflags 2.3.3",
"bitflags 2.4.0",
"errno",
"libc",
"linux-raw-sys",
@@ -2108,9 +2147,9 @@ dependencies = [
[[package]]
name = "rustls-webpki"
version = "0.101.2"
version = "0.101.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "513722fd73ad80a71f72b61009ea1b584bcfa1483ca93949c8f290298837fa59"
checksum = "261e9e0888cba427c3316e6322805653c9425240b6fd96cee7cb671ab70ab8d0"
dependencies = [
"ring",
"untrusted",
@@ -2187,18 +2226,18 @@ checksum = "b0293b4b29daaf487284529cc2f5675b8e57c61f70167ba415a463651fd6a918"
[[package]]
name = "serde"
version = "1.0.180"
version = "1.0.183"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "0ea67f183f058fe88a4e3ec6e2788e003840893b91bac4559cabedd00863b3ed"
checksum = "32ac8da02677876d532745a130fc9d8e6edfa81a269b107c5b00829b91d8eb3c"
dependencies = [
"serde_derive",
]
[[package]]
name = "serde_derive"
version = "1.0.180"
version = "1.0.183"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "24e744d7782b686ab3b73267ef05697159cc0e5abbed3f47f9933165e5219036"
checksum = "aafe972d60b0b9bee71a91b92fee2d4fb3c9d7e8f6b179aa99f27203d99a4816"
dependencies = [
"proc-macro2",
"quote",
@@ -2329,6 +2368,16 @@ dependencies = [
"winapi",
]
[[package]]
name = "socket2"
version = "0.5.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "2538b18701741680e0322a2302176d3253a35388e2e62f172f64f4f16605f877"
dependencies = [
"libc",
"windows-sys",
]
[[package]]
name = "spin"
version = "0.5.2"
@@ -2365,9 +2414,9 @@ dependencies = [
[[package]]
name = "tar"
version = "0.4.39"
version = "0.4.40"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "ec96d2ffad078296368d46ff1cb309be1c23c513b4ab0e22a45de0185275ac96"
checksum = "b16afcea1f22891c49a00c751c7b63b2233284064f11a200fc624137c51e2ddb"
dependencies = [
"filetime",
"libc",
@@ -2386,9 +2435,9 @@ dependencies = [
[[package]]
name = "tempfile"
version = "3.7.0"
version = "3.7.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "5486094ee78b2e5038a6382ed7645bc084dc2ec433426ca4c3cb61e2007b8998"
checksum = "dc02fddf48964c42031a0b3fe0428320ecf3a73c401040fc0096f97794310651"
dependencies = [
"cfg-if",
"fastrand",
@@ -2477,11 +2526,10 @@ checksum = "1f3ccbac311fea05f86f61904b462b55fb3df8837a366dfc601a0161d0532f20"
[[package]]
name = "tokio"
version = "1.29.1"
version = "1.31.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "532826ff75199d5833b9d2c5fe410f29235e25704ee5f0ef599fb51c21f4a4da"
checksum = "40de3a2ba249dcb097e01be5e67a5ff53cf250397715a071a81543e8a832a920"
dependencies = [
"autocfg",
"backtrace",
"bytes",
"libc",
@@ -2490,7 +2538,7 @@ dependencies = [
"parking_lot",
"pin-project-lite",
"signal-hook-registry",
"socket2",
"socket2 0.5.3",
"tokio-macros",
"windows-sys",
]
@@ -3101,9 +3149,9 @@ checksum = "1a515f5799fe4961cb532f983ce2b23082366b898e52ffbce459c86f67c8378a"
[[package]]
name = "winnow"
version = "0.5.2"
version = "0.5.10"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "8bd122eb777186e60c3fdf765a58ac76e41c582f1f535fbf3314434c6b58f3f7"
checksum = "5504cc7644f4b593cbc05c4a55bf9bd4e94b867c3c0bd440934174d50482427d"
dependencies = [
"memchr",
]
@@ -3119,9 +3167,9 @@ dependencies = [
[[package]]
name = "xattr"
version = "0.2.3"
version = "1.0.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "6d1526bbe5aaeb5eb06885f4d987bcdfa5e23187055de9b83fe00156a821fabc"
checksum = "f4686009f71ff3e5c4dbcf1a282d0a44db3f021ba69350cd42086b3e5f1c6985"
dependencies = [
"libc",
]

View File

@@ -4,6 +4,7 @@ members = [
"crates/cuddle-please-frontend",
"crates/cuddle-please-commands",
"crates/cuddle-please-misc",
"crates/cuddle-please-release-strategy",
"ci"
]
resolver = "2"
@@ -13,11 +14,12 @@ cuddle-please = { path = "crates/cuddle-please", version = "0.1.0" }
cuddle-please-frontend = { path = "crates/cuddle-please-frontend", version = "0.1.0" }
cuddle-please-commands = { path = "crates/cuddle-please-commands", version = "0.1.0" }
cuddle-please-misc = { path = "crates/cuddle-please-misc", version = "0.1.0" }
cuddle-please-release-strategy = { path = "crates/cuddle-please-release-strategy", version = "0.1.0" }
anyhow = { version = "1.0.72" }
tracing = { version = "0.1", features = ["log"] }
tracing-subscriber = { version = "0.3.17", features = ["env-filter"] }
clap = { version = "4.3.19", features = ["derive", "env"] }
clap = { version = "4.3.21", features = ["derive", "env"] }
dotenv = { version = "0.15.0" }
url = { version = "2.4.0" }
serde_yaml = { version = "0.9.25" }
@@ -27,10 +29,10 @@ conventional_commit_parser = "0.9.4"
tempdir = "0.3.7"
reqwest = { version = "0.11.18" }
git-cliff-core = "1.2.0"
regex = "1.9.1"
regex = "1.9.3"
chrono = "0.4.26"
lazy_static = "1.4.0"
parse-changelog = "0.6.1"
parse-changelog = "0.6.2"
tracing-test = "0.2"
pretty_assertions = "1.4"

View File

@@ -36,20 +36,9 @@ See docs for more information about installation and some such
## Checklist
### 0.2 Milestone
- [x] Add docs
- [ ] Add asciinema
- [x] Create docker image
- [x] Add examples
- [x] Fx drone config
- [x] Releaser
- [x] On main/master
- [ ] tbd...
### 0.3 Milestone
- [ ] Fix: 0.0.0 -> **v**0.0.0
- [x] Fix: 0.0.0 -> **v**0.0.0
- [ ] Add release strategies
- [ ] Add reporter for PR and Repositories
- [ ] Add inquire for missing values when needed (when not running in ci or have a proper tty)

View File

@@ -14,3 +14,5 @@ clap = {version = "4", features = ["derive"]}
futures = "0.3.28"
async-scoped = { version = "0.7.1", features = ["tokio", "use-tokio"] }
dotenv.workspace = true
dagger-rust = "0.2.0"
dagger-cuddle-please = "0.2.0"

View File

@@ -7,9 +7,8 @@ use clap::Parser;
use clap::Subcommand;
use clap::ValueEnum;
use dagger_sdk::Platform;
use dagger_sdk::QueryContainerOpts;
use futures::StreamExt;
use dagger_rust::build::RustVersion;
use dagger_rust::build::SlimImage;
use crate::please_release::run_release_please;
@@ -31,10 +30,6 @@ pub enum Commands {
command: LocalCommands,
},
PullRequest {
#[arg(long)]
image: String,
#[arg(long)]
tag: String,
#[arg(long)]
bin_name: String,
},
@@ -46,7 +41,14 @@ pub enum Commands {
#[arg(long)]
bin_name: String,
},
Release,
Release {
#[arg(long)]
image: String,
#[arg(long)]
tag: String,
#[arg(long)]
bin_name: String,
},
}
#[derive(Subcommand, Clone)]
@@ -112,48 +114,65 @@ async fn main() -> eyre::Result<()> {
let cli = Command::parse();
let crates = &["crates/*", "ci"];
let debian_deps = &["libssl-dev", "pkg-config", "openssl", "git", "jq"];
let debian_image = "debian:bullseye".to_string();
match &cli.commands {
Commands::Local { command } => match command {
LocalCommands::Build {
profile: _,
bin_name,
} => {
let base_image = base_rust_image(
client.clone(),
&cli.global,
&None,
&bin_name.clone(),
&"release".into(),
)
.await?;
let prod_image = get_base_debian_image(client.clone(), &cli.global, None).await?;
build::execute(
client,
&cli.global,
&base_image,
&prod_image,
bin_name,
&None,
)
.await?;
dagger_rust::build::RustBuild::new(client.clone())
.build_release(
None::<PathBuf>,
RustVersion::Nightly,
crates,
debian_deps,
vec![SlimImage::Debian {
image: debian_image,
deps: debian_deps
.iter()
.map(|s| s.to_string())
.collect::<Vec<_>>(),
architecture: dagger_rust::build::BuildArchitecture::Amd64,
}],
&bin_name,
)
.await?;
}
LocalCommands::Test => {
let base_image = base_rust_image(
client.clone(),
&cli.global,
&None,
&"cuddle-please".into(),
&"debug".into(),
)
.await?;
test::execute(client, &cli.global, base_image).await?;
dagger_rust::test::RustTest::new(client.clone())
.test(None::<PathBuf>, RustVersion::Nightly, crates, debian_deps)
.await?;
}
LocalCommands::DockerImage {
tag,
image,
bin_name,
} => {
build::build_and_deploy(client, &cli.global, bin_name, image, tag).await?;
let images = dagger_rust::build::RustBuild::new(client.clone())
.build_release(
None::<PathBuf>,
RustVersion::Nightly,
crates,
debian_deps,
vec![SlimImage::Debian {
image: debian_image,
deps: debian_deps
.iter()
.map(|s| s.to_string())
.collect::<Vec<_>>(),
architecture: dagger_rust::build::BuildArchitecture::Amd64,
}],
&bin_name,
)
.await?;
dagger_rust::publish::RustPublish::new(client.clone())
.publish(image, tag, images)
.await?;
}
LocalCommands::PleaseRelease => todo!(),
LocalCommands::BuildDocs {} => {
@@ -165,69 +184,90 @@ async fn main() -> eyre::Result<()> {
.await?;
}
},
Commands::PullRequest {
image,
tag,
bin_name,
} => {
async fn test(client: Arc<dagger_sdk::Query>, cli: &Command, bin_name: &String) {
let args = &cli.global;
Commands::PullRequest { bin_name } => {
async fn test(client: Arc<dagger_sdk::Query>) {
let crates = &["crates/*", "ci"];
let debian_deps = &["libssl-dev", "pkg-config", "openssl", "git", "jq"];
let base_image =
base_rust_image(client.clone(), args, &None, bin_name, &"debug".into())
.await
.unwrap();
test::execute(client.clone(), args, base_image)
dagger_rust::test::RustTest::new(client.clone())
.test(None::<PathBuf>, RustVersion::Nightly, crates, debian_deps)
.await
.unwrap();
.expect("rust to test crates");
}
async fn build(
client: Arc<dagger_sdk::Query>,
cli: &Command,
bin_name: &String,
image: &String,
tag: &String,
) {
let args = &cli.global;
async fn build(client: Arc<dagger_sdk::Query>, bin_name: &String) {
let crates = &["crates/*", "ci"];
let debian_deps = &["libssl-dev", "pkg-config", "openssl", "git", "jq"];
let debian_image = "debian:bullseye".to_string();
build::build(client.clone(), args, bin_name, image, tag)
dagger_rust::build::RustBuild::new(client.clone())
.build_release(
None::<PathBuf>,
RustVersion::Nightly,
crates,
debian_deps,
vec![SlimImage::Debian {
image: debian_image,
deps: debian_deps
.iter()
.map(|s| s.to_string())
.collect::<Vec<_>>(),
architecture: dagger_rust::build::BuildArchitecture::Amd64,
}],
&bin_name,
)
.await
.unwrap();
.expect("dagger rust to build crates");
}
tokio::join!(
test(client.clone(), &cli, bin_name),
build(client.clone(), &cli, bin_name, image, tag),
);
tokio::join!(test(client.clone()), build(client.clone(), bin_name),);
}
Commands::Main {
image,
tag,
bin_name,
} => {
async fn test(client: Arc<dagger_sdk::Query>, cli: &Command, bin_name: &String) {
let args = &cli.global;
async fn test(client: Arc<dagger_sdk::Query>) {
let crates = &["crates/*", "ci"];
let debian_deps = &["libssl-dev", "pkg-config", "openssl", "git", "jq"];
let base_image =
base_rust_image(client.clone(), args, &None, bin_name, &"debug".into())
.await
.unwrap();
test::execute(client.clone(), args, base_image)
dagger_rust::test::RustTest::new(client.clone())
.test(None::<PathBuf>, RustVersion::Nightly, crates, debian_deps)
.await
.unwrap();
.expect("rust to test crates");
}
async fn build(
client: Arc<dagger_sdk::Query>,
cli: &Command,
bin_name: &String,
image: &String,
tag: &String,
) {
let args = &cli.global;
let crates = &["crates/*", "ci"];
let debian_deps = &["libssl-dev", "pkg-config", "openssl", "git", "jq"];
let debian_image = "debian:bullseye".to_string();
build::build_and_deploy(client.clone(), args, bin_name, image, tag)
let images = dagger_rust::build::RustBuild::new(client.clone())
.build_release(
None::<PathBuf>,
RustVersion::Nightly,
crates,
debian_deps,
vec![SlimImage::Debian {
image: debian_image,
deps: debian_deps
.iter()
.map(|s| s.to_string())
.collect::<Vec<_>>(),
architecture: dagger_rust::build::BuildArchitecture::Amd64,
}],
&bin_name,
)
.await
.unwrap();
.expect("rust build to build release crates");
dagger_rust::publish::RustPublish::new(client.clone())
.publish(image, tag, images)
.await
.expect("rust publish to publish crates");
}
async fn cuddle_please(client: Arc<dagger_sdk::Query>, cli: &Command) {
@@ -237,12 +277,53 @@ async fn main() -> eyre::Result<()> {
}
tokio::join!(
test(client.clone(), &cli, bin_name),
build(client.clone(), &cli, bin_name, image, tag),
test(client.clone()),
build(client.clone(), bin_name, image, tag),
cuddle_please(client.clone(), &cli)
);
}
Commands::Release => todo!(),
Commands::Release {
image,
tag,
bin_name,
} => {
async fn build(
client: Arc<dagger_sdk::Query>,
bin_name: &String,
image: &String,
tag: &String,
) {
let crates = &["crates/*", "ci"];
let debian_deps = &["libssl-dev", "pkg-config", "openssl", "git", "jq"];
let debian_image = "debian:bullseye".to_string();
let images = dagger_rust::build::RustBuild::new(client.clone())
.build_release(
None::<PathBuf>,
RustVersion::Nightly,
crates,
debian_deps,
vec![SlimImage::Debian {
image: debian_image,
deps: debian_deps
.iter()
.map(|s| s.to_string())
.collect::<Vec<_>>(),
architecture: dagger_rust::build::BuildArchitecture::Amd64,
}],
&bin_name,
)
.await
.expect("rust build to build release crates");
dagger_rust::publish::RustPublish::new(client.clone())
.publish(image, tag, images)
.await
.expect("rust publish to publish crates");
}
build(client.clone(), bin_name, image, tag).await;
}
}
Ok(())
@@ -306,12 +387,6 @@ mod please_release {
std::env::var("CUDDLE_PLEASE_TOKEN")?
),
])
.with_exec(vec![
"git",
"config",
"http.extraheader",
"'Authorization: token b52c18cab8a95d33f34b0d081440f77a2b156886'",
])
.with_exec(vec![
"cuddle-please",
"release",
@@ -384,230 +459,6 @@ mod docs {
Ok(dep_image)
}
pub async fn publish(
client: Arc<dagger_sdk::Query>,
args: &GlobalArgs,
containers: &Vec<dagger_sdk::Container>,
) -> eyre::Result<()> {
let container_ids =
futures::future::join_all(containers.iter().map(|c| c.id()).collect::<Vec<_>>()).await;
let container_ids = container_ids
.into_iter()
.collect::<eyre::Result<Vec<dagger_sdk::ContainerId>>>()?;
client
.container()
.publish_opts(
format!(
"{}:{}",
args.docs_image.as_ref().expect("--docs-image to be set"),
args.docs_image_tag
.as_ref()
.expect("--docs-image-tag to be set")
),
dagger_sdk::ContainerPublishOpts {
platform_variants: Some(container_ids),
},
)
.await?;
Ok(())
}
}
mod build {
use std::sync::Arc;
use dagger_sdk::Container;
use crate::{base_rust_image, get_base_debian_image, GlobalArgs};
pub async fn build_and_deploy(
client: Arc<dagger_sdk::Query>,
args: &GlobalArgs,
bin_name: &String,
image: &String,
tag: &String,
) -> eyre::Result<()> {
// let containers = vec!["linux/amd64", "linux/arm64"];
let base_image = get_base_debian_image(
client.clone(),
&args.clone(),
Some("linux/amd64".to_string()),
)
.await?;
let container = base_rust_image(
client.clone(),
args,
&Some("linux/amd64".to_string()),
&bin_name.clone(),
&"release".into(),
)
.await?;
let build_image = execute(
client.clone(),
args,
&container,
&base_image,
bin_name,
&Some("linux/amd64".to_string()),
)
.await?;
let build_id = build_image.id().await?;
let _container = client
.clone()
.container()
.publish_opts(
format!("{image}:{tag}"),
dagger_sdk::ContainerPublishOpts {
platform_variants: Some(vec![build_id]),
},
)
.await?;
Ok(())
}
pub async fn build(
client: Arc<dagger_sdk::Query>,
args: &GlobalArgs,
bin_name: &String,
_image: &String,
_tag: &String,
) -> eyre::Result<()> {
// let containers = vec!["linux/amd64", "linux/arm64"];
let base_image = get_base_debian_image(
client.clone(),
&args.clone(),
Some("linux/amd64".to_string()),
)
.await?;
let container = base_rust_image(
client.clone(),
args,
&Some("linux/amd64".to_string()),
&bin_name.clone(),
&"release".into(),
)
.await?;
let build_image = execute(
client.clone(),
args,
&container,
&base_image,
bin_name,
&Some("linux/amd64".to_string()),
)
.await?;
build_image.exit_code().await?;
Ok(())
}
pub async fn execute(
_client: Arc<dagger_sdk::Query>,
_args: &GlobalArgs,
container: &dagger_sdk::Container,
base_image: &dagger_sdk::Container,
bin_name: &String,
platform: &Option<String>,
) -> eyre::Result<Container> {
let rust_target = match platform
.clone()
.unwrap_or("linux/amd64".to_string())
.as_str()
{
"linux/amd64" => "x86_64-unknown-linux-gnu",
"linux/arm64" => "aarch64-unknown-linux-gnu",
_ => eyre::bail!("architecture not supported"),
};
let build_image = container.with_exec(vec![
"cargo",
"build",
"--target",
rust_target,
"--release",
"-p",
bin_name,
]);
let final_image = base_image
.with_file(
format!("/usr/local/bin/{}", &bin_name),
build_image
.file(format!("target/{}/release/{}", rust_target, &bin_name))
.id()
.await?,
)
.with_exec(vec![bin_name, "--help"]);
let output = final_image.stdout().await?;
println!("{output}");
//.with_entrypoint(vec![&bin_name, "--log-level=debug"]);
Ok(final_image)
}
}
mod test {
use std::sync::Arc;
use crate::GlobalArgs;
pub async fn execute(
_client: Arc<dagger_sdk::Query>,
_args: &GlobalArgs,
container: dagger_sdk::Container,
) -> eyre::Result<()> {
let test_image = container
.pipeline("rust:test")
.with_exec(vec!["apt", "update"])
.with_exec(vec!["apt", "install", "-y", "git"])
.with_exec(vec!["cargo", "test"]);
test_image.exit_code().await?;
Ok(())
}
}
pub async fn get_base_debian_image(
client: Arc<dagger_sdk::Query>,
args: &GlobalArgs,
platform: Option<String>,
) -> eyre::Result<dagger_sdk::Container> {
let default_platform = client.default_platform().await?;
let platform = platform.map(Platform).unwrap_or(default_platform);
let image = client
.container_opts(QueryContainerOpts {
id: None,
platform: Some(platform),
})
.from(
args.production_image
.clone()
.unwrap_or("debian:bullseye".to_string()),
);
let base_image = image.with_exec(vec!["apt", "update"]).with_exec(vec![
"apt",
"install",
"-y",
"libssl-dev",
"pkg-config",
"openssl",
"git",
]);
Ok(base_image)
}
pub fn get_src(
@@ -725,7 +576,9 @@ pub async fn base_rust_image(
.as_ref()
.unwrap_or(&"rustlang/rust:nightly".into()),
)
.with_exec(vec!["rustup", "target", "add", rust_target]);
.with_exec(vec!["rustup", "target", "add", rust_target])
.with_exec(vec!["apt", "update"])
.with_exec(vec!["apt", "install", "-y", "jq"]);
let target_cache = client.cache_volume(format!("rust_target_{}", profile));
let mut build_options = vec!["cargo", "build", "--target", rust_target, "-p", bin_name];

View File

@@ -79,6 +79,13 @@ impl VcsClient {
let stdout = std::str::from_utf8(&checkout_branch.stdout)?;
let stderr = std::str::from_utf8(&checkout_branch.stderr)?;
tracing::debug!(stdout = stdout, stderr = stderr, "git {}", args.join(" "));
let exit_code = checkout_branch.status;
if !exit_code.success() {
anyhow::bail!(
"failed to run git command: {}",
exit_code.code().unwrap_or(-1)
)
}
}
}

View File

@@ -517,6 +517,7 @@ impl TryFrom<Tag> for Version {
tracing::trace!(name = &value.name, "parsing tag into version");
value
.name
.trim_start_matches("v")
.parse::<Version>()
.context("could not get version from tag")
}

View File

@@ -0,0 +1,31 @@
[package]
name = "cuddle-please-release-strategy"
description = "A release-please inspired release manager tool, built on top of cuddle, but also useful standalone, cuddle-please supports, your ci of choice, as well as gitea, github"
repository = "https://git.front.kjuulh.io/kjuulh/cuddle-please"
version = "0.1.0"
edition = "2021"
readme = "../../README.md"
license-file = "../../LICENSE"
publishable = true
[dependencies]
anyhow.workspace = true
tracing.workspace = true
serde.workspace = true
semver.workspace = true
[dev-dependencies]
tracing-test = { workspace = true, features = ["no-env-filter"] }
pretty_assertions.workspace = true
tempdir.workspace = true
[features]
rust-workspace = []
rust-crate = []
toml-edit = []
json-edit = []
yaml-edit = []
default = [
"json-edit"
]

View File

@@ -0,0 +1,60 @@
use std::path::Path;
use anyhow::Context;
use serde::{Deserialize, Serialize};
#[derive(Clone, Debug, Serialize, Deserialize)]
pub struct JsonEditOptions {
pub jq: String,
}
impl JsonEditOptions {
pub fn execute(&self, path: &Path, next_version: impl AsRef<str>) -> anyhow::Result<()> {
let next_version = next_version.as_ref();
if !path.exists() {
anyhow::bail!("could not find file at: {}", path.display());
}
if let Ok(metadata) = path.metadata() {
if !metadata.is_file() {
anyhow::bail!("{} is not a file", path.display());
}
}
let abs_path = path.canonicalize().context(anyhow::anyhow!(
"could not get absolute path from {}",
path.display()
))?;
let output = std::process::Command::new("jq")
.arg("--arg")
.arg("version")
.arg(next_version)
.arg(&self.jq)
.arg(
abs_path
.to_str()
.ok_or(anyhow::anyhow!("path contains non utf-8 chars"))?,
)
.output()
.context(anyhow::anyhow!(
"failed to run jq on file, jq may not be installed or query was invalid"
))?;
if !output.status.success() {
let err_content = std::str::from_utf8(output.stderr.as_slice())?;
anyhow::bail!("failed to run jq with output: {}", err_content);
}
let edited_json_content = std::str::from_utf8(output.stdout.as_slice())?;
tracing::trace!(
new_content = edited_json_content,
file = &abs_path.display().to_string(),
"applied jq to file"
);
std::fs::write(abs_path, edited_json_content)?;
Ok(())
}
}

View File

@@ -0,0 +1,6 @@
#[cfg(feature = "json-edit")]
mod json_edit;
mod strategy;
#[cfg(feature = "json-edit")]
pub use json_edit::JsonEditOptions;

View File

@@ -0,0 +1,59 @@
use std::path::PathBuf;
use serde::{Deserialize, Serialize};
pub struct UpdateOptions {
next_version: String,
global_changelog: String,
}
pub type Projects = Vec<Project>;
#[derive(Clone, Debug, Deserialize, Serialize)]
pub struct Project {
path: Option<PathBuf>,
r#type: ProjectType,
}
#[derive(Clone, Debug, Deserialize, Serialize)]
#[serde(tag = "type")]
pub enum ProjectType {
#[cfg(feature = "rust-workspace")]
#[serde(alias = "rust_workspace")]
RustWorkspace,
#[cfg(feature = "rust-crate")]
#[serde(alias = "json_edit")]
RustCrate,
#[cfg(feature = "toml-edit")]
#[serde(alias = "toml_edit")]
TomlEdit,
#[cfg(feature = "yaml-edit")]
#[serde(alias = "yaml_edit")]
YamlEdit,
#[cfg(feature = "json-edit")]
#[serde(alias = "json_edit")]
JsonEdit,
}
impl Project {
pub fn new(path: Option<PathBuf>, r#type: ProjectType) -> Self {
Self { path, r#type }
}
pub fn execute(&self, options: &UpdateOptions) -> anyhow::Result<()> {
match self.r#type {
#[cfg(feature = "rust-workspace")]
ProjectType::RustWorkspace => todo!(),
#[cfg(feature = "rust-crate")]
ProjectType::RustCrate => todo!(),
#[cfg(feature = "toml-edit")]
ProjectType::TomlEdit => todo!(),
#[cfg(feature = "yaml-edit")]
ProjectType::YamlEdit => todo!(),
#[cfg(feature = "json-edit")]
ProjectType::JsonEdit => todo!(),
}
Ok(())
}
}

View File

@@ -0,0 +1,50 @@
use tracing_test::traced_test;
#[test]
#[traced_test]
#[cfg(feature = "json-edit")]
pub fn test_can_update_version_in_jq() {
use cuddle_please_release_strategy::JsonEditOptions;
let dir = tempdir::TempDir::new("can_update_version_in_jq").unwrap();
let dir_path = dir.path();
let json_file = dir_path.join("some-test.json");
let initial_content = r#"{
"some": {
"nested": [
{
"structure": {
"version": "v1.0.1"
}
}
]
}
}
"#;
let expected = r#"{
"some": {
"nested": [
{
"structure": {
"version": "v1.0.2"
}
}
]
}
}
"#;
std::fs::write(&json_file, initial_content).unwrap();
let actual_file = std::fs::read_to_string(&json_file).unwrap();
pretty_assertions::assert_eq!(initial_content, actual_file);
let edit_options = JsonEditOptions {
jq: r#".some.nested[].structure.version=$version"#.into(),
};
edit_options.execute(&json_file, "v1.0.2").unwrap();
let actual_file = std::fs::read_to_string(&json_file).unwrap();
pretty_assertions::assert_eq!(expected, &actual_file);
}

View File

@@ -12,6 +12,4 @@ fi
$CMD_PREFIX pull-request \
--mkdocs-image "$MKDOCS_IMAGE" \
--caddy-image "$CADDY_IMAGE" \
--image "$REGISTRY/$SERVICE" \
--tag "main-$(date +%s)" \
--bin-name "$SERVICE"

17
scripts/ci:release.sh Executable file
View File

@@ -0,0 +1,17 @@
#!/usr/bin/env bash
set -e
CMD_PREFIX="cargo run -p ci --"
if [[ -n "$CI_PREFIX" ]]; then
CMD_PREFIX="$CI_PREFIX"
fi
$CMD_PREFIX release \
--mkdocs-image "$MKDOCS_IMAGE" \
--caddy-image "$CADDY_IMAGE" \
--image "$REGISTRY/$SERVICE" \
--tag "$DRONE_TAG" \
--bin-name "$SERVICE"