Skip to content

publish rust library #57

publish rust library

publish rust library #57

name: publish rust library
env:
CARGO_INCREMENTAL: 0
CARGO_NET_RETRY: 10
CI: 1
RUST_BACKTRACE: short
RUSTFLAGS: "-D warnings -W unreachable-pub -W bare-trait-objects"
RUSTUP_MAX_RETRIES: 10
# update RUST_CHANNEL and CARGO_DENY in sync
# version 0.18.4 of cargo-deny requires rustc 1.88.0 breaks our current version on 1.87
RUST_CHANNEL: '1.87.0'
CARGO_DENY_VERSION: '0.18.3'
on:
workflow_dispatch:
jobs:
publish:
name: Check and publish
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v5
- name: Stand up MinIO
run: |
docker compose up -d minio
- name: Wait for MinIO to be ready
run: |
for _ in {1..10}; do
if curl --silent --fail http://minio:9000/minio/health/live; then
break
fi
sleep 3
done
docker compose exec -T minio mc alias set minio http://minio:9000 minio123 minio123
- name: Install Just
run: sudo snap install --edge --classic just
- name: Install Rust toolchain
run: |
rustup update --no-self-update ${{ env.RUST_CHANNEL }}
rustup component add --toolchain ${{ env.RUST_CHANNEL }} rustfmt rust-src clippy
rustup default ${{ env.RUST_CHANNEL }}
- name: Cache Dependencies
uses: Swatinem/rust-cache@v2
with:
# workspaces: "rust -> target"
key: ${{ env.RUST_CHANNEL }}
- name: Install cargo-deny
run: cargo install --locked cargo-deny --version ${{ env.CARGO_DENY_VERSION }}
- name: Check
if: github.event_name == 'push'
run: |
just pre-commit-ci
- name: Install cargo-release
run: cargo install --locked cargo-release
- name: Setup git committer
run: |
git config --global user.email "joe@earthmover.io"
git config --global user.name "Joe Hamman"
# - name: publish helper macros crate to crates.io
# run: cargo release -p icechunk-macros --no-confirm --no-tag --execute
# env:
# CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }}
- name: publish icechunk crate to crates.io
run: cargo release --no-confirm --no-tag --execute
env:
CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }}