Skip to content

Bump version to 0.5.1 #30

Bump version to 0.5.1

Bump version to 0.5.1 #30

Workflow file for this run

name: Release
on:
push:
tags: ["v*"]
permissions:
contents: write
env:
CARGO_TERM_COLOR: always
jobs:
# Run all tests before building release artifacts
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
- uses: Swatinem/rust-cache@v2
- run: cargo check --all-targets
- run: cargo clippy -- -D warnings
- run: cargo test
- name: Start test databases
run: docker compose -f tests/docker-compose.yml up -d --wait
- name: Run integration tests
run: cargo test --features integration --test integration
- name: Stop test databases
if: always()
run: docker compose -f tests/docker-compose.yml down -v
build:
needs: test
strategy:
matrix:
include:
- target: x86_64-unknown-linux-musl
os: ubuntu-latest
- target: aarch64-unknown-linux-musl
os: ubuntu-latest
- target: x86_64-apple-darwin
os: macos-latest
- target: aarch64-apple-darwin
os: macos-latest
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
with:
targets: ${{ matrix.target }}
- uses: Swatinem/rust-cache@v2
with:
key: ${{ matrix.target }}
- name: Install musl tools (x86_64)
if: matrix.target == 'x86_64-unknown-linux-musl'
run: |
sudo apt-get update
sudo apt-get install -y musl-tools
- name: Install musl tools (aarch64)
if: matrix.target == 'aarch64-unknown-linux-musl'
uses: taiki-e/setup-cross-toolchain-action@v1
with:
target: ${{ matrix.target }}
- name: Build
run: cargo build --release --target ${{ matrix.target }}
- name: Package
shell: bash
run: |
tag="${GITHUB_REF#refs/tags/}"
name="pg_glimpse-${tag}-${{ matrix.target }}"
mkdir "$name"
cp target/${{ matrix.target }}/release/pg_glimpse "$name/"
cp README.md LICENSE "$name/"
tar czf "${name}.tar.gz" "$name"
echo "ASSET=${name}.tar.gz" >> $GITHUB_ENV
- uses: actions/upload-artifact@v4
with:
name: ${{ matrix.target }}
path: ${{ env.ASSET }}
release:
needs: build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/download-artifact@v4
with:
path: artifacts
- name: Create release
env:
GH_TOKEN: ${{ github.token }}
run: |
tag="${GITHUB_REF#refs/tags/}"
files=$(find artifacts -name '*.tar.gz' -type f)
gh release create "$tag" $files \
--title "$tag" \
--generate-notes
publish-crate:
needs: release
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
- run: cargo publish
env:
CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }}