From e3368c9d659a1e2b20810643114ea9375abc3776 Mon Sep 17 00:00:00 2001 From: 6543 <6543@obermui.de> Date: Thu, 13 Apr 2023 18:28:52 +0200 Subject: [PATCH 1/4] let the clone plugin handle submodules too --- .woodpecker.yml | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/.woodpecker.yml b/.woodpecker.yml index 9b96c52ded..9ee16bcd98 100644 --- a/.woodpecker.yml +++ b/.woodpecker.yml @@ -1,16 +1,15 @@ # TODO: The when: platform conditionals aren't working currently # See https://github.com/woodpecker-ci/woodpecker/issues/1677 +clone: + git: + image: woodpeckerci/plugin-git + settings: + recursive: true + submodule_update_remote: true + pipeline: # use minimum supported rust version for most steps - prepare_repo: - image: alpine:3 - commands: - - apk add git - #- git fetch --tags - - git submodule init - - git submodule update --recursive --remote - cargo_fmt: image: clux/muslrust:1.67.0 environment: From 64a6067788b5aee3125d927e19c1cd7ec52f1ed5 Mon Sep 17 00:00:00 2001 From: 6543 <6543@obermui.de> Date: Thu, 13 Apr 2023 18:34:48 +0200 Subject: [PATCH 2/4] start using yml aliase --- .woodpecker.yml | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/.woodpecker.yml b/.woodpecker.yml index 9ee16bcd98..41d5f18871 100644 --- a/.woodpecker.yml +++ b/.woodpecker.yml @@ -1,6 +1,9 @@ # TODO: The when: platform conditionals aren't working currently # See https://github.com/woodpecker-ci/woodpecker/issues/1677 +variables: + - &muslrust_image 'clux/muslrust:1.67.0' + clone: git: image: woodpeckerci/plugin-git @@ -11,7 +14,7 @@ clone: pipeline: # use minimum supported rust version for most steps cargo_fmt: - image: clux/muslrust:1.67.0 + image: *muslrust_image environment: # store cargo data in repo folder so that it gets cached between steps CARGO_HOME: .cargo @@ -27,7 +30,7 @@ pipeline: # check each package to make sure they compile with default features. # this is required for crates.io cargo_check: - image: clux/muslrust:1.67.0 + image: *muslrust_image environment: CARGO_HOME: .cargo commands: @@ -49,7 +52,7 @@ pipeline: # platform: linux/amd64 cargo_clippy: - image: clux/muslrust:1.67.0 + image: *muslrust_image environment: CARGO_HOME: .cargo commands: @@ -73,7 +76,7 @@ pipeline: # platform: linux/amd64 lemmy_api_common_doesnt_depend_on_diesel: - image: clux/muslrust:1.67.0 + image: *muslrust_image environment: CARGO_HOME: .cargo commands: @@ -82,7 +85,7 @@ pipeline: # platform: linux/amd64 check_defaults_hjson_updated: - image: clux/muslrust:1.67.0 + image: *muslrust_image environment: CARGO_HOME: .cargo commands: @@ -93,7 +96,7 @@ pipeline: # platform: linux/amd64 cargo_test: - image: clux/muslrust:1.67.0 + image: *muslrust_image environment: LEMMY_DATABASE_URL: postgres://lemmy:password@database:5432/lemmy RUST_BACKTRACE: "1" @@ -106,7 +109,7 @@ pipeline: # platform: linux/amd64 cargo_build: - image: clux/muslrust:1.67.0 + image: *muslrust_image environment: CARGO_HOME: .cargo commands: @@ -215,7 +218,7 @@ pipeline: # using https://github.com/pksunkara/cargo-workspaces publish_to_crates_io: - image: clux/muslrust:1.67.0 + image: *muslrust_image commands: - cargo install cargo-workspaces - cp -r migrations crates/db_schema/ From 430056cc32604c565e133c854db864a40a04258b Mon Sep 17 00:00:00 2001 From: 6543 <6543@obermui.de> Date: Thu, 13 Apr 2023 18:38:38 +0200 Subject: [PATCH 3/4] fix publish_to_crates_io --- .woodpecker.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.woodpecker.yml b/.woodpecker.yml index 41d5f18871..adeeffd87f 100644 --- a/.woodpecker.yml +++ b/.woodpecker.yml @@ -222,7 +222,7 @@ pipeline: commands: - cargo install cargo-workspaces - cp -r migrations crates/db_schema/ - - cargo login "$CARGO_TOKEN" + - cargo login "$CARGO_API_TOKEN" - cargo workspaces publish --from-git --allow-dirty --no-verify --allow-branch "${CI_COMMIT_TAG}" --yes custom "${CI_COMMIT_TAG}" secrets: [cargo_api_token] when: From eff402ed0c56d21fadc74485279d1296ded4963b Mon Sep 17 00:00:00 2001 From: 6543 <6543@obermui.de> Date: Thu, 13 Apr 2023 21:20:41 +0200 Subject: [PATCH 4/4] CI.restart()