Skip to content

Extract and Upload Binaries #11997

Extract and Upload Binaries

Extract and Upload Binaries #11997

name: Extract and Upload Binaries
on:
workflow_dispatch:
inputs:
package_name:
description: 'The name of the binary to extract and upload: <emp_games | data_processing>'
required: true
type: string
image_name:
description: 'The name of the docker image to extract from'
required: false
type: string
default: onedocker
image_tag:
description: 'The tag of the docker image to extract from'
required: false
type: string
default: rc
aws_region:
description: 'The AWS region to upload to'
required: false
type: string
default: us-west-2
s3_tag:
description: 'The version/aws subfolder name for the binaries'
required: true
type: string
tracker_hash:
description: '[Internal usage] Used for tracking workflow job status within Meta infra'
required: false
type: string
env:
REGISTRY: ghcr.io
IMAGE_TAG: ${{ github.event.inputs.image_tag }}
IMAGE_NAME: ghcr.io/${{ github.repository }}/${{ github.event.inputs.image_name }}
IMAGE_PATH: ghcr.io/${{ github.repository }}/${{ github.event.inputs.image_name }}:${{ github.event.inputs.image_tag }}
jobs:
build:
name: Extract Binaries and Upload to S3
runs-on: ubuntu-latest
permissions:
id-token: write
contents: read
steps:
- uses: actions/checkout@v3
- name: Print Tracker Hash
run: echo ${{ github.event.inputs.tracker_hash}}
- name: Install OneDocker CLI
run: python3 -m pip install -r fbpcs/pip_requirements.txt
- uses: docker/login-action@v2
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Pull image from rc registry
run: docker pull ${{ env.IMAGE_PATH }}
- name: Extract binaries
run: |
./extract-docker-binaries.sh ${{ github.event.inputs.package_name }} -d ${{ env.IMAGE_NAME }} -t ${{ env.IMAGE_TAG }}
- name: Diff Extracted Binaries
run: diff <(sort binaries_out_lists/${{ github.event.inputs.package_name }}.txt) <(ls -1 binaries_out)
- name: Set AWS credentials
uses: aws-actions/configure-aws-credentials@v2
with:
role-to-assume: ${{ secrets.AWS_ROLE_TO_ASSUME }}
aws-region: ${{ github.event.inputs.aws_region }}
- name: Deploy to S3
run: ./upload_scripts/upload-binaries-using-onedocker.sh ${{ github.event.inputs.package_name }} ${{ github.event.inputs.s3_tag }} -c upload_scripts/configs/upload_binaries_config.yml