Skip to content

Commit cc8d4ea

Browse files
author
Aliaksandr Adziareika
committed
<TBBAS-2530> Add download framework action
1 parent 935e446 commit cc8d4ea

File tree

3 files changed

+68
-18
lines changed

3 files changed

+68
-18
lines changed
Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
name: Download openDAQ framework package from S3
2+
description: "Download a package from S3 and install it depending on OS and architecture"
3+
inputs:
4+
s3_bucket:
5+
required: true
6+
description: "S3 bucket name"
7+
s3_path:
8+
required: true
9+
description: "Path to package in bucket (without OS/arch)"
10+
s3_artefact:
11+
required: true
12+
description: "Filename in the S3 bucket"
13+
download_dir:
14+
required: false
15+
default: "."
16+
aws_access_key_id:
17+
required: true
18+
description: "AWS Access Key ID"
19+
aws_secret_access_key:
20+
required: true
21+
description: "AWS Secret Access Key"
22+
aws_region:
23+
required: true
24+
description: "AWS Region"
25+
shell:
26+
required: true
27+
runs:
28+
using: composite
29+
steps:
30+
- name: Prepare AWS CLI for S3
31+
uses: aws-actions/configure-aws-credentials@v4
32+
with:
33+
aws-access-key-id: ${{ inputs.aws_access_key_id }}
34+
aws-secret-access-key: ${{ inputs.aws_secret_access_key }}
35+
aws-region: ${{ inputs.aws_region }}
36+
37+
- name: Enumerate bucket
38+
shell: ${{ inputs.shell }}
39+
run: |
40+
aws s3 ls "s3://${{ inputs.s3_bucket }}" --recursive --human-readable
41+
42+
- name: Enumerate bucket releases main
43+
shell: ${{ inputs.shell }}
44+
run: |
45+
aws s3 ls "s3://${{ inputs.s3_bucket }}/${{ inputs.s3_path }}" --recursive --human-readable
46+
47+
- name: Download package from S3
48+
shell: ${{ inputs.shell }}
49+
run: |
50+
aws s3 cp "s3://${{ inputs.s3_bucket }}/${{ inputs.s3_path }}/${{ inputs.s3_artefact }}" "${{ inputs.download_dir }}"

.github/workflows/ci.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,9 @@ jobs:
1010
build-and-test:
1111
runs-on: ubuntu-latest
1212
steps:
13+
- name: Stop
14+
run: exit 1
15+
1316
- name: Checkout repo
1417
uses: actions/checkout@v4
1518

.github/workflows/opendaq-download-framework-aws.yml

Lines changed: 15 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -6,32 +6,29 @@ on:
66

77
env:
88
s3bucket: bb-blueberry-sdk-releases
9-
s3sdk_path: /releases/main/SDK
9+
s3sdk_path: releases/main/SDK
10+
s3artefact: opendaq-3.21.0-ubuntu22.04-x86_64_01ff08d.deb
1011

1112
jobs:
1213
build:
1314
runs-on: ubuntu-latest
1415
steps:
16+
- name: Checkout repo
17+
uses: actions/checkout@v4
1518

16-
- name: Configuring
17-
uses: aws-actions/configure-aws-credentials@v4
19+
- name: Download openDAQ framework
20+
uses: ./.github/actions/framework-download-s3
1821
with:
19-
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
20-
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
21-
aws-region: ${{ secrets.AWS_REGION }}
22-
23-
- name: Enumerate artifacts
24-
run: |
25-
echo "Available artifacts:"
26-
aws s3 ls "s3://${{ env.s3bucket }}${{env.s3sdk_path}}" --human-readable
22+
s3_bucket: ${{ env.s3bucket }}
23+
s3_path: ${{ env.s3sdk_path }}
24+
s3_artefact: ${{ env.s3artefact }}
25+
aws_access_key_id: ${{ secrets.AWS_ACCESS_KEY_ID }}
26+
aws_secret_access_key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
27+
aws_region: ${{ secrets.AWS_REGION }}
28+
shell: "bash"
2729

28-
- name: Download artifact
29-
run: |
30-
echo "Downloading to $(pwd)"
31-
aws s3 cp "s3://${{ env.s3bucket }}${{env.s3sdk_path}}/opendaq-3.21.0-ubuntu22.04-x86_64_ffc93d2.deb" .
32-
3330
- name: Uploadading artifact
3431
uses: actions/upload-artifact@v4
3532
with:
36-
name: opendaq-3.21.0-ubuntu22.04-x86_64_ffc93d2.deb
37-
path: ./opendaq-3.21.0-ubuntu22.04-x86_64_ffc93d2.deb
33+
name: ${{ env.s3artefact }}
34+
path: ./${{ env.s3artefact }}

0 commit comments

Comments
 (0)