ci: automatize crate publishing (#603)

This commit is contained in:
Benoît Cortier 2024-12-11 09:11:56 -05:00 committed by GitHub
parent 0c10367ebc
commit d4ca10cdc2
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 154 additions and 0 deletions

53
.github/workflows/release-crates.yml vendored Normal file
View file

@ -0,0 +1,53 @@
name: Release crates
permissions:
pull-requests: write
contents: write
on:
push:
branches:
- master
jobs:
# Create a PR with the new versions and changelog, preparing the next release.
open-pr:
name: Release-plz PR
runs-on: ubuntu-latest
concurrency:
group: release-plz-${{ github.ref }}
cancel-in-progress: false
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 512
- name: Run release-plz
uses: release-plz/action@v0.5
with:
command: release-pr
env:
GITHUB_TOKEN: ${{ github.token }}
# Release unpublished packages.
release-plz-release:
name: Release-plz release
runs-on: ubuntu-latest
environment: cratesio-push
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 512
- name: Run release-plz
uses: release-plz/action@v0.5
with:
command: release
env:
GITHUB_TOKEN: ${{ github.token }}
CARGO_REGISTRY_TOKEN: ${{ secrets.CRATES_IO_DEVOLUTIONSBOT_API_KEY }}