mirror of
https://github.com/flibusta-apps/meilie_updater.git
synced 2025-12-06 15:15:37 +01:00
Compare commits
14 Commits
cf6d8e6368
...
main
| Author | SHA1 | Date | |
|---|---|---|---|
| 61dfb176f4 | |||
|
|
d486756cd3 | ||
| 80af622ab9 | |||
| b19311632d | |||
|
|
3aad724194 | ||
| b3897967df | |||
| 4a20269805 | |||
|
|
6222b4bfd6 | ||
| e99381fc4b | |||
|
|
64ccc15be6 | ||
| 67e3bbacfd | |||
| c0b6438233 | |||
| 86b0f42c2e | |||
| 0f86904796 |
23
.github/workflows/build_docker_image.yml
vendored
23
.github/workflows/build_docker_image.yml
vendored
@@ -3,18 +3,16 @@ name: Build docker image
|
|||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
branches:
|
branches:
|
||||||
- 'main'
|
- "main"
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
Build-Docker-Image:
|
Build-Docker-Image:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
-
|
- name: Checkout
|
||||||
name: Checkout
|
uses: actions/checkout@v5
|
||||||
uses: actions/checkout@v4
|
|
||||||
|
|
||||||
-
|
- name: Set up Docker Buildx
|
||||||
name: Set up Docker Buildx
|
|
||||||
uses: docker/setup-buildx-action@v3
|
uses: docker/setup-buildx-action@v3
|
||||||
|
|
||||||
- id: repository_name
|
- id: repository_name
|
||||||
@@ -22,16 +20,14 @@ jobs:
|
|||||||
with:
|
with:
|
||||||
string: ${{ github.repository }}
|
string: ${{ github.repository }}
|
||||||
|
|
||||||
-
|
- name: Login to ghcr.io
|
||||||
name: Login to ghcr.io
|
|
||||||
uses: docker/login-action@v3
|
uses: docker/login-action@v3
|
||||||
with:
|
with:
|
||||||
registry: ghcr.io
|
registry: ghcr.io
|
||||||
username: ${{ github.actor }}
|
username: ${{ github.actor }}
|
||||||
password: ${{ secrets.GITHUB_TOKEN }}
|
password: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
|
||||||
-
|
- name: Build and push
|
||||||
name: Build and push
|
|
||||||
id: docker_build
|
id: docker_build
|
||||||
uses: docker/build-push-action@v6
|
uses: docker/build-push-action@v6
|
||||||
env:
|
env:
|
||||||
@@ -39,12 +35,11 @@ jobs:
|
|||||||
with:
|
with:
|
||||||
push: true
|
push: true
|
||||||
platforms: linux/amd64
|
platforms: linux/amd64
|
||||||
tags: ghcr.io/${{ env.IMAGE }}:latest
|
tags: ghcr.io/${{ env.IMAGE }}:latest,ghcr.io/${{ env.IMAGE }}:${{ github.sha }}
|
||||||
context: .
|
context: .
|
||||||
file: ./docker/build.dockerfile
|
file: ./docker/build.dockerfile
|
||||||
|
|
||||||
-
|
- name: Invoke deployment hook
|
||||||
name: Invoke deployment hook
|
|
||||||
uses: joelwmale/webhook-action@master
|
uses: joelwmale/webhook-action@master
|
||||||
with:
|
with:
|
||||||
url: ${{ secrets.WEBHOOK_URL }}
|
url: ${{ secrets.WEBHOOK_URL }}?MEILIE_UPDATER_TAG=${{ github.sha }}
|
||||||
|
|||||||
55
.github/workflows/rust-clippy.yml
vendored
Normal file
55
.github/workflows/rust-clippy.yml
vendored
Normal file
@@ -0,0 +1,55 @@
|
|||||||
|
# This workflow uses actions that are not certified by GitHub.
|
||||||
|
# They are provided by a third-party and are governed by
|
||||||
|
# separate terms of service, privacy policy, and support
|
||||||
|
# documentation.
|
||||||
|
# rust-clippy is a tool that runs a bunch of lints to catch common
|
||||||
|
# mistakes in your Rust code and help improve your Rust code.
|
||||||
|
# More details at https://github.com/rust-lang/rust-clippy
|
||||||
|
# and https://rust-lang.github.io/rust-clippy/
|
||||||
|
|
||||||
|
name: rust-clippy analyze
|
||||||
|
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
branches: [ "main" ]
|
||||||
|
pull_request:
|
||||||
|
# The branches below must be a subset of the branches above
|
||||||
|
branches: [ "main" ]
|
||||||
|
schedule:
|
||||||
|
- cron: '24 4 * * 1'
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
rust-clippy-analyze:
|
||||||
|
name: Run rust-clippy analyzing
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
permissions:
|
||||||
|
contents: read
|
||||||
|
security-events: write
|
||||||
|
actions: read # only required for a private repository by github/codeql-action/upload-sarif to get the Action run status
|
||||||
|
steps:
|
||||||
|
- name: Checkout code
|
||||||
|
uses: actions/checkout@v5
|
||||||
|
|
||||||
|
- name: Install Rust toolchain
|
||||||
|
uses: actions-rs/toolchain@16499b5e05bf2e26879000db0c1d13f7e13fa3af #@v1
|
||||||
|
with:
|
||||||
|
profile: minimal
|
||||||
|
toolchain: stable
|
||||||
|
components: clippy
|
||||||
|
override: true
|
||||||
|
|
||||||
|
- name: Install required cargo
|
||||||
|
run: cargo install clippy-sarif sarif-fmt
|
||||||
|
|
||||||
|
- name: Run rust-clippy
|
||||||
|
run:
|
||||||
|
cargo clippy
|
||||||
|
--all-features
|
||||||
|
--message-format=json | clippy-sarif | tee rust-clippy-results.sarif | sarif-fmt
|
||||||
|
continue-on-error: true
|
||||||
|
|
||||||
|
- name: Upload analysis results to GitHub
|
||||||
|
uses: github/codeql-action/upload-sarif@v4
|
||||||
|
with:
|
||||||
|
sarif_file: rust-clippy-results.sarif
|
||||||
|
wait-for-processing: true
|
||||||
1591
Cargo.lock
generated
1591
Cargo.lock
generated
File diff suppressed because it is too large
Load Diff
24
Cargo.toml
24
Cargo.toml
@@ -3,21 +3,37 @@ name = "meili_updater"
|
|||||||
version = "0.1.0"
|
version = "0.1.0"
|
||||||
edition = "2021"
|
edition = "2021"
|
||||||
|
|
||||||
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
|
|
||||||
|
[profile.release]
|
||||||
|
opt-level = 3
|
||||||
|
debug = false
|
||||||
|
strip = true
|
||||||
|
lto = true
|
||||||
|
codegen-units = 1
|
||||||
|
panic = 'abort'
|
||||||
|
|
||||||
|
[profile.profiling]
|
||||||
|
inherits = "release"
|
||||||
|
debug = true
|
||||||
|
strip = false
|
||||||
|
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
tokio = { version = "1.44.2", features = ["full"] }
|
tokio = { version = "1.44.2", features = ["full"] }
|
||||||
axum = "0.8.1"
|
axum = "0.8.1"
|
||||||
sentry = { version = "0.36.0", features = ["debug-images"] }
|
|
||||||
|
sentry = { version = "0.42.0", features = ["debug-images"] }
|
||||||
|
sentry-tracing = "0.42.0"
|
||||||
|
|
||||||
tracing = "0.1.41"
|
tracing = "0.1.41"
|
||||||
tracing-subscriber = { version = "0.3.19", features = ["env-filter"]}
|
tracing-subscriber = { version = "0.3.19", features = ["env-filter"]}
|
||||||
sentry-tracing = "0.36.0"
|
|
||||||
tower-http = { version = "0.6.2", features = ["trace"] }
|
tower-http = { version = "0.6.2", features = ["trace"] }
|
||||||
lazy_static = "1.5.0"
|
lazy_static = "1.5.0"
|
||||||
log = "0.4.26"
|
log = "0.4.26"
|
||||||
env_logger = "0.11.7"
|
env_logger = "0.11.7"
|
||||||
tokio-postgres = { version = "0.7.13", features = ["with-chrono-0_4"] }
|
tokio-postgres = { version = "0.7.13", features = ["with-chrono-0_4"] }
|
||||||
deadpool-postgres = "0.14.1"
|
deadpool-postgres = "0.14.1"
|
||||||
meilisearch-sdk = "0.28.0"
|
meilisearch-sdk = "0.29.1"
|
||||||
futures = "0.3.31"
|
futures = "0.3.31"
|
||||||
serde = { version = "1.0.219", features = ["derive"] }
|
serde = { version = "1.0.219", features = ["derive"] }
|
||||||
|
|||||||
@@ -46,6 +46,24 @@ where
|
|||||||
|
|
||||||
let index = meili_client.index(T::get_index());
|
let index = meili_client.index(T::get_index());
|
||||||
|
|
||||||
|
if let Err(err) = index
|
||||||
|
.set_searchable_attributes(T::get_searchable_attributes())
|
||||||
|
.await
|
||||||
|
{
|
||||||
|
return Err(Box::new(err));
|
||||||
|
};
|
||||||
|
|
||||||
|
if let Err(err) = index
|
||||||
|
.set_filterable_attributes(T::get_filterable_attributes())
|
||||||
|
.await
|
||||||
|
{
|
||||||
|
return Err(Box::new(err));
|
||||||
|
};
|
||||||
|
|
||||||
|
if let Err(err) = index.set_ranking_rules(T::get_ranking_rules()).await {
|
||||||
|
return Err(Box::new(err));
|
||||||
|
};
|
||||||
|
|
||||||
let params: Vec<String> = vec![];
|
let params: Vec<String> = vec![];
|
||||||
let stream = match client.query_raw(&T::get_query(), params).await {
|
let stream = match client.query_raw(&T::get_query(), params).await {
|
||||||
Ok(stream) => stream,
|
Ok(stream) => stream,
|
||||||
@@ -69,24 +87,6 @@ where
|
|||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
if let Err(err) = index
|
|
||||||
.set_searchable_attributes(T::get_searchable_attributes())
|
|
||||||
.await
|
|
||||||
{
|
|
||||||
return Err(Box::new(err));
|
|
||||||
};
|
|
||||||
|
|
||||||
if let Err(err) = index
|
|
||||||
.set_filterable_attributes(T::get_filterable_attributes())
|
|
||||||
.await
|
|
||||||
{
|
|
||||||
return Err(Box::new(err));
|
|
||||||
};
|
|
||||||
|
|
||||||
if let Err(err) = index.set_ranking_rules(T::get_ranking_rules()).await {
|
|
||||||
return Err(Box::new(err));
|
|
||||||
};
|
|
||||||
|
|
||||||
Ok(())
|
Ok(())
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user