Skip to content

Commit

Permalink
release
Browse files Browse the repository at this point in the history
  • Loading branch information
lucacasonato committed Oct 31, 2023
1 parent eac07ca commit e22dc66
Show file tree
Hide file tree
Showing 2 changed files with 43 additions and 11 deletions.
48 changes: 38 additions & 10 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,9 @@ env:

jobs:
test:
runs-on: ubuntu-latest
runs-on: ${{ matrix.os }}
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]

steps:
- uses: actions/checkout@v3
Expand All @@ -30,22 +32,48 @@ jobs:
run: cargo fmt -- --check

- name: Check linting
run: cargo clippy --all-targets --all-features -- -D clippy::all
run: cargo clippy --release --all-targets --all-features -- -D clippy::all

- name: Build
run: cargo build --all-targets --all-features --tests -v
run: cargo build --release --all-targets --all-features --tests -v

- name: Test
run: cargo test
run: cargo test --release

- name: Publish
if: |
runner.os == 'Linux' &&
github.repository == 'denoland/denokv' &&
startsWith(github.ref, 'refs/tags/')
- 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: |
run: |-
cargo publish -vv -p denokv_proto
cargo publish -vv -p denokv_sqlite
cargo publish -vv -p denokv_remote
Expand Down
6 changes: 5 additions & 1 deletion denokv/tests/integration.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,11 @@ fn denokv_exe() -> PathBuf {
} else {
path.push("release");
}
path.push("denokv");
if cfg!(target_os = "windows") {
path.push("denokv.exe");
} else {
path.push("denokv");
}
path
}

Expand Down

0 comments on commit e22dc66

Please sign in to comment.