Skip to content

Upload-Artifacts

Upload-Artifacts #2020

name: Upload-Artifacts
on:
workflow_run:
workflows: [Trigger-Workflow]
types: [completed]
jobs:
native-blockifier-artifacts-push:
runs-on: starkware-ubuntu-20-04-medium
steps:
- name: Get commit hash prefix for PR update
env:
COMMIT_SHA: ${{ github.event.workflow_run.head_commit.id }}
run: |
echo "SHORT_HASH=${COMMIT_SHA:0:7}" >> $GITHUB_ENV
echo "COMMIT_SHA=${COMMIT_SHA}" >> $GITHUB_ENV
# This workflow is always triggered in `main` branch context, so need to checkout the commit.
- uses: actions/checkout@v4
with:
ref: ${{ env.COMMIT_SHA }}
- uses: actions/checkout@v4
with:
ref: ${{ env.COMMIT_SHA }}
- uses: ./.github/actions/bootstrap
- name: Build native blockifier
run: ./build_native_in_docker.sh scripts/build_native_blockifier.sh
# Rename is required; see https://pyo3.rs/v0.19.2/building_and_distribution#manual-builds.
- name: Rename shared object
run: |
mv \
target/release/libnative_blockifier.so \
target/release/native_blockifier.pypy39-pp73-x86_64-linux-gnu.so
- name: Authenticate with GCS
uses: "google-github-actions/auth@v2"
with:
credentials_json: ${{ secrets.SA_NATIVE_BLOCKIFIER_ARTIFACTS_BUCKET_WRITER_ACCESS_KEY }}
- name: Upload binary to GCP
id: upload_file
uses: "google-github-actions/upload-cloud-storage@v2"
with:
path: "target/release/native_blockifier.pypy39-pp73-x86_64-linux-gnu.so"
destination: "native_blockifier_artifacts/${{ env.SHORT_HASH }}/release/"