Skip to content

Release crate

Release crate #6

Workflow file for this run

---
name: Release crate
on:
workflow_dispatch:
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.sha }}
cancel-in-progress: true
env:
COLOR: yes
FORCE_COLOR: 1
CARGO_TERM_COLOR: always
CARGO_TERM_PROGRESS_WHEN: never
CARGO_INCREMENTAL: 0
RUST_BACKTRACE: 1
CARGO_NET_RETRY: 10
BINSTALL_DISABLE_TELEMETRY: true
jobs:
build:
permissions:
contents: read
if: ${{ github.ref == 'refs/heads/main' }}
name: Build and test
runs-on: ubuntu-latest
steps:
- name: Rust version
run: |
rustc --version
cargo --version
- name: Checkout repo
uses: actions/checkout@v5
- name: Cache Cargo
uses: ./.github/actions/cache
- name: Install CLI tools
uses: ./.github/actions/install-tools
with:
default-datasource: crate
- name: Run tests
run: |
cargo nextest run --tests --lib -P ci
publish-github:
permissions:
contents: write
runs-on: ubuntu-latest
needs: build
steps:
- name: Checkout repo
uses: actions/checkout@v5
- name: Publish github
run: |
package_version=$(cargo metadata --format-version 1 --no-deps| jq -r '.packages[] | select(.name=="deku_string") .version')
gh release create "v${package_version}" --fail-on-no-commits --generate-notes --latest
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
publish-cargo:
runs-on: ubuntu-latest
needs: publish-github
permissions:
contents: read
steps:
- name: Checkout repo
uses: actions/checkout@v5
- name: Package
run: cargo publish --no-verify
env:
CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }}