feat: add standalone SQLite backed denokv server #54
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: ci | ||
on: | ||
push: | ||
branches: ["main"] | ||
tags: ["*"] | ||
pull_request: | ||
branches: ["main"] | ||
env: | ||
CARGO_TERM_COLOR: always | ||
RUST_BACKTRACE: full | ||
jobs: | ||
test: | ||
runs-on: ${{ matrix.os }} | ||
matrix: | ||
os: [ubuntu-latest, macos-latest, windows-latest] | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- name: Install Rust | ||
uses: dsherret/rust-toolchain-file@v1 | ||
- name: Install protoc | ||
uses: arduino/setup-protoc@v2 | ||
with: | ||
version: "21.12" | ||
- name: Check formatting | ||
run: cargo fmt -- --check | ||
- name: Check linting | ||
run: cargo clippy --release --all-targets --all-features -- -D clippy::all | ||
- name: Build | ||
run: cargo build --release --all-targets --all-features --tests -v | ||
- name: Test | ||
run: cargo test --release | ||
- name: Prepare artifact (Linux) | ||
if: runner.os == 'Linux' && github.repository == 'denoland/denokv' && startsWith(github.ref, 'refs/tags/') | ||
run: |- | ||
cd target/release | ||
zip -r denokv-x86_64-unknown-linux-gnu.zip denokv | ||
- name: Prepare artifact (macOS) | ||
if: runner.os == 'macOS' && github.repository == 'denoland/denokv' && startsWith(github.ref, 'refs/tags/') | ||
run: |- | ||
cd target/release | ||
zip -r denokv-x86_64-apple-darwin.zip denokv | ||
- name: Prepare artifact (Windows) | ||
if: runner.os == 'Windows' && github.repository == 'denoland/denokv' && startsWith(github.ref, 'refs/tags/') | ||
run: |- | ||
Compress-Archive -CompressionLevel Optimal -Force -Path target/release/denokv.exe -DestinationPath target/release/denokv-x86_64-pc-windows-msvc.zip | ||
- name: Upload release to GitHub | ||
uses: softprops/[email protected] | ||
if: github.repository == 'denoland/denokv' && startsWith(github.ref, 'refs/tags/')) | ||
env: | ||
GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}" | ||
with: | ||
files: |- | ||
target/release/denokv-x86_64-pc-windows-msvc.zip | ||
target/release/denokv-x86_64-unknown-linux-gnu.zip | ||
target/release/denokv-x86_64-apple-darwin.zip | ||
draft: true | ||
- name: Publish to crates.io | ||
if: runner.os == 'Linux' && github.repository == 'denoland/denokv' && startsWith(github.ref, 'refs/tags/') | ||
env: | ||
CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }} | ||
run: |- | ||
cargo publish -vv -p denokv_proto | ||
cargo publish -vv -p denokv_sqlite | ||
cargo publish -vv -p denokv_remote | ||
cargo publish -vv -p denokv |