From f4beb7334b8558e6f84110ccce08733d28cfe057 Mon Sep 17 00:00:00 2001 From: Conor Schaefer Date: Wed, 5 Feb 2025 10:03:15 -0800 Subject: [PATCH] ci: make workflows runnable ad-hoc We want to publish the protobuf changes in `protocol/lqt_support` (#5010) to unblock web integrations. In order to run the workflow ad-hoc on a branch, we need to permit `workflow_dispatch` runs. The `workflow_call` additions are not currently used, but have been in the past, and permit triggering via cross-repo API. Also updates the buf lint job to run against *all* PRs, not just those against main. This effectively reverts b3204b198cfdd1c787832382b804dac9fc76db4e, which is over a year old, and predates the stabilization of the protos. --- .github/workflows/buf-pull-request.yml | 7 ++++--- .github/workflows/buf-push.yml | 12 +++++++++--- .github/workflows/docs-lint.yml | 6 +++++- .github/workflows/notes.yml | 4 ++-- 4 files changed, 20 insertions(+), 9 deletions(-) diff --git a/.github/workflows/buf-pull-request.yml b/.github/workflows/buf-pull-request.yml index 58758591ec..9cb74597d2 100644 --- a/.github/workflows/buf-pull-request.yml +++ b/.github/workflows/buf-pull-request.yml @@ -1,9 +1,10 @@ name: protobuf on: - # Exclude feature branches, only run if the PR is targeting main. + # Run against all PRs, regardless of feature branch target. pull_request: - branches: - - "main" + # Also support ad-hoc calls for workflow. + workflow_call: + workflow_dispatch: jobs: # Ensure there are no breaking changes to the protocol specs, # by running the "buf lint" action against the changes in this PR. diff --git a/.github/workflows/buf-push.yml b/.github/workflows/buf-push.yml index 923650d6f8..8d5b0563c5 100644 --- a/.github/workflows/buf-push.yml +++ b/.github/workflows/buf-push.yml @@ -1,13 +1,19 @@ name: protobuf -# We want to rebuild on every commit to main, and also for named testnet tags, -# so that API users can pick a tagged version of the protobuf definitions -# to use against a matching testnet. +# We're keeping the protodefs stable at v1, via buf lint checks on PRs. +# Therefore it's safe to publish on every commit to main (and also tags). on: push: branches: - main + # Consider automatically publishing on upcoming protocol changes, + # to allow integration in downstream, e.g. web dependencies. + # - protocol/* tags: - '**' + # Also support ad-hoc calls for workflow + workflow_call: + workflow_dispatch: + jobs: publish: runs-on: ubuntu-latest diff --git a/.github/workflows/docs-lint.yml b/.github/workflows/docs-lint.yml index f0ff9740c7..3fc3eb4fbb 100644 --- a/.github/workflows/docs-lint.yml +++ b/.github/workflows/docs-lint.yml @@ -1,5 +1,9 @@ name: docs-lint -on: pull_request +on: + pull_request: + # Also support ad-hoc calls for workflow. + workflow_call: + workflow_dispatch: jobs: rustdocs: diff --git a/.github/workflows/notes.yml b/.github/workflows/notes.yml index e99940740a..629ae9f18e 100644 --- a/.github/workflows/notes.yml +++ b/.github/workflows/notes.yml @@ -1,10 +1,10 @@ name: docs - on: - workflow_dispatch: push: branches: - main + workflow_dispatch: + workflow_call: jobs: