name: Publish to crates.io
on:
workflow_dispatch:
release:
types: [published]
permissions:
contents: read
jobs:
publish-pyroscope:
name: pyroscope-lib
runs-on: ${{ github.repository_owner == 'grafana' && 'ubuntu-x64-large' || 'ubuntu-latest' }}
if: "startsWith(github.event.release.tag_name, 'lib-')"
permissions:
contents: read
id-token: write
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd with:
persist-credentials: false
- uses: dtolnay/rust-toolchain@3c5f7ea28cd621ae0bf5283f0e981fb97b8a7af9
with:
toolchain: 1.88.0
- name: Authenticate with crates.io
id: auth
uses: rust-lang/crates-io-auth-action@bbd81622f20ce9e2dd9622e3218b975523e45bbe - name: publish pyroscope crate
run: cargo publish
env:
CARGO_REGISTRY_TOKEN: ${{ steps.auth.outputs.token }}
publish-kindasafe:
name: kindasafe
runs-on: ${{ github.repository_owner == 'grafana' && 'ubuntu-x64-large' || 'ubuntu-latest' }}
if: "startsWith(github.event.release.tag_name, 'kindasafe-')"
permissions:
contents: read
id-token: write
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd with:
persist-credentials: false
- uses: dtolnay/rust-toolchain@3c5f7ea28cd621ae0bf5283f0e981fb97b8a7af9
with:
toolchain: 1.88.0
- name: Authenticate with crates.io
id: auth
uses: rust-lang/crates-io-auth-action@bbd81622f20ce9e2dd9622e3218b975523e45bbe - name: publish kindasafe crate
run: cargo publish --manifest-path kit/kindasafe/Cargo.toml
env:
CARGO_REGISTRY_TOKEN: ${{ steps.auth.outputs.token }}
- name: wait for crates.io index
run: sleep 15
- name: publish kindasafe_init crate
run: cargo publish --manifest-path kit/kindasafe_init/Cargo.toml
env:
CARGO_REGISTRY_TOKEN: ${{ steps.auth.outputs.token }}