Skip to content

Commit

Permalink
Adds cron-unstable-build.yml
Browse files Browse the repository at this point in the history
Signed-off-by: Roshan Khatri <[email protected]>
  • Loading branch information
roshkhatri committed Apr 5, 2024
1 parent 57789d4 commit 28cf157
Show file tree
Hide file tree
Showing 8 changed files with 88 additions and 1,339 deletions.
87 changes: 0 additions & 87 deletions .github/workflows/ci.yml

This file was deleted.

33 changes: 0 additions & 33 deletions .github/workflows/codeql-analysis.yml

This file was deleted.

32 changes: 0 additions & 32 deletions .github/workflows/coverity.yml

This file was deleted.

88 changes: 88 additions & 0 deletions .github/workflows/cron-unstable-build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,88 @@
name: Unstable build

on:
# push:
workflow_dispatch:
inputs:
branch:
description: The branch to create an unstable release from.
type: string
default: unstable
required: true
schedule:
- cron: "0 0 * * *" # unstable build

jobs:
# This job provides this metadata for the other jobs to use.
unstable-build-get-meta:
name: Get metadata to add to build
runs-on: ubuntu-latest
outputs:
date: ${{ steps.date.outputs.date }}
branch: ${{ steps.branch.outputs.branch }}
steps:
- name: Get current date
id: date
run: echo "date=$(date '+%Y-%m-%d-%H_%M_%S')" >> $GITHUB_OUTPUT
- name: Debug event output
uses: hmarr/debug-action@v3

- name: Run on schedule event.
if: github.event_name == 'schedule' && github.event.schedule=='0 0 * * *'
run: echo "cron_branch=unstable" >> $GITHUB_ENV

- name: Output the branch to use
id: branch
run: |
echo "$cron_branch"
if [[ -z "$cron_branch" ]]; then
echo "Unable to determine branch to use"
exit 1
fi
echo "branch=$cron_branch" >> $GITHUB_OUTPUT
shell: bash

build_unstable_linux:
name: Build Valkey for Linux
runs-on: ubuntu-latest
needs:
- unstable-build-get-meta
steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Install dependencies
run: sudo apt-get update && sudo apt-get install -y build-essential
- name: Build Valkey for Linux
run: make SERVER_CFLAGS='-Werror'
- name: Install Valkey for Linux
run: make install
- name: Display /usr/local/bin/ contents
run: ls /usr/local/bin/
- name: Create tarball and checksums
run: |
TAR_FILE_NAME=valkey-server-${{ needs.unstable-build-get-meta.outputs.branch}}.linux.${{ needs.unstable-build-get-meta.outputs.date}}
mkdir -p $TAR_FILE_NAME/bin $TAR_FILE_NAME/share
cp -rfv /usr/local/bin/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 -C $TAR_FILE_NAME --exclude-vcs .
sha256sum $TAR_FILE_NAME.tar.gz > $TAR_FILE_NAME.tar.gz.sha256
mkdir -p source-packages
cp -rfv $TAR_FILE_NAME.tar* source-packages/
- name: Sync with S3 Bucket.
run: |
sudo apt-get update
sudo apt-get install -y awscli
- name: Configure AWS credentials
run: |
aws configure set region us-east-1
aws configure set aws_access_key_id ${{ secrets.AWS_S3_ACCESS_KEY_ID }}
aws configure set aws_secret_access_key ${{ secrets.AWS_S3_ACCESS_KEY }}
- name: List files in S3 bucket
run: aws s3 ls "s3://valkey-test/latest/"

- name: Sync to S3
run: aws s3 sync "source-packages/" "s3://valkey-test/latest/"
Loading

0 comments on commit 28cf157

Please sign in to comment.