Skip to content

Release Build and Test: beb991a4-a0b1-47f3-bbde-bacd5d002ec2 #28

Release Build and Test: beb991a4-a0b1-47f3-bbde-bacd5d002ec2

Release Build and Test: beb991a4-a0b1-47f3-bbde-bacd5d002ec2 #28

# This workflow is part of the Redis OSS release automation process.
name: Release Build and Test
on:
workflow_dispatch:
inputs:
release_tag:
description: 'Release tag to build'
required: false
workflow_uuid:
description: 'Optional UUID to identify this workflow run'
required: false
release_type:
description: 'Type of release to upload (public, internal)'
required: true
channel:
description: 'Type of stability (stable, rc)'
required: false
# UUID is used to help automation to identify workflow run in the list of workflow runs.
run-name: "Release Build and Test${{ github.event.inputs.workflow_uuid && format(': {0}', github.event.inputs.workflow_uuid) || '' }}"
jobs:
prepare-release:
runs-on: ["ubuntu-latest"]
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Validate Redis Release Archive
uses: redis-developer/redis-oss-release-automation/.github/actions/validate-redis-release-archive@main
with:
release_tag: ${{ github.event.inputs.release_tag }}
- name: Ensure Release Branch
id: ensure-branch
uses: redis-developer/redis-oss-release-automation/.github/actions/ensure-release-branch@main
with:
release_tag: ${{ github.event.inputs.release_tag }}
release_branch: ${{ github.ref_name }}
allow_modify: true
gh_token: ${{ secrets.GITHUB_TOKEN }}
- name: Edit redis version file
id: edit-version
uses: ./.github/actions/edit-version-file
with:
release_tag: ${{ github.event.inputs.release_tag }}
release_version_branch: ${{ steps.ensure-branch.outputs.release_version_branch }}
build-n-test:
needs: prepare-release
uses: ./.github/workflows/build-n-test.yml
with:
release_tag: ${{ github.event.inputs.release_tag }}
channel: ${{ github.event.inputs.channel }}
secrets: inherit
create-release-handle:
needs: build-n-test
runs-on: ubuntu-latest
steps:
- name: Create Release Handle
shell: bash
run: |
cat <<RELEASE_HANDLE >result.json
{
"release_tag": "${{ github.event.inputs.release_tag }}",
"run_id": ${{ github.run_id }},
"workflow_uuid": "${{ github.event.inputs.workflow_uuid }}",
"release_type": "${{ github.event.inputs.release_type }}"
}
RELEASE_HANDLE
- name: Upload release handle artifact
uses: actions/upload-artifact@v4
with:
name: release_handle
path: result.json
retention-days: 90
# Notify only about build failures
# as publish workflow will notify about publish success or failure
slack-failure-notification:
needs: build-n-test
runs-on: ubuntu-latest
if: failure()
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Detect env name
id: detect-env
run: |
if [ "${{ inputs.release_type }}" = "public" ]; then
env_name="production"
elif [ "${{ inputs.release_type }}" = "internal" ]; then
env_name="staging"
fi
echo "env_name=$env_name" >> $GITHUB_OUTPUT
- name: Send Failure Slack notification
uses: ./.github/actions/slack-notification
with:
slack_func: slack_format_failure_message
release_tag: ${{ github.event.inputs.release_tag }}
env: ${{ steps.detect-env.outputs.env_name }}
message: ":homebrew: Homebrew package build failed"
SLACK_WEB_HOOK_URL: ${{ secrets.SLACK_WEB_HOOK_URL }}