Skip to content

Commit 8199b81

Browse files
committed
chore: refactor model push job into separate workflow
Signed-off-by: Sam Gammon <sam@elide.ventures>
1 parent 71386dc commit 8199b81

File tree

4 files changed

+54
-47
lines changed

4 files changed

+54
-47
lines changed

.github/workflows/checks.model.yml

-40
Original file line numberDiff line numberDiff line change
@@ -115,46 +115,6 @@ jobs:
115115
- name: "Check: Buf Breaking"
116116
uses: bufbuild/buf-breaking-action@a074e988ee34efcd4927079e79c611f428354c01 # v1.1.3
117117
continue-on-error: ${{ inputs.ignore_breaking }}
118-
# continue-on-error: ${{ contains(github.event.pull_request.labels.*.name, 'ci:buf-breaking-ignore') }}
119118
with:
120119
against: https://github.com/elide-dev/elide.git#branch=main
121120
input: proto
122-
123-
##
124-
## Job: Buf Push
125-
##
126-
buf-push:
127-
name: "Protocol: Push"
128-
runs-on: ubuntu-latest
129-
if: inputs.push
130-
needs: ["buf-lint", "buf-breaking"]
131-
defaults:
132-
run:
133-
shell: bash
134-
# if: |
135-
# (
136-
# github.ref == 'refs/heads/stable' ||
137-
# github.ref == 'refs/heads/main' ||
138-
# startsWith(github.ref, 'refs/tags/v')
139-
# )
140-
permissions:
141-
contents: "read"
142-
steps:
143-
- name: "Setup: Harden Runner"
144-
uses: step-security/harden-runner@63c24ba6bd7ba022e95695ff85de572c04a18142 # v2.7.0
145-
with:
146-
egress-policy: audit
147-
- name: "Setup: Checkout"
148-
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
149-
with:
150-
fetch-depth: 0
151-
persist-credentials: false
152-
- name: "Setup: Buf"
153-
uses: bufbuild/buf-setup-action@382440cdb8ec7bc25a68d7b4711163d95f7cc3aa # v1.28.1
154-
with:
155-
github_token: ${{ github.token }}
156-
- name: "Push: BSR"
157-
uses: bufbuild/buf-push-action@a654ff18effe4641ebea4a4ce242c49800728459 # v1.2.0
158-
with:
159-
buf_token: ${{ secrets.BUF_TOKEN }}
160-
input: proto
+49
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
name: Model
2+
3+
"on":
4+
workflow_dispatch: {}
5+
workflow_call:
6+
secrets:
7+
BUF_TOKEN:
8+
required: true
9+
10+
permissions:
11+
contents: read
12+
13+
concurrency:
14+
group: "deploy"
15+
cancel-in-progress: false
16+
17+
jobs:
18+
##
19+
## Job: Buf Push
20+
##
21+
buf-push:
22+
name: "Protocol: Push"
23+
runs-on: ubuntu-latest
24+
if: inputs.push
25+
needs: ["buf-lint", "buf-breaking"]
26+
defaults:
27+
run:
28+
shell: bash
29+
permissions:
30+
contents: "read"
31+
steps:
32+
- name: "Setup: Harden Runner"
33+
uses: step-security/harden-runner@63c24ba6bd7ba022e95695ff85de572c04a18142 # v2.7.0
34+
with:
35+
egress-policy: audit
36+
- name: "Setup: Checkout"
37+
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
38+
with:
39+
fetch-depth: 0
40+
persist-credentials: false
41+
- name: "Setup: Buf"
42+
uses: bufbuild/buf-setup-action@382440cdb8ec7bc25a68d7b4711163d95f7cc3aa # v1.28.1
43+
with:
44+
github_token: ${{ github.token }}
45+
- name: "Push: BSR"
46+
uses: bufbuild/buf-push-action@a654ff18effe4641ebea4a4ce242c49800728459 # v1.2.0
47+
with:
48+
buf_token: ${{ secrets.BUF_TOKEN }}
49+
input: proto

.github/workflows/on.pr.yml

+2
Original file line numberDiff line numberDiff line change
@@ -199,6 +199,8 @@ jobs:
199199
BUF_TOKEN: ${{ secrets.BUF_TOKEN }}
200200
permissions:
201201
contents: "read"
202+
with:
203+
ignore_breaking: ${{ contains(github.event.pull_request.labels.*.name, 'ci:buf-breaking-ignore') }}
202204

203205
##
204206
## Job: Check for Wrapper

.github/workflows/on.push.yml

+3-7
Original file line numberDiff line numberDiff line change
@@ -38,17 +38,13 @@ jobs:
3838
##
3939
## Job: Checks for Models
4040
##
41-
check-model:
42-
name: "Checks"
43-
uses: ./.github/workflows/checks.model.yml
41+
publish-model:
42+
name: "Publish"
43+
uses: ./.github/workflows/job.deploy-model.yml
4444
secrets:
4545
BUF_TOKEN: ${{ secrets.BUF_TOKEN }}
4646
permissions:
4747
contents: "read"
48-
with:
49-
push: true
50-
lint: false
51-
breakcheck: false
5248

5349
##
5450
## Job: Check for Wrapper

0 commit comments

Comments
 (0)