Template
92 lines
2.5 KiB
YAML
92 lines
2.5 KiB
YAML
name: Release-plz
|
|
|
|
on:
|
|
push:
|
|
# Comment out branch restrictions until we are closer to done
|
|
# branches:
|
|
# - [main, master]
|
|
|
|
jobs:
|
|
|
|
# Release unpublished packages.
|
|
release-plz-release:
|
|
name: Release-plz release
|
|
runs-on: ubuntu-latest
|
|
|
|
permissions:
|
|
contents: write
|
|
pull-requests: read
|
|
|
|
steps:
|
|
|
|
- &setup-git-user
|
|
name: Config Git User
|
|
run: |
|
|
git config --global user.name "ci-bot"
|
|
git config --global user.email "bot@email.melfely.com"
|
|
|
|
- &checkout
|
|
name: Checkout repository
|
|
uses: actions/checkout@v6
|
|
with:
|
|
fetch-depth: 0
|
|
persist-credentials: false
|
|
|
|
- &install-rust
|
|
name: Install Rust toolchain
|
|
uses: dtolnay/rust-toolchain@stable
|
|
|
|
- &install-cargo-semver
|
|
name: Install Cargo SemVer Checks
|
|
uses: taiki-e/install-action@fa23953489c080190314742a9b907f8e97c6767c # v2.87.10
|
|
with:
|
|
tool: cargo-semver-checks
|
|
|
|
- &install-release-plz
|
|
name: Install release-plz
|
|
uses: taiki-e/install-action@fa23953489c080190314742a9b907f8e97c6767c # v2.87.10
|
|
with:
|
|
tool: release-plz
|
|
|
|
|
|
|
|
- name: Run release-plz release
|
|
run: |
|
|
release-plz release --forge gitea --git-token ${{ secrets.GITEA_TOKEN }} --registry gitea --token "Bearer ${{ secrets.CARGO_REGISTRIES_GITEA_TOKEN }}"
|
|
|
|
# Create a PR with the new versions and changelog, preparing the next releases
|
|
release-plz-pr:
|
|
name: Release-plz PR
|
|
runs-on: ubuntu-latest
|
|
|
|
permissions:
|
|
contents: write
|
|
pull-requests: write
|
|
|
|
concurrency:
|
|
group: release-plz-${{ github.ref }}
|
|
cancel-in-progress: false
|
|
|
|
steps:
|
|
- *setup-git-user
|
|
- *checkout
|
|
- *install-rust
|
|
- *install-cargo-semver
|
|
- *install-release-plz
|
|
|
|
- name: Configure git remote with token
|
|
run: |
|
|
OWNER="${GITEA_REPOSITORY_OWNER:-${GITEA_REPO_OWNER}}"
|
|
REPO="${GITEA_REPOSITORY_NAME:-${GITEA_REPO_NAME}}"
|
|
HOST="${GITEA_HOST:-gitea.melfely.com}"
|
|
git remote set-url origin "https://git:${GITEA_TOKEN}@${HOST}/${OWNER}/${REPO}.git"
|
|
env:
|
|
GITEA_TOKEN: ${{ secrets.GITEA_TOKEN }}
|
|
GITEA_HOST: ${{ secrets.GITEA_HOST }}
|
|
GITEA_REPOSITORY_OWNER: ${{ gitea.repository.owner }}
|
|
GITEA_REPOSITORY_NAME: ${{ gitea.repository.name }}
|
|
|
|
- name: Run release-plz release-pr
|
|
run: |
|
|
release-plz release-pr --forge gitea --git-token ${{ secrets.GITEA_TOKEN }} --registry gitea
|