name: Release
on:
push:
branches:
- main
workflow_dispatch:
permissions:
contents: read
jobs:
release:
name: Publish release
runs-on: ubuntu-latest
if: ${{ github.repository_owner == '0809android' }}
permissions:
contents: write
pull-requests: read
id-token: write
steps:
- &checkout
name: Checkout
uses: actions/checkout@v6
with:
fetch-depth: 0
persist-credentials: false
- &install-rust
name: Install Rust
uses: dtolnay/rust-toolchain@stable
with:
components: clippy, rustfmt
- name: Check formatting
run: cargo fmt -- --check
- name: Run clippy
run: cargo clippy --all-targets --all-features -- -D warnings
- name: Run tests
run: cargo test
- name: Verify package
run: cargo publish --dry-run
- name: Publish release
uses: release-plz/action@v0.5.128
with:
command: release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
release-pr:
name: Create release PR
runs-on: ubuntu-latest
if: ${{ github.repository_owner == '0809android' }}
permissions:
contents: write
pull-requests: write
concurrency:
group: release-plz-${{ github.ref }}
cancel-in-progress: false
steps:
- *checkout
- *install-rust
- name: Create release PR
uses: release-plz/action@v0.5.128
with:
command: release-pr
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}