Skip to content

Commit

Permalink
Merge pull request #1 from vudiep411/build-release-workflow
Browse files Browse the repository at this point in the history
Build release workflow
  • Loading branch information
vudiep411 authored Nov 26, 2024
2 parents 9305b49 + 2db5c14 commit 295a03b
Show file tree
Hide file tree
Showing 3 changed files with 41 additions and 52 deletions.
15 changes: 7 additions & 8 deletions .github/workflows/build-release-packages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ on:
required: true

permissions:
id-token: write
contents: read

jobs:
Expand Down Expand Up @@ -67,11 +68,10 @@ jobs:
version: ${{ needs.release-build-get-meta.outputs.version }}
ref: ${{ inputs.version || github.ref_name }}
build_matrix: ${{ needs.generate-build-matrix.outputs.x86_64-build-matrix }}
region: us-west-2
secrets:
token: ${{ secrets.GITHUB_TOKEN }}
bucket: ${{ secrets.AWS_S3_BUCKET }}
access_key_id: ${{ secrets.AWS_S3_ACCESS_KEY_ID }}
secret_access_key: ${{ secrets.AWS_S3_ACCESS_KEY }}
bucket_name: ${{ secrets.AWS_S3_BUCKET }}
role_to_assume: ${{ secrets.AWS_ROLE_TO_ASSUME }}

release-build-linux-arm-packages:
needs:
Expand All @@ -82,8 +82,7 @@ jobs:
version: ${{ needs.release-build-get-meta.outputs.version }}
ref: ${{ inputs.version || github.ref_name }}
build_matrix: ${{ needs.generate-build-matrix.outputs.arm64-build-matrix }}
region: us-west-2
secrets:
token: ${{ secrets.GITHUB_TOKEN }}
bucket: ${{ secrets.AWS_S3_BUCKET }}
access_key_id: ${{ secrets.AWS_S3_ACCESS_KEY_ID }}
secret_access_key: ${{ secrets.AWS_S3_ACCESS_KEY }}
bucket_name: ${{ secrets.AWS_S3_BUCKET }}
role_to_assume: ${{ secrets.AWS_ROLE_TO_ASSUME }}
39 changes: 17 additions & 22 deletions .github/workflows/call-build-linux-arm-packages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,21 +15,20 @@ on:
description: The build targets to produce as a JSON matrix.
type: string
required: true
region:
description: The AWS region to push packages into.
type: string
required: true
secrets:
token:
description: The Github token or similar to authenticate with.
bucket_name:
description: The S3 bucket to push packages into.
required: true
role_to_assume:
description: The role to assume for the S3 bucket.
required: true
bucket:
description: The name of the S3 bucket to push packages into.
required: false
access_key_id:
description: The S3 access key id for the bucket.
required: false
secret_access_key:
description: The S3 secret access key for the bucket.
required: false

permissions:
id-token: write
contents: read

jobs:
Expand All @@ -46,6 +45,12 @@ jobs:
with:
ref: ${{ inputs.version }}

- name: Configure AWS credentials
uses: aws-actions/configure-aws-credentials@v4
with:
aws-region: ${{ inputs.region }}
role-to-assume: ${{ secrets.role_to_assume }}

- name: Make Valkey
uses: uraimo/run-on-arch-action@v2
with:
Expand All @@ -65,15 +70,5 @@ jobs:
mkdir -p packages-files
cp -rfv $TAR_FILE_NAME.tar* packages-files/
- name: Install AWS cli.
run: |
sudo apt-get install -y awscli
- name: Configure AWS credentials
run: |
aws configure set region us-west-2
aws configure set aws_access_key_id ${{ secrets.access_key_id }}
aws configure set aws_secret_access_key ${{ secrets.secret_access_key }}
- name: Sync to S3
run: aws s3 sync packages-files s3://${{secrets.bucket}}/releases/
run: aws s3 sync packages-files s3://${{ secrets.bucket_name }}/releases/
39 changes: 17 additions & 22 deletions .github/workflows/call-build-linux-x86-packages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,21 +15,20 @@ on:
description: The build targets to produce as a JSON matrix.
type: string
required: true
region:
description: The AWS region to upload the packages to.
type: string
required: true
secrets:
token:
description: The Github token or similar to authenticate with.
bucket_name:
description: The name of the S3 bucket to upload the packages to.
required: true
role_to_assume:
description: The role to assume for the S3 bucket.
required: true
bucket:
description: The name of the S3 bucket to push packages into.
required: false
access_key_id:
description: The S3 access key id for the bucket.
required: false
secret_access_key:
description: The S3 secret access key for the bucket.
required: false

permissions:
id-token: write
contents: read

jobs:
Expand All @@ -46,6 +45,12 @@ jobs:
with:
ref: ${{ inputs.version }}

- name: Configure AWS credentials
uses: aws-actions/configure-aws-credentials@v4
with:
aws-region: ${{ inputs.region }}
role-to-assume: ${{ secrets.role_to_assume }}

- name: Install dependencies
run: sudo apt-get update && sudo apt-get install -y build-essential libssl-dev libsystemd-dev

Expand All @@ -63,15 +68,5 @@ jobs:
mkdir -p packages-files
cp -rfv $TAR_FILE_NAME.tar* packages-files/
- name: Install AWS cli.
run: |
sudo apt-get install -y awscli
- name: Configure AWS credentials
run: |
aws configure set region us-west-2
aws configure set aws_access_key_id ${{ secrets.access_key_id }}
aws configure set aws_secret_access_key ${{ secrets.secret_access_key }}
- name: Sync to S3
run: aws s3 sync packages-files s3://${{secrets.bucket}}/releases/
run: aws s3 sync packages-files s3://${{ secrets.bucket_name }}/releases/

0 comments on commit 295a03b

Please sign in to comment.