-
Notifications
You must be signed in to change notification settings - Fork 157
81 lines (68 loc) · 2.58 KB
/
extract_and_upload_binaries.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
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