
As discussed here: https://github.com/orgs/valkey-io/discussions/1103#discussioncomment-10814006 `cp` can't be used anymore, `rsync` is more powerful and allow to exclude files. Alternatively: 1. Remove the c, d and o files. Which isn't ideal either. 2. Improve the build. Eg. by building inside a `build` directory instead of in the src folder. Ps. I know these workflows aren't trigger in this PR. Only via "Build Release Packages" workflow action: https://github.com/valkey-io/valkey/actions/workflows/build-release-packages.yml.. So I can't fully test in this PR. But it should work ^^ Ps. ps. I did test `rsync -av --exclude='*.c' --exclude='*.d' --exclude='*.o' src/valkey-*` command in isolation and that works as expected! --------- Signed-off-by: Melroy van den Berg <melroy@melroy.org>
80 lines
2.7 KiB
YAML
80 lines
2.7 KiB
YAML
name: Builds Linux arm binary packages into S3 bucket.
|
|
|
|
on:
|
|
workflow_call:
|
|
inputs:
|
|
version:
|
|
description: The version of Valkey to create.
|
|
type: string
|
|
required: true
|
|
ref:
|
|
description: The commit, tag or branch of Valkey to checkout for building that creates the version above.
|
|
type: string
|
|
required: true
|
|
build_matrix:
|
|
description: The build targets to produce as a JSON matrix.
|
|
type: string
|
|
required: true
|
|
secrets:
|
|
token:
|
|
description: The Github token or similar to authenticate with.
|
|
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:
|
|
contents: read
|
|
|
|
jobs:
|
|
build-valkey:
|
|
# Capture source tarball and generate checksum for it
|
|
name: Build package ${{ matrix.distro.target }} ${{ matrix.distro.arch }}
|
|
runs-on: 'ubuntu-latest'
|
|
strategy:
|
|
fail-fast: false
|
|
matrix: ${{ fromJSON(inputs.build_matrix) }}
|
|
steps:
|
|
- name: Checkout repository
|
|
uses: actions/checkout@v4
|
|
with:
|
|
ref: ${{ inputs.version }}
|
|
|
|
- name: Make Valkey
|
|
uses: uraimo/run-on-arch-action@v2
|
|
with:
|
|
arch: aarch64
|
|
distro: ${{matrix.distro.target}}
|
|
install: apt-get update && apt-get install -y build-essential libssl-dev
|
|
run: make -C src all BUILD_TLS=yes
|
|
|
|
- name: Create Tarball and SHA256sums
|
|
run: |
|
|
TAR_FILE_NAME=valkey-${{inputs.version}}-${{matrix.distro.platform}}-${{ matrix.distro.arch}}
|
|
mkdir -p "$TAR_FILE_NAME/bin" "$TAR_FILE_NAME/share"
|
|
rsync -av --exclude='*.c' --exclude='*.d' --exclude='*.o' src/valkey-* "$TAR_FILE_NAME/bin/"
|
|
cp -v /home/runner/work/valkey/valkey/COPYING "$TAR_FILE_NAME/share/LICENSE"
|
|
tar -czvf $TAR_FILE_NAME.tar.gz $TAR_FILE_NAME
|
|
sha256sum $TAR_FILE_NAME.tar.gz > $TAR_FILE_NAME.tar.gz.sha256
|
|
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/
|