-
Notifications
You must be signed in to change notification settings - Fork 88
146 lines (137 loc) · 5.35 KB
/
release.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
name: Release
on:
pull_request:
merge_group:
push:
branches:
- main
jobs:
run_checker:
uses: ./.github/workflows/reusable-run-checker.yml
proto:
runs-on: ubuntu-latest
environment: BUF
needs: run_checker
if: github.event_name != 'merge_group' && (github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name == 'astriaorg/astria') && needs.run_checker.outputs.run_release_proto == 'true'
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"
run: |
if [ "${{ github.event_name }}" == "pull_request" ]; then
echo "buf_repo_ending=${{ github.event.number }}/merge" >> $GITHUB_ENV
else
echo "buf_repo_ending=main" >> $GITHUB_ENV
fi
- name: "Upload Composer API Protos"
uses: bufbuild/buf-push-action@v1
with:
draft: ${{ github.ref_name != 'main'}}
input: "proto/composerapis"
buf_token: ${{ secrets.BUF_TOKEN }}
- name: "Upload Primitive API Protos"
uses: bufbuild/buf-push-action@v1
with:
draft: ${{ github.ref_name != 'main'}}
input: "proto/primitives"
buf_token: ${{ secrets.BUF_TOKEN }}
- 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
with:
draft: ${{ github.ref_name != 'main'}}
input: "proto/sequencerblockapis"
buf_token: ${{ secrets.BUF_TOKEN }}
- 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
with:
draft: ${{ github.ref_name != 'main'}}
input: "proto/executionapis"
buf_token: ${{ secrets.BUF_TOKEN }}
- 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
with:
draft: ${{ github.ref_name != 'main'}}
input: "proto/protocolapis"
buf_token: ${{ secrets.BUF_TOKEN }}
charts:
permissions:
contents: write
runs-on: ubuntu-latest
needs: run_checker
if: github.ref_name == 'main' && needs.run_checker.outputs.run_release_charts == 'true'
steps:
- name: Checkout Repo
uses: actions/checkout@v4
- name: Publish to Charts Repo
uses: nkoppel/push-files-to-another-repository@v1.1.2
env:
API_TOKEN_GITHUB: ${{ secrets.CHARTS_REPO_TOKEN }}
with:
source-files: 'charts/'
destination-username: 'astriaorg'
destination-branch: 'main'
destination-repository: 'charts'
commit-email: '${{ github.actor }}@users.noreply.github.com'
commit-username: '${{ github.actor }}'
conductor:
needs: run_checker
if: needs.run_checker.outputs.run_release_services == 'true'
uses: ./.github/workflows/reusable-release-cargo.yml
with:
package-name: 'conductor'
display-name: 'Conductor'
composer:
needs: run_checker
if: needs.run_checker.outputs.run_release_services == 'true'
uses: ./.github/workflows/reusable-release-cargo.yml
with:
package-name: 'composer'
display-name: 'Composer'
sequencer:
needs: run_checker
if: needs.run_checker.outputs.run_release_services == 'true'
uses: ./.github/workflows/reusable-release-cargo.yml
with:
package-name: 'sequencer'
display-name: 'Sequencer'
sequencer-relayer:
needs: run_checker
if: needs.run_checker.outputs.run_release_services == 'true'
uses: ./.github/workflows/reusable-release-cargo.yml
with:
package-name: 'sequencer-relayer'
display-name: 'Sequencer Relayer'
cli:
needs: run_checker
if: needs.run_checker.outputs.run_release_services == 'true'
uses: ./.github/workflows/reusable-release-cargo.yml
with:
package-name: 'cli'
display-name: 'CLI'
release:
needs: [proto, conductor, composer, sequencer, sequencer-relayer, cli]
if: ${{ always() && !cancelled() }}
uses: ./.github/workflows/reusable-success.yml
with:
success: ${{ !contains(needs.*.result, 'failure') }}