Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
name: CI

# Pushes to main run CI via release-plz.yml (as a reusable workflow), so
# releases can be gated on it without a `workflow_run` trigger.
on:
push:
branches:
- main
pull_request:
workflow_dispatch:
workflow_call:

concurrency:
group: ci-${{ github.ref }}
Expand Down
21 changes: 14 additions & 7 deletions .github/workflows/release-plz.yml
Original file line number Diff line number Diff line change
@@ -1,17 +1,23 @@
name: Release-plz

# Only release once CI has passed on main.
# Only release once CI has passed on main. CI is invoked as a reusable workflow
# rather than via `workflow_run`, because crates.io trusted publishing rejects
# OIDC tokens from `workflow_run`-triggered runs.
on:
workflow_run:
workflows: [CI]
types: [completed]
branches: [main]
push:
branches:
- main

jobs:
ci:
name: CI
uses: ./.github/workflows/ci.yml

release-plz-release:
name: Release-plz release
runs-on: ubuntu-latest
if: ${{ github.repository_owner == 'toolCHAINZ' && github.event.workflow_run.conclusion == 'success' && github.event.workflow_run.event == 'push' }}
needs: ci
if: ${{ github.repository_owner == 'toolCHAINZ' }}
permissions:
contents: write
id-token: write
Expand Down Expand Up @@ -40,7 +46,8 @@ jobs:
release-plz-pr:
name: Release-plz PR
runs-on: ubuntu-latest
if: ${{ github.repository_owner == 'toolCHAINZ' && github.event.workflow_run.conclusion == 'success' && github.event.workflow_run.event == 'push' }}
needs: ci
if: ${{ github.repository_owner == 'toolCHAINZ' }}
permissions:
pull-requests: write
contents: write
Expand Down
Loading