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:
|
||||
push:
|
||||
branches:
|
||||
- 'main'
|
||||
- "main"
|
||||
|
||||
jobs:
|
||||
Build-Docker-Image:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
-
|
||||
name: Checkout
|
||||
uses: actions/checkout@v4
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v5
|
||||
|
||||
-
|
||||
name: Set up Docker Buildx
|
||||
- name: Set up Docker Buildx
|
||||
uses: docker/setup-buildx-action@v3
|
||||
|
||||
- id: repository_name
|
||||
@@ -22,16 +20,14 @@ jobs:
|
||||
with:
|
||||
string: ${{ github.repository }}
|
||||
|
||||
-
|
||||
name: Login to ghcr.io
|
||||
- name: Login to ghcr.io
|
||||
uses: docker/login-action@v3
|
||||
with:
|
||||
registry: ghcr.io
|
||||
username: ${{ github.actor }}
|
||||
password: ${{ secrets.GITHUB_TOKEN }}
|
||||
|
||||
-
|
||||
name: Build and push
|
||||
- name: Build and push
|
||||
id: docker_build
|
||||
uses: docker/build-push-action@v6
|
||||
env:
|
||||
@@ -39,12 +35,11 @@ jobs:
|
||||
with:
|
||||
push: true
|
||||
platforms: linux/amd64
|
||||
tags: ghcr.io/${{ env.IMAGE }}:latest
|
||||
tags: ghcr.io/${{ env.IMAGE }}:latest,ghcr.io/${{ env.IMAGE }}:${{ github.sha }}
|
||||
context: .
|
||||
file: ./docker/build.dockerfile
|
||||
|
||||
-
|
||||
name: Invoke deployment hook
|
||||
- name: Invoke deployment hook
|
||||
uses: joelwmale/webhook-action@master
|
||||
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"
|
||||
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]
|
||||
tokio = { version = "1.44.2", features = ["full"] }
|
||||
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-subscriber = { version = "0.3.19", features = ["env-filter"]}
|
||||
sentry-tracing = "0.36.0"
|
||||
|
||||
tower-http = { version = "0.6.2", features = ["trace"] }
|
||||
lazy_static = "1.5.0"
|
||||
log = "0.4.26"
|
||||
env_logger = "0.11.7"
|
||||
tokio-postgres = { version = "0.7.13", features = ["with-chrono-0_4"] }
|
||||
deadpool-postgres = "0.14.1"
|
||||
meilisearch-sdk = "0.28.0"
|
||||
meilisearch-sdk = "0.29.1"
|
||||
futures = "0.3.31"
|
||||
serde = { version = "1.0.219", features = ["derive"] }
|
||||
|
||||
@@ -46,6 +46,24 @@ where
|
||||
|
||||
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 stream = match client.query_raw(&T::get_query(), params).await {
|
||||
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(())
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user