Skip to content

Commit

Permalink
Merge branch 'release/0.2.0'
Browse files Browse the repository at this point in the history
  • Loading branch information
s3rius committed Jan 5, 2022
2 parents ccc7ac4 + bef55fe commit bc6743c
Show file tree
Hide file tree
Showing 6 changed files with 182 additions and 52 deletions.
6 changes: 4 additions & 2 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
on: push
on:
- push
- pull_request

name: Lint check
jobs:
Expand Down Expand Up @@ -32,4 +34,4 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- run: cargo fmt -- --check
- run: cargo fmt -- --check
56 changes: 42 additions & 14 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ on:

jobs:
publish:
name: Publishing for ${{ matrix.job.os }}
name: Building ${{ matrix.job.target }}
runs-on: ${{ matrix.job.os }}
strategy:
matrix:
Expand All @@ -31,18 +31,18 @@ jobs:
architecture: x86_64
binary-postfix: ".exe"
use-cross: false
# - os: ubuntu-latest
# os-name: linux
# target: aarch64-unknown-linux-gnu
# architecture: arm64
# binary-postfix: ""
# use-cross: true
# - os: ubuntu-latest
# os-name: linux
# target: i686-unknown-linux-gnu
# architecture: i686
# binary-postfix: ""
# use-cross: true
- os: ubuntu-latest
os-name: linux-musl
target: x86_64-unknown-linux-musl
architecture: x86_64
binary-postfix: ""
use-cross: true
- os: ubuntu-latest
os-name: linux
target: aarch64-unknown-linux-gnu
architecture: arm64
binary-postfix: ""
use-cross: true

steps:
- name: Checkout repository
Expand Down Expand Up @@ -124,4 +124,32 @@ jobs:
context: .
push: true
file: deploy/Dockerfile
tags: s3rius/rustus:latest,s3rius/rustus:${{env.APP_VERSION}}
tags: s3rius/rustus:latest,s3rius/rustus:${{env.APP_VERSION}}

docker_build_alpine:
runs-on: ubuntu-latest
needs:
- publish
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Set up QEMU
uses: docker/setup-qemu-action@v1
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1
- name: Login to DockerHub
uses: docker/login-action@v1
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Export version
run: echo "APP_VERSION=$(head -n 5 Cargo.toml | grep version | cut -d '"' -f2)" >> $GITHUB_ENV
- name: Build and push
uses: docker/build-push-action@v2
with:
context: .
push: true
file: deploy/alpine.Dockerfile
tags: s3rius/rustus:${{env.APP_VERSION}}-alpine
build-args: |
app_version=${{env.APP_VERSION}}
13 changes: 12 additions & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

127 changes: 92 additions & 35 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,53 +1,110 @@
[package]
name = "rustus"
version = "0.1.0"
version = "0.2.0"
edition = "2021"
description = "TUS protocol implementation written in Rust."

[profile.release]
lto = true
opt-level = "z" # Optimize for size.

# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
[[bin]]
name = "rustus"

[dependencies]
actix-web = { version = "^4.0.0-beta.15" }
actix-files = { version = "0.6.0-beta.13" }
tokio = { version = "1.4.0", features = ["time"] }
derive_more = { version = "^0.99.9", default-features = false, features = ["display", "from", "from_str"] }
thiserror = "^1.0"
async-trait = "0.1.52"
structopt = { version = "^0.3" }
uuid = { version = "^1.0.0-alpha.1", features = ["v4"] }
async-std = { version = "^1.10.0", features = ["tokio1"] }
base64 = "^0.13.0"
lazy_static = "1.4.0"
log = "^0.4.14"
serde = "1"
chrono = { version = "^0.4.19", features = ["serde"] }
serde_json = "1"
log = "^0.4.14"
url = "2.2.2"
base64 = "^0.13.0"
fern = { version = "0.6.0", features = ["colored"] }
strfmt = "^0.1.6"
lazy_static = "1.4.0"
strum = { version = "0.23", features = ["derive"] }
futures = { version = "^0.3.19", features = ["executor"] }
# Deps for info storages.
rbson = { version = "2.0", optional = true }
rbatis = { version = "^3.0", default-features = false, features = ["runtime-actix-rustls", "all-database"], optional = true }
mobc-redis = { version = "^0.7.0", optional = true }
# Deps for notifiers
lapin = { version = "^1.9.0", optional = true }
tokio-amqp = { version = "1.0.0", optional = true }
mobc-lapin = { version = "0.7.0", optional = true }
reqwest = { version = "^0.11.8", features = ["json"], optional = true }
thiserror = "^1.0"
url = "2.2.2"

[dependencies.openssl]
version = "0.10.38"
features = ["vendored"]

[dependencies.actix-files]
version = "0.6.0-beta.13"

[dependencies.actix-web]
version = "^4.0.0-beta.15"

[dependencies.async-std]
features = ["tokio1"]
version = "^1.10.0"

[dependencies.chrono]
features = ["serde"]
version = "^0.4.19"

[dependencies.derive_more]
default-features = false
features = ["display", "from", "from_str"]
version = "^0.99.9"

[dependencies.fern]
features = ["colored"]
version = "0.6.0"

[dependencies.futures]
features = ["executor"]
version = "^0.3.19"

[dependencies.lapin]
optional = true
version = "^1.9.0"

[dependencies.mobc-lapin]
optional = true
version = "0.7.0"

[dependencies.mobc-redis]
optional = true
version = "^0.7.0"

[dependencies.rbatis]
default-features = false
features = ["runtime-actix-rustls", "all-database"]
optional = true
version = "^3.0"

[dependencies.rbson]
optional = true
version = "2.0"

[dependencies.reqwest]
features = ["json"]
optional = true
version = "^0.11.8"

[dependencies.structopt]
version = "^0.3"

[dependencies.strum]
features = ["derive"]
version = "0.23"

[dependencies.tokio]
features = ["time"]
version = "1.4.0"

[dependencies.tokio-amqp]
optional = true
version = "1.0.0"

[dependencies.uuid]
features = ["v4"]
version = "^1.0.0-alpha.1"

[features]
default = []
all = ["redis_info_storage", "db_info_storage", "http_notifier", "amqp_notifier"]
redis_info_storage = ["mobc-redis"]
db_info_storage = ["rbatis", "rbson"]
amqp_notifier = ["lapin", "tokio-amqp", "mobc-lapin"]
db_info_storage = ["rbatis", "rbson"]
default = []
http_notifier = ["reqwest"]
redis_info_storage = ["mobc-redis"]

http_notifier = ["reqwest"]
[profile]
[profile.release]
lto = true
opt-level = "z"
codegen-units = 1
21 changes: 21 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
MIT License

Copyright (c) 2022 Pavel Kirilin

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
11 changes: 11 additions & 0 deletions deploy/alpine.Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
FROM alpine:3.15.0

ARG app_version

ADD "https://github.com/s3rius/rustus/releases/download/${app_version}/rustus-${app_version}-linux-musl-x86_64.tar.gz" "."

RUN tar xvf *.tar.gz
RUN rm *.tar.gz
RUN mv rustus /bin

ENTRYPOINT ["/bin/rustus"]

0 comments on commit bc6743c

Please sign in to comment.