Skip to content

Commit

Permalink
ci updates
Browse files Browse the repository at this point in the history
  • Loading branch information
joroshiba committed Apr 22, 2024
1 parent 6009d0a commit ebb17a7
Show file tree
Hide file tree
Showing 2 changed files with 35 additions and 2 deletions.
18 changes: 16 additions & 2 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,21 @@ jobs:
runs-on: ubuntu-latest
environment: BUF
needs: run_checker
if: needs.run_checker.outputs.run_release_proto == 'true' && github.repository_owner == 'astriaorg'
if: github.event_name != 'merge_group' && needs.run_checker.outputs.run_release_proto == 'true' && github.repository_owner == 'astriaorg'
steps:
- uses: actions/checkout@v4
- uses: bufbuild/buf-setup-action@v1
with:
version: "1.15.1"
github_token: ${{ github.token }}
- name: "Get Buf Branch Annotation"
if: github.event_name == 'pull_request'
run: |
if [ "${{ github.event_name }}" == "pull_request" ]; then
echo "buf_repo_ending='pr/${{ github.event.number }}'" >> $GITHUB_ENV
else
echo "buf_repo_ending='main'" >> $GITHUB_ENV
fi
- name: "Upload Composer API Protos"
uses: bufbuild/buf-push-action@v1
with:
Expand All @@ -36,6 +44,8 @@ jobs:
- name: "Update Sequencer Block API dependency"
run: |
cd proto/sequencerblockapis
BUF_COMMIT=$(buf beta registry commit get buf.build/astria/primitives:${{ env.buf_repo_ending }} -- format=json | jq -r '.commit')
sed -i "s/buf.build\/astria\/primitives/buf.build\/astria\/primitives:$BUF_COMMIT/" buf.yaml
buf mod update --only buf.build/astria/primitives
- name: "Upload Sequencer Block API Protos"
uses: bufbuild/buf-push-action@v1
Expand All @@ -46,6 +56,8 @@ jobs:
- name: "Update Execution API dependency"
run: |
cd proto/executionapis
BUF_COMMIT=$(buf beta registry commit get buf.build/astria/sequencerblock-apis:${{ env.buf_repo_ending }} -- format=json | jq -r '.commit')
sed -i "s/buf.build\/astria\/primitives/buf.build\/astria\/sequencerblock-apis:$BUF_COMMIT/" buf.yaml
buf mod update --only buf.build/astria/sequencerblock-apis
- name: "Upload Execution API Protos"
uses: bufbuild/buf-push-action@v1
Expand All @@ -56,6 +68,8 @@ jobs:
- name: "Update Protocol API dependency"
run: |
cd proto/protocolapis
BUF_COMMIT=$(buf beta registry commit get buf.build/astria/primitives:${{ env.buf_repo_ending }} -- format=json | jq -r '.commit')
sed -i "s/buf.build\/astria\/primitives/buf.build\/astria\/primitives:$BUF_COMMIT/" buf.yaml
buf mod update --only buf.build/astria/primitives
- name: "Upload Protocol API Protos"
uses: bufbuild/buf-push-action@v1
Expand All @@ -69,7 +83,7 @@ jobs:
contents: write
runs-on: ubuntu-latest
needs: run_checker
if: needs.run_checker.outputs.run_release_charts == 'true'
if: github.ref_name == 'main' && needs.run_checker.outputs.run_release_charts == 'true'
steps:
- name: Checkout Repo
uses: actions/checkout@v4
Expand Down
19 changes: 19 additions & 0 deletions .github/workflows/reusable-proto-deploy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
name: Reusable Proto Deploy Workflow

on:
workflow_call:
inputs:
proto-directory:
required: true
type: string
updateable-deps:
description: 'csv of local dependencies which may need to be updated'
required: false
type: string
secrets:
BUF_TOKEN:
required: true

jobs:
deploy:
runs-on: ubuntu-latest

0 comments on commit ebb17a7

Please sign in to comment.