mirror of
https://github.com/Syfaro/bkapi.git
synced 2024-11-21 22:43:24 +00:00
Bump versions, use GitHub Actions.
This commit is contained in:
parent
04e494ee31
commit
9bc9d1ef89
77
.github/workflows/release.yml
vendored
Normal file
77
.github/workflows/release.yml
vendored
Normal file
@ -0,0 +1,77 @@
|
|||||||
|
name: Release
|
||||||
|
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
pull_request:
|
||||||
|
|
||||||
|
env:
|
||||||
|
CARGO_TERM_COLOR: always
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
release:
|
||||||
|
runs-on: ubuntu-20.04
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v2
|
||||||
|
|
||||||
|
- name: Cache target
|
||||||
|
uses: actions/cache@v2
|
||||||
|
with:
|
||||||
|
path: |
|
||||||
|
target/
|
||||||
|
key: ${{ runner.os }}-debug-${{ hashFiles('Cargo.lock') }}
|
||||||
|
|
||||||
|
- name: Get stable toolchain
|
||||||
|
uses: actions-rs/toolchain@v1
|
||||||
|
with:
|
||||||
|
toolchain: stable
|
||||||
|
|
||||||
|
- name: Build binaries
|
||||||
|
uses: actions-rs/cargo@v1
|
||||||
|
with:
|
||||||
|
command: build
|
||||||
|
args: --release
|
||||||
|
|
||||||
|
- name: Move binaries
|
||||||
|
run: |
|
||||||
|
mv target/release/bkapi bkapi/bkapi
|
||||||
|
|
||||||
|
- name: Upload binaries
|
||||||
|
uses: actions/upload-artifact@v2
|
||||||
|
with:
|
||||||
|
name: bkapi
|
||||||
|
path: bkapi/bkapi
|
||||||
|
|
||||||
|
- name: Login to GitHub Container Registry
|
||||||
|
uses: docker/login-action@v1
|
||||||
|
with:
|
||||||
|
registry: ghcr.io
|
||||||
|
username: ${{ github.actor }}
|
||||||
|
password: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
|
||||||
|
- name: Extract metadata for Docker
|
||||||
|
id: meta
|
||||||
|
uses: docker/metadata-action@v3
|
||||||
|
with:
|
||||||
|
images: ghcr.io/syfaro/bkapi
|
||||||
|
|
||||||
|
- name: Build and push Docker image
|
||||||
|
uses: docker/build-push-action@v2
|
||||||
|
with:
|
||||||
|
context: .
|
||||||
|
push: true
|
||||||
|
tags: ${{ steps.meta.outputs.tags }}
|
||||||
|
labels: ${{ steps.meta.outputs.labels }}
|
||||||
|
file: bkapi/Dockerfile
|
||||||
|
|
||||||
|
sourcegraph:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v2
|
||||||
|
- name: Generate LSIF data
|
||||||
|
uses: sourcegraph/lsif-rust-action@main
|
||||||
|
- name: Upload LSIF data
|
||||||
|
uses: sourcegraph/lsif-upload-action@master
|
||||||
|
with:
|
||||||
|
github_token: ${{ secrets.GITHUB_TOKEN }}
|
@ -1,37 +0,0 @@
|
|||||||
stages:
|
|
||||||
- build
|
|
||||||
- image
|
|
||||||
|
|
||||||
variables:
|
|
||||||
CARGO_HOME: "$CI_PROJECT_DIR/.cargo"
|
|
||||||
|
|
||||||
build:
|
|
||||||
image: rust:1.53-slim-buster
|
|
||||||
stage: build
|
|
||||||
artifacts:
|
|
||||||
expire_in: 1 day
|
|
||||||
paths:
|
|
||||||
- ./bkapi/bkapi
|
|
||||||
cache:
|
|
||||||
- key:
|
|
||||||
files:
|
|
||||||
- Cargo.lock
|
|
||||||
paths:
|
|
||||||
- target/
|
|
||||||
- .cargo/
|
|
||||||
script:
|
|
||||||
- cargo build --bin bkapi --release --verbose
|
|
||||||
- mv ./target/release/bkapi ./bkapi/bkapi
|
|
||||||
|
|
||||||
docker:
|
|
||||||
image:
|
|
||||||
name: gcr.io/kaniko-project/executor:debug
|
|
||||||
entrypoint: [""]
|
|
||||||
stage: image
|
|
||||||
needs:
|
|
||||||
- build
|
|
||||||
before_script:
|
|
||||||
- mkdir -p /kaniko/.docker
|
|
||||||
- echo "{\"auths\":{\"$CI_REGISTRY\":{\"auth\":\"$(echo -n ${CI_REGISTRY_USER}:${CI_REGISTRY_PASSWORD} | base64)\"}}}" > /kaniko/.docker/config.json
|
|
||||||
script:
|
|
||||||
- /kaniko/executor --context $CI_PROJECT_DIR --dockerfile $CI_PROJECT_DIR/bkapi/Dockerfile --destination $CI_REGISTRY_IMAGE:$CI_COMMIT_SHA --destination $CI_REGISTRY_IMAGE:latest --cache=true
|
|
753
Cargo.lock
generated
753
Cargo.lock
generated
File diff suppressed because it is too large
Load Diff
@ -6,10 +6,10 @@ edition = "2018"
|
|||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
tracing = "0.1"
|
tracing = "0.1"
|
||||||
tracing-opentelemetry = "0.14"
|
tracing-opentelemetry = "0.16"
|
||||||
|
|
||||||
opentelemetry = "0.15"
|
opentelemetry = "0.16"
|
||||||
opentelemetry-http = "0.4"
|
opentelemetry-http = "0.5"
|
||||||
|
|
||||||
futures = "0.3"
|
futures = "0.3"
|
||||||
|
|
||||||
|
@ -9,15 +9,15 @@ envconfig = "0.10"
|
|||||||
thiserror = "1"
|
thiserror = "1"
|
||||||
|
|
||||||
tracing = "0.1"
|
tracing = "0.1"
|
||||||
tracing-subscriber = "0.2"
|
tracing-subscriber = { version = "0.3", features = ["env-filter"] }
|
||||||
tracing-unwrap = "0.9"
|
tracing-unwrap = "0.9"
|
||||||
tracing-opentelemetry = "0.14"
|
tracing-opentelemetry = "0.16"
|
||||||
|
|
||||||
opentelemetry = { version = "0.15", features = ["rt-tokio"] }
|
opentelemetry = { version = "0.16", features = ["rt-tokio"] }
|
||||||
opentelemetry-jaeger = "0.14"
|
opentelemetry-jaeger = { version = "0.15", features = ["rt-tokio"] }
|
||||||
|
|
||||||
lazy_static = "1"
|
lazy_static = "1"
|
||||||
prometheus = { version = "0.12", features = ["process"] }
|
prometheus = { version = "0.13", features = ["process"] }
|
||||||
|
|
||||||
bk-tree = "0.4.0"
|
bk-tree = "0.4.0"
|
||||||
hamming = "0.1"
|
hamming = "0.1"
|
||||||
@ -28,10 +28,10 @@ tokio = { version = "1", features = ["sync"] }
|
|||||||
serde = { version = "1", features = ["derive"] }
|
serde = { version = "1", features = ["derive"] }
|
||||||
serde_json = "1"
|
serde_json = "1"
|
||||||
|
|
||||||
actix-web = "4.0.0-beta.8"
|
actix-web = "4.0.0-beta.13"
|
||||||
actix-http = "3.0.0-beta.8"
|
actix-http = "3.0.0-beta.14"
|
||||||
actix-service = "2"
|
actix-service = "2"
|
||||||
tracing-actix-web = { version = "0.4.0-beta.9", features = ["opentelemetry_0_15"] }
|
tracing-actix-web = { version = "0.5.0-beta.4", features = ["opentelemetry_0_16"] }
|
||||||
|
|
||||||
[dependencies.sqlx]
|
[dependencies.sqlx]
|
||||||
version = "0.5"
|
version = "0.5"
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
FROM debian:buster-slim
|
FROM ubuntu:20.04
|
||||||
EXPOSE 3000
|
EXPOSE 3000
|
||||||
COPY ./bkapi/bkapi /bin/bkapi
|
COPY ./bkapi/bkapi /bin/bkapi
|
||||||
CMD ["/bin/bkapi"]
|
CMD ["/bin/bkapi"]
|
||||||
|
@ -161,12 +161,6 @@ fn configure_tracing(config: &Config) {
|
|||||||
.expect("tracing could not be configured");
|
.expect("tracing could not be configured");
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Clone)]
|
|
||||||
struct State {
|
|
||||||
tree: tree::Tree,
|
|
||||||
max_distance: Option<u32>,
|
|
||||||
}
|
|
||||||
|
|
||||||
#[derive(Debug, serde::Deserialize)]
|
#[derive(Debug, serde::Deserialize)]
|
||||||
struct Query {
|
struct Query {
|
||||||
hash: i64,
|
hash: i64,
|
||||||
|
Loading…
Reference in New Issue
Block a user