feat: add graceful shutdown functionality to the service #12
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: Rust | |
permissions: | |
contents: write | |
on: | |
push: | |
tags: | |
- v[0-9]+.* | |
pull_request: | |
tags: | |
- v[0-9]+.* | |
env: | |
CARGO_TERM_COLOR: always | |
jobs: | |
create-release: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: taiki-e/create-gh-release-action@v1 | |
with: | |
token: ${{ secrets.GITHUB_TOKEN }} | |
upload-assets: | |
needs: create-release | |
strategy: | |
matrix: | |
include: | |
- target: x86_64-unknown-linux-gnu | |
os: ubuntu-latest | |
- target: aarch64-unknown-linux-gnu | |
os: ubuntu-latest | |
- target: x86_64-apple-darwin | |
os: macos-latest | |
- target: aarch64-apple-darwin | |
os: macos-latest | |
- target: x86_64-pc-windows-msvc | |
os: windows-latest | |
- target: aarch64-pc-windows-msvc | |
os: windows-latest | |
runs-on: ${{ matrix.os }} | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/cache@v4 | |
with: | |
path: | | |
~/.cargo/registry/index/ | |
~/.cargo/registry/cache/ | |
~/.cargo/git/db/ | |
target/ | |
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }} | |
restore-keys: | | |
${{ runner.os }}-cargo- | |
- name: Install Protoc | |
uses: arduino/setup-protoc@v3 | |
with: | |
repo-token: ${{ secrets.GITHUB_TOKEN }} | |
- name: Build | |
run: cargo build --verbose | |
- name: Run tests | |
run: cargo test --verbose | |
- name: Install cross-compilation tools | |
uses: taiki-e/setup-cross-toolchain-action@v1 | |
with: | |
target: ${{ matrix.target }} | |
if: startsWith(matrix.os, 'ubuntu') | |
- uses: taiki-e/upload-rust-binary-action@v1 | |
with: | |
bin: minkv | |
target: ${{ matrix.target }} | |
tar: unix | |
zip: windows | |
archive: $bin-$tag-$target | |
token: ${{ secrets.GITHUB_TOKEN }} | |
finish_release: | |
needs: upload-assets | |
runs-on: ubuntu-latest | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
ACCESS_KEY_ID: ${{ secrets.OSS_ACCESS_KEY_ID }} | |
ACCESS_KEY_SECRET: ${{ secrets.OSS_ACCESS_KEY_SECRET }} | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
submodules: true | |
ref: ${{github.ref}} | |
- name: Download assets and upload assets to aliyun oss | |
run: | | |
TAG=${{ github.ref_name }} | |
VERSION=${TAG#v} | |
bash tools/upload_assets.sh ${VERSION} |