Skip to content

Commit

Permalink
feat: push compiled binary to S3 on push to github
Browse files Browse the repository at this point in the history
Signed-off-by: Dori Medini <[email protected]>
  • Loading branch information
dorimedini-starkware committed Apr 16, 2024
1 parent 327416b commit 803d75c
Showing 1 changed file with 37 additions and 1 deletion.
38 changes: 37 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,43 @@ jobs:
- uses: Swatinem/rust-cache@v2
- run: cargo test

gcs-push:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
- uses: Swatinem/rust-cache@v2

- name: Get commit hash prefix
id: commit_prefix
# run: echo "::set-output name=commit_prefix::$(echo ${{ github.sha }} | cut -c 1-7)"
run: echo "commit_prefix=$(echo ${{ github.event.pull_request.head.sha }} | cut -c 1-7)" >> $GITHUB_OUTPUT

- name: Build CLI binary
run: cargo build -p committer_cli -r --bin committer_cli --target-dir CLI_TARGET

# - name: Upload binary to S3
# uses: shallwefootball/s3-upload-action@master
# id: S3
# with:
# aws_key_id: ${{ secrets.AWS_KEY_ID }}
# aws_secret_access_key: ${{ secrets.AWS_SECRET_ACCESS_KEY}}
# aws_bucket: ${{ secrets.AWS_BUCKET }}
# source_dir: "${{ github.sha }}/release/committer_cli"
# destination_dir: "${{ steps.commit_prefix.output.commit_prefix }}/release/committer_cli"
- id: auth
uses: "google-github-actions/auth@v2"
with:
credentials_json: ${{ secrets.COMMITER_PRODUCTS_EXT_WRITER_JSON }}
service_account: "commiter-products-ext-writer@starkware-dev.iam.gserviceaccount.com"

- 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/${{ join(steps.commit_prefix.outputs.*, '') }}/release/"

udeps:
runs-on: ubuntu-latest
steps:
Expand All @@ -97,7 +134,6 @@ jobs:
env:
RUSTUP_TOOLCHAIN: nightly-2024-01-12


all-tests:
runs-on: ubuntu-latest
needs:
Expand Down

0 comments on commit 803d75c

Please sign in to comment.