Publish to crates.io #74
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: "Publish to crates.io" | |
permissions: | |
pull-requests: write | |
contents: write | |
on: | |
workflow_dispatch: | |
jobs: | |
release-plz: | |
name: Release-plz | |
runs-on: ubuntu-latest | |
steps: | |
- name: Generate GitHub token | |
uses: actions/create-github-app-token@v1 | |
id: generate-token | |
with: | |
app-id: ${{ secrets.RELEASER_APP_ID }} | |
private-key: ${{ secrets.RELEASER_PRIVATE_KEY }} | |
- name: Checkout repository | |
uses: actions/checkout@v3 | |
with: | |
fetch-depth: 0 | |
token: ${{ steps.generate-token.outputs.token }} | |
- name: Install Rust toolchain | |
uses: dtolnay/rust-toolchain@stable | |
- name: Install cargo-hakari | |
uses: taiki-e/install-action@v2 | |
with: | |
tool: cargo-hakari | |
- name: Set git identity | |
run: | | |
git config --global user.name "pavex-releaser[bot]" | |
git config --global user.email "[email protected]" | |
- name: Remove workspace hack from Cargo.toml | |
run: | | |
cd libs | |
cargo hakari disable | |
cargo hakari remove-deps -y | |
git add . | |
git commit -am "Disable workspace hack before a release" || echo "No changes to commit" | |
- name: Run release-plz | |
uses: MarcoIeni/[email protected] | |
with: | |
project_manifest: "libs/Cargo.toml" | |
config: "libs/.release-plz.toml" | |
env: | |
GITHUB_TOKEN: ${{ steps.generate-token.outputs.token }} | |
CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }} |