-
Notifications
You must be signed in to change notification settings - Fork 27
79 lines (69 loc) · 2.39 KB
/
committer_cli_push.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
name: Committer-CLI-push
on:
push:
branches:
- main
- main-v[0-9].**
tags:
- v[0-9].**
paths:
- '.github/workflows/committer_cli_push.yml'
- 'Cargo.toml'
- 'Cargo.lock'
- 'crates/committer_cli/**'
- 'crates/starknet_api/**'
- 'crates/starknet_committer/**'
- 'crates/starknet_patricia/**'
- 'scripts/dependencies.sh'
pull_request:
types:
- opened
- reopened
- synchronize
- auto_merge_enabled
- edited
paths:
- '.github/workflows/committer_cli_push.yml'
- 'Cargo.toml'
- 'Cargo.lock'
- 'crates/committer_cli/**'
- 'crates/starknet_api/**'
- 'crates/starknet_committer/**'
- 'crates/starknet_patricia/**'
- 'scripts/dependencies.sh'
env:
RUSTFLAGS: "-D warnings -C link-arg=-fuse-ld=lld"
# On PR events, cancel existing CI runs on this same PR for this workflow.
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}-${{ github.job }}
cancel-in-progress: ${{ github.event_name == 'pull_request' }}
jobs:
gcs-push:
runs-on: starkware-ubuntu-20-04-medium
steps:
- uses: actions/checkout@v4
- uses: ./.github/actions/bootstrap
# Commit hash on pull request event would be the head commit of the branch.
- name: Get commit hash prefix for PR update
if: ${{ github.event_name == 'pull_request' }}
env:
COMMIT_SHA: ${{ github.event.pull_request.head.sha }}
run: echo "SHORT_HASH=${COMMIT_SHA:0:7}" >> $GITHUB_ENV
# On push event (to main, for example) we should take the commit post-push.
- name: Get commit hash prefix for merge
if: ${{ github.event_name != 'pull_request' }}
env:
COMMIT_SHA: ${{ github.event.after }}
run: echo "SHORT_HASH=${COMMIT_SHA:0:7}" >> $GITHUB_ENV
- name: Build CLI binary
run: ./build_native_in_docker.sh cargo build -p committer_cli -r --bin committer_cli --target-dir CLI_TARGET
- id: auth
uses: "google-github-actions/auth@v2"
with:
credentials_json: ${{ secrets.COMMITER_PRODUCTS_EXT_WRITER_JSON }}
- name: Upload binary to GCP
id: upload_file
uses: "google-github-actions/upload-cloud-storage@v2"
with:
path: "CLI_TARGET/release/committer_cli"
destination: "committer-products-external/${{ env.SHORT_HASH }}/release/"