Skip to content

Commit

Permalink
build: some small fixes to CI (#106)
Browse files Browse the repository at this point in the history
- (hopefully) properly publish Docker images with versions on ghcr.io
- (hopefully) properly cache librocksdb-sys with rust-cache

Release-As: 0.5.6
  • Loading branch information
holtgrewe authored Jun 19, 2023
1 parent 8199d3e commit fb54df0
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 7 deletions.
23 changes: 16 additions & 7 deletions .github/workflows/release-please.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,19 +20,25 @@ jobs:
runs-on: ubuntu-latest
outputs:
release_created: ${{ steps.release.outputs.release_created }}
release_name: ${{ steps.release.outputs.release_name }}
steps:
- uses: GoogleCloudPlatform/release-please-action@v3
id: release
with:
release-type: rust
package-name: ${{ env.PACKAGE_NAME}}

cargo-release:
needs: release-please
runs-on: ubuntu-latest
if: ${{ needs.release-please.outputs.release_created }}
steps:
- uses: actions/checkout@v3
if: ${{ steps.release.outputs.release_created }}
if: ${{ needs.release-please.outputs.release_created }}

- name: Install stable toolchain
uses: actions-rs/toolchain@v1
if: ${{ steps.release.outputs.release_created }}
if: ${{ needs.release-please.outputs.release_created }}
with:
toolchain: stable
override: true
Expand All @@ -43,10 +49,13 @@ jobs:
repo-token: ${{ secrets.GITHUB_TOKEN }}

- uses: Swatinem/rust-cache@v2
if: ${{ steps.release.outputs.release_created }}
if: ${{ needs.release-please.outputs.release_created }}
with:
cache-directories: |
~/.cargo/registry/src/**/librocksdb-sys-*
- name: Publish crate
if: ${{ steps.release.outputs.release_created }}
if: ${{ needs.release-please.outputs.release_created }}
uses: actions-rs/cargo@v1
with:
command: publish
Expand Down Expand Up @@ -74,9 +83,9 @@ jobs:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
tags: |
type=raw,value=latest,enable={{is_default_branch}}
type=semver,pattern={{version}}
type=semver,pattern={{major}}.{{minor}}
type=semver,pattern={{major}}
type=semver,pattern={{version}},value=${{ needs.release-please.outputs.release_name }}
type=semver,pattern={{major}}.{{minor}},value=${{ needs.release-please.outputs.release_name }}
type=semver,pattern={{major}},value=${{ needs.release-please.outputs.release_name }}
type=sha
- name: Build and push Docker image
Expand Down
6 changes: 6 additions & 0 deletions .github/workflows/rust.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,9 @@ jobs:
repo-token: ${{ secrets.GITHUB_TOKEN }}

- uses: Swatinem/rust-cache@v2
with:
cache-directories: |
~/.cargo/registry/src/**/librocksdb-sys-*
- name: Lint with clippy
uses: actions-rs/clippy-check@v1
Expand Down Expand Up @@ -98,6 +101,9 @@ jobs:
repo-token: ${{ secrets.GITHUB_TOKEN }}

- uses: Swatinem/rust-cache@v2
with:
cache-directories: |
~/.cargo/registry/src/**/librocksdb-sys-*
- name: Run cargo-tarpaulin with fast tests
uses: actions-rs/[email protected]
Expand Down

0 comments on commit fb54df0

Please sign in to comment.