Fixing docker release (#4592)

* Re-add notif on tag failure.

* Upping rust version.

* Version 0.19.4-beta.1a

* Try again.

* Version 0.19.4-beta.1b

* Removing unstable inspect.

* Version 0.19.4-beta.1c

* Remove use release cache.

* Trying to fix cargo publish 1.

* Version 0.19.4-beta.1d

* Re-adding publish release

* Version 0.19.4-beta.2

* Fixing workspace for lemmy_federate
This commit is contained in:
Dessalines 2024-04-04 10:14:59 -04:00 committed by GitHub
parent a1d632e582
commit 705e86eb4c
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
6 changed files with 47 additions and 49 deletions

View file

@ -2,7 +2,7 @@
# See https://github.com/woodpecker-ci/woodpecker/issues/1677 # See https://github.com/woodpecker-ci/woodpecker/issues/1677
variables: variables:
- &rust_image "rust:1.76" - &rust_image "rust:1.77"
- &install_pnpm "corepack enable pnpm" - &install_pnpm "corepack enable pnpm"
- &slow_check_paths - &slow_check_paths
- event: pull_request - event: pull_request
@ -42,7 +42,7 @@ steps:
- git submodule init - git submodule init
- git submodule update - git submodule update
when: when:
- event: pull_request - event: [pull_request, tag]
prettier_check: prettier_check:
image: tmknom/prettier:3.0.0 image: tmknom/prettier:3.0.0
@ -248,7 +248,6 @@ steps:
publish_to_crates_io: publish_to_crates_io:
image: *rust_image image: *rust_image
commands: commands:
- 'echo "pub const VERSION: &str = \"$(git describe --tag)\";" > "crates/utils/src/version.rs"'
- cargo install cargo-workspaces - cargo install cargo-workspaces
- cp -r migrations crates/db_schema/ - cp -r migrations crates/db_schema/
- cargo login "$CARGO_API_TOKEN" - cargo login "$CARGO_API_TOKEN"

26
Cargo.lock generated
View file

@ -2612,7 +2612,7 @@ checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646"
[[package]] [[package]]
name = "lemmy_api" name = "lemmy_api"
version = "0.19.4-beta.1" version = "0.19.4-beta.2"
dependencies = [ dependencies = [
"activitypub_federation", "activitypub_federation",
"actix-web", "actix-web",
@ -2641,7 +2641,7 @@ dependencies = [
[[package]] [[package]]
name = "lemmy_api_common" name = "lemmy_api_common"
version = "0.19.4-beta.1" version = "0.19.4-beta.2"
dependencies = [ dependencies = [
"activitypub_federation", "activitypub_federation",
"actix-web", "actix-web",
@ -2679,7 +2679,7 @@ dependencies = [
[[package]] [[package]]
name = "lemmy_api_crud" name = "lemmy_api_crud"
version = "0.19.4-beta.1" version = "0.19.4-beta.2"
dependencies = [ dependencies = [
"accept-language", "accept-language",
"activitypub_federation", "activitypub_federation",
@ -2702,7 +2702,7 @@ dependencies = [
[[package]] [[package]]
name = "lemmy_apub" name = "lemmy_apub"
version = "0.19.4-beta.1" version = "0.19.4-beta.2"
dependencies = [ dependencies = [
"activitypub_federation", "activitypub_federation",
"actix-web", "actix-web",
@ -2740,7 +2740,7 @@ dependencies = [
[[package]] [[package]]
name = "lemmy_db_perf" name = "lemmy_db_perf"
version = "0.19.4-beta.1" version = "0.19.4-beta.2"
dependencies = [ dependencies = [
"anyhow", "anyhow",
"clap", "clap",
@ -2755,7 +2755,7 @@ dependencies = [
[[package]] [[package]]
name = "lemmy_db_schema" name = "lemmy_db_schema"
version = "0.19.4-beta.1" version = "0.19.4-beta.2"
dependencies = [ dependencies = [
"activitypub_federation", "activitypub_federation",
"anyhow", "anyhow",
@ -2795,7 +2795,7 @@ dependencies = [
[[package]] [[package]]
name = "lemmy_db_views" name = "lemmy_db_views"
version = "0.19.4-beta.1" version = "0.19.4-beta.2"
dependencies = [ dependencies = [
"actix-web", "actix-web",
"chrono", "chrono",
@ -2817,7 +2817,7 @@ dependencies = [
[[package]] [[package]]
name = "lemmy_db_views_actor" name = "lemmy_db_views_actor"
version = "0.19.4-beta.1" version = "0.19.4-beta.2"
dependencies = [ dependencies = [
"chrono", "chrono",
"diesel", "diesel",
@ -2837,7 +2837,7 @@ dependencies = [
[[package]] [[package]]
name = "lemmy_db_views_moderator" name = "lemmy_db_views_moderator"
version = "0.19.4-beta.1" version = "0.19.4-beta.2"
dependencies = [ dependencies = [
"diesel", "diesel",
"diesel-async", "diesel-async",
@ -2849,7 +2849,7 @@ dependencies = [
[[package]] [[package]]
name = "lemmy_federate" name = "lemmy_federate"
version = "0.19.4-beta.1" version = "0.19.4-beta.2"
dependencies = [ dependencies = [
"activitypub_federation", "activitypub_federation",
"anyhow", "anyhow",
@ -2872,7 +2872,7 @@ dependencies = [
[[package]] [[package]]
name = "lemmy_routes" name = "lemmy_routes"
version = "0.19.4-beta.1" version = "0.19.4-beta.2"
dependencies = [ dependencies = [
"activitypub_federation", "activitypub_federation",
"actix-web", "actix-web",
@ -2897,7 +2897,7 @@ dependencies = [
[[package]] [[package]]
name = "lemmy_server" name = "lemmy_server"
version = "0.19.4-beta.1" version = "0.19.4-beta.2"
dependencies = [ dependencies = [
"activitypub_federation", "activitypub_federation",
"actix-cors", "actix-cors",
@ -2940,7 +2940,7 @@ dependencies = [
[[package]] [[package]]
name = "lemmy_utils" name = "lemmy_utils"
version = "0.19.4-beta.1" version = "0.19.4-beta.2"
dependencies = [ dependencies = [
"actix-web", "actix-web",
"anyhow", "anyhow",

View file

@ -1,5 +1,5 @@
[workspace.package] [workspace.package]
version = "0.19.4-beta.1" version = "0.19.4-beta.2"
edition = "2021" edition = "2021"
description = "A link aggregator for the fediverse" description = "A link aggregator for the fediverse"
license = "AGPL-3.0" license = "AGPL-3.0"
@ -88,16 +88,17 @@ unused_self = "deny"
unwrap_used = "deny" unwrap_used = "deny"
[workspace.dependencies] [workspace.dependencies]
lemmy_api = { version = "=0.19.4-beta.1", path = "./crates/api" } lemmy_api = { version = "=0.19.4-beta.2", path = "./crates/api" }
lemmy_api_crud = { version = "=0.19.4-beta.1", path = "./crates/api_crud" } lemmy_api_crud = { version = "=0.19.4-beta.2", path = "./crates/api_crud" }
lemmy_apub = { version = "=0.19.4-beta.1", path = "./crates/apub" } lemmy_apub = { version = "=0.19.4-beta.2", path = "./crates/apub" }
lemmy_utils = { version = "=0.19.4-beta.1", path = "./crates/utils", default-features = false } lemmy_utils = { version = "=0.19.4-beta.2", path = "./crates/utils", default-features = false }
lemmy_db_schema = { version = "=0.19.4-beta.1", path = "./crates/db_schema" } lemmy_db_schema = { version = "=0.19.4-beta.2", path = "./crates/db_schema" }
lemmy_api_common = { version = "=0.19.4-beta.1", path = "./crates/api_common" } lemmy_api_common = { version = "=0.19.4-beta.2", path = "./crates/api_common" }
lemmy_routes = { version = "=0.19.4-beta.1", path = "./crates/routes" } lemmy_routes = { version = "=0.19.4-beta.2", path = "./crates/routes" }
lemmy_db_views = { version = "=0.19.4-beta.1", path = "./crates/db_views" } lemmy_db_views = { version = "=0.19.4-beta.2", path = "./crates/db_views" }
lemmy_db_views_actor = { version = "=0.19.4-beta.1", path = "./crates/db_views_actor" } lemmy_db_views_actor = { version = "=0.19.4-beta.2", path = "./crates/db_views_actor" }
lemmy_db_views_moderator = { version = "=0.19.4-beta.1", path = "./crates/db_views_moderator" } lemmy_db_views_moderator = { version = "=0.19.4-beta.2", path = "./crates/db_views_moderator" }
lemmy_federate = { version = "=0.19.4-beta.2", path = "./crates/federate" }
activitypub_federation = { version = "0.5.2", default-features = false, features = [ activitypub_federation = { version = "0.5.2", default-features = false, features = [
"actix-web", "actix-web",
] } ] }
@ -175,7 +176,7 @@ lemmy_utils = { workspace = true }
lemmy_db_schema = { workspace = true } lemmy_db_schema = { workspace = true }
lemmy_api_common = { workspace = true } lemmy_api_common = { workspace = true }
lemmy_routes = { workspace = true } lemmy_routes = { workspace = true }
lemmy_federate = { version = "0.19.4-beta.1", path = "crates/federate" } lemmy_federate = { workspace = true }
activitypub_federation = { workspace = true } activitypub_federation = { workspace = true }
diesel = { workspace = true } diesel = { workspace = true }
diesel-async = { workspace = true } diesel-async = { workspace = true }

View file

@ -1,5 +1,5 @@
# syntax=docker/dockerfile:1.6 # syntax=docker/dockerfile:1.6
ARG RUST_VERSION=1.76 ARG RUST_VERSION=1.77
ARG CARGO_BUILD_FEATURES=default ARG CARGO_BUILD_FEATURES=default
ARG RUST_RELEASE_MODE=debug ARG RUST_RELEASE_MODE=debug
@ -35,7 +35,7 @@ RUN --mount=type=cache,target=/lemmy/target set -ex; \
# Release build # Release build
RUN --mount=type=cache,target=/lemmy/target set -ex; \ RUN --mount=type=cache,target=/lemmy/target set -ex; \
if [ "${RUST_RELEASE_MODE}" = "release" ]; then \ if [ "${RUST_RELEASE_MODE}" = "release" ]; then \
[ -z "$USE_RELEASE_CACHE" ] && cargo clean --release; \ cargo clean --release; \
cargo build --features "${CARGO_BUILD_FEATURES}" --release; \ cargo build --features "${CARGO_BUILD_FEATURES}" --release; \
mv target/"${RUST_RELEASE_MODE}"/lemmy_server ./lemmy_server; \ mv target/"${RUST_RELEASE_MODE}"/lemmy_server ./lemmy_server; \
fi fi
@ -68,7 +68,7 @@ RUN --mount=type=cache,target=./target,uid=10001,gid=10001 set -ex; \
# Release build # Release build
RUN --mount=type=cache,target=./target,uid=10001,gid=10001 set -ex; \ RUN --mount=type=cache,target=./target,uid=10001,gid=10001 set -ex; \
if [ "${RUST_RELEASE_MODE}" = "release" ]; then \ if [ "${RUST_RELEASE_MODE}" = "release" ]; then \
[ -z "$USE_RELEASE_CACHE" ] && cargo clean --release; \ cargo clean --release; \
cargo build --features "${CARGO_BUILD_FEATURES}" --release; \ cargo build --features "${CARGO_BUILD_FEATURES}" --release; \
mv "./target/$CARGO_BUILD_TARGET/$RUST_RELEASE_MODE/lemmy_server" /home/lemmy/lemmy_server; \ mv "./target/$CARGO_BUILD_TARGET/$RUST_RELEASE_MODE/lemmy_server" /home/lemmy/lemmy_server; \
fi fi

View file

@ -1,5 +1,3 @@
version: "3.7"
x-logging: &default-logging x-logging: &default-logging
driver: "json-file" driver: "json-file"
options: options:

View file

@ -94,7 +94,7 @@ pub async fn setup(context: LemmyContext) -> Result<(), LemmyError> {
delete_old_denied_users(&mut context.pool()).await; delete_old_denied_users(&mut context.pool()).await;
update_instance_software(&mut context.pool(), context.client()) update_instance_software(&mut context.pool(), context.client())
.await .await
.inspect_err(|e| warn!("Failed to update instance software: {e}")) .map_err(|e| warn!("Failed to update instance software: {e}"))
.ok(); .ok();
} }
}); });
@ -276,10 +276,10 @@ async fn delete_expired_captcha_answers(pool: &mut DbPool<'_>) {
) )
.execute(&mut conn) .execute(&mut conn)
.await .await
.inspect(|_| { .map(|_| {
info!("Done."); info!("Done.");
}) })
.inspect_err(|e| error!("Failed to clear old captcha answers: {e}")) .map_err(|e| error!("Failed to clear old captcha answers: {e}"))
.ok(); .ok();
} }
Err(e) => { Err(e) => {
@ -300,7 +300,7 @@ async fn clear_old_activities(pool: &mut DbPool<'_>) {
) )
.execute(&mut conn) .execute(&mut conn)
.await .await
.inspect_err(|e| error!("Failed to clear old sent activities: {e}")) .map_err(|e| error!("Failed to clear old sent activities: {e}"))
.ok(); .ok();
diesel::delete( diesel::delete(
@ -309,8 +309,8 @@ async fn clear_old_activities(pool: &mut DbPool<'_>) {
) )
.execute(&mut conn) .execute(&mut conn)
.await .await
.inspect(|_| info!("Done.")) .map(|_| info!("Done."))
.inspect_err(|e| error!("Failed to clear old received activities: {e}")) .map_err(|e| error!("Failed to clear old received activities: {e}"))
.ok(); .ok();
} }
Err(e) => { Err(e) => {
@ -322,10 +322,10 @@ async fn clear_old_activities(pool: &mut DbPool<'_>) {
async fn delete_old_denied_users(pool: &mut DbPool<'_>) { async fn delete_old_denied_users(pool: &mut DbPool<'_>) {
LocalUser::delete_old_denied_local_users(pool) LocalUser::delete_old_denied_local_users(pool)
.await .await
.inspect(|_| { .map(|_| {
info!("Done."); info!("Done.");
}) })
.inspect(|e| error!("Failed to deleted old denied users: {e}")) .map_err(|e| error!("Failed to deleted old denied users: {e}"))
.ok(); .ok();
} }
@ -348,10 +348,10 @@ async fn overwrite_deleted_posts_and_comments(pool: &mut DbPool<'_>) {
)) ))
.execute(&mut conn) .execute(&mut conn)
.await .await
.inspect(|_| { .map(|_| {
info!("Done."); info!("Done.");
}) })
.inspect_err(|e| error!("Failed to overwrite deleted posts: {e}")) .map_err(|e| error!("Failed to overwrite deleted posts: {e}"))
.ok(); .ok();
info!("Overwriting deleted comments..."); info!("Overwriting deleted comments...");
@ -364,10 +364,10 @@ async fn overwrite_deleted_posts_and_comments(pool: &mut DbPool<'_>) {
.set(comment::content.eq(DELETED_REPLACEMENT_TEXT)) .set(comment::content.eq(DELETED_REPLACEMENT_TEXT))
.execute(&mut conn) .execute(&mut conn)
.await .await
.inspect(|_| { .map(|_| {
info!("Done."); info!("Done.");
}) })
.inspect_err(|e| error!("Failed to overwrite deleted comments: {e}")) .map_err(|e| error!("Failed to overwrite deleted comments: {e}"))
.ok(); .ok();
} }
Err(e) => { Err(e) => {
@ -399,14 +399,14 @@ async fn active_counts(pool: &mut DbPool<'_>) {
sql_query(update_site_stmt) sql_query(update_site_stmt)
.execute(&mut conn) .execute(&mut conn)
.await .await
.inspect_err(|e| error!("Failed to update site stats: {e}")) .map_err(|e| error!("Failed to update site stats: {e}"))
.ok(); .ok();
let update_community_stmt = format!("update community_aggregates ca set users_active_{} = mv.count_ from community_aggregates_activity('{}') mv where ca.community_id = mv.community_id_", i.1, i.0); let update_community_stmt = format!("update community_aggregates ca set users_active_{} = mv.count_ from community_aggregates_activity('{}') mv where ca.community_id = mv.community_id_", i.1, i.0);
sql_query(update_community_stmt) sql_query(update_community_stmt)
.execute(&mut conn) .execute(&mut conn)
.await .await
.inspect_err(|e| error!("Failed to update community stats: {e}")) .map_err(|e| error!("Failed to update community stats: {e}"))
.ok(); .ok();
} }
@ -433,7 +433,7 @@ async fn update_banned_when_expired(pool: &mut DbPool<'_>) {
.set(person::banned.eq(false)) .set(person::banned.eq(false))
.execute(&mut conn) .execute(&mut conn)
.await .await
.inspect_err(|e| error!("Failed to update person.banned when expires: {e}")) .map_err(|e| error!("Failed to update person.banned when expires: {e}"))
.ok(); .ok();
diesel::delete( diesel::delete(
@ -441,7 +441,7 @@ async fn update_banned_when_expired(pool: &mut DbPool<'_>) {
) )
.execute(&mut conn) .execute(&mut conn)
.await .await
.inspect_err(|e| error!("Failed to remove community_ban expired rows: {e}")) .map_err(|e| error!("Failed to remove community_ban expired rows: {e}"))
.ok(); .ok();
} }
Err(e) => { Err(e) => {