Skip to content

shell: upload_assets.sh #10

shell: upload_assets.sh

shell: upload_assets.sh #10

Workflow file for this run

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
- name: Install Protoc
uses: arduino/setup-protoc@v3
- 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}