Skip to content

Commit

Permalink
Adds release package
Browse files Browse the repository at this point in the history
  • Loading branch information
roshkhatri committed Apr 6, 2024
1 parent 28cf157 commit a7328b7
Show file tree
Hide file tree
Showing 2 changed files with 88 additions and 39 deletions.
49 changes: 49 additions & 0 deletions .github/workflows/build-release-packages.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
name: Build Release Packages

on:
push:
tags:
- '*'

workflow_dispatch:
inputs:
version:
description: Version of Valkey to build
required: true
default: unstable

# We do not want a new release build to run whilst we are releasing the current release build.
# We also do not want multiples to run for the same version.
concurrency: staging-build-release

jobs:
# This job provides the version metadata from the tag for the other jobs to use.
staging-build-get-meta:
name: Get metadata to build
runs-on: ubuntu-latest
outputs:
version: ${{ steps.get_version.outputs.VERSION }}
steps:

- run: |
echo "Version: ${{ inputs.version || github.ref_name }}"
shell: bash
# This step is to consolidate the three different triggers into a single "version"
# 1. If manual dispatch - use the version provided.
# 2. If cron/regular build - use master.
# 3. If tag trigger, use that tag.
- name: Get the version
id: get_version
run: |
VERSION="${INPUT_VERSION}"
if [ -z "${VERSION}" ]; then
echo "Defaulting to master"
VERSION=master
fi
echo "VERSION=$VERSION" >> $GITHUB_OUTPUT
shell: bash
env:
# Use the dispatch variable in preference, if empty use the context ref_name which should
# only ever be a tag or the master branch for cron builds.
INPUT_VERSION: ${{ inputs.version || github.ref_name }}
78 changes: 39 additions & 39 deletions .github/workflows/cron-unstable-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,47 +42,47 @@ jobs:
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
# 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: 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: 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: 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: 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/"
# - name: Sync to S3
# run: aws s3 sync "source-packages/" "s3://valkey-test/latest/"

0 comments on commit a7328b7

Please sign in to comment.