41 lines
No EOL
1.3 KiB
YAML
41 lines
No EOL
1.3 KiB
YAML
name: Release
|
|
on:
|
|
push:
|
|
branches:
|
|
- 'master'
|
|
permissions:
|
|
pull-requests: write
|
|
contents: write
|
|
jobs:
|
|
release-plz:
|
|
name: Release-plz
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: Checkout repository
|
|
uses: actions/checkout@v4
|
|
with:
|
|
fetch-depth: 0
|
|
token: ${{ secrets.RELEASE_PLZ_PAT }}
|
|
- uses: actions-rs/toolchain@v1
|
|
with:
|
|
toolchain: nightly
|
|
override: true
|
|
profile: minimal
|
|
- name: Close old release PR
|
|
run: |
|
|
# List all opened PRs which head branch starts with "release-plz-"
|
|
release_pr=$(gh pr list --state='open' --json number,headRefName --jq '.[] | select(.headRefName | startswith("release-plz-")) | .number')
|
|
# Close the release PR if there is one
|
|
if [[ -n "$release_pr" ]]; then
|
|
echo "Closing old release PR $release_pr"
|
|
gh pr close $release_pr
|
|
else
|
|
echo "No open release PR"
|
|
fi
|
|
env:
|
|
GITHUB_TOKEN: ${{ secrets.RELEASE_PLZ_PAT }}
|
|
- name: Run release-plz
|
|
uses: MarcoIeni/release-plz-action@v0.5
|
|
env:
|
|
GITHUB_TOKEN: ${{ secrets.RELEASE_PLZ_PAT }}
|
|
CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }} |