Skip to content

Commit 9b338dc

Browse files
authored
Merge pull request #39 from redis/release_automation
Update Release automation changes
2 parents 248f84f + 3a9f8c0 commit 9b338dc

File tree

2 files changed

+19
-6
lines changed

2 files changed

+19
-6
lines changed

.github/actions/upload-packages/action.yml

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,9 @@ inputs:
88
release_type:
99
description: "Type of release to upload (public, internal)"
1010
required: true
11+
release_tag:
12+
description: 'Release tag to publish'
13+
required: true
1114
gh_token:
1215
description: "GitHub token"
1316
required: true
@@ -20,8 +23,8 @@ inputs:
2023
BREW_S3_REGION:
2124
description: "S3 region to upload to"
2225
required: false
23-
cask:
24-
description: 'Cask to publish'
26+
channel:
27+
description: 'Type of stability (stable, rc)'
2528
required: true
2629

2730
outputs:
@@ -39,6 +42,10 @@ runs:
3942
echo "Invalid release_type: ${{ inputs.release_type }}"
4043
exit 1
4144
fi
45+
if [ "${{ inputs.channel }}" != "stable" ] && [ "${{ inputs.channel }}" != "rc" ]; then
46+
echo "Invalid channel: ${{ inputs.channel }}"
47+
exit 1
48+
fi
4249
if [ -z "${{ inputs.BREW_S3_BUCKET }}" ] || [ -z "${{ inputs.BREW_S3_REGION }}" ] || [ -z "${{ inputs.BREW_S3_IAM_ARN }}" ]; then
4350
echo "Missing required inputs for S3 bucket and region"
4451
exit 1
@@ -89,4 +96,9 @@ runs:
8996
- name: Edit cask file
9097
shell: bash
9198
run: |
92-
${{ github.action_path }}/../common/edit-cask.sh --cask ${{ inputs.cask }} --action publish --package-json $packages_sha256_json --tap ${{ inputs.tap }} ${{ inputs.redis_version }}
99+
if [ "${{ inputs.channel }}" == "stable" ]; then
100+
${{ github.action_path }}/../common/edit-cask.sh --cask redis --action publish --package-json "$packages_sha256_json" ${{ inputs.release_tag }}
101+
${{ github.action_path }}/../common/edit-cask.sh --cask redis-rc --action publish --package-json "$packages_sha256_json" ${{ inputs.release_tag }}
102+
elif [ "${{ inputs.channel }}" == "rc" ]; then
103+
${{ github.action_path }}/../common/edit-cask.sh --cask redis-rc --action publish --package-json "$packages_sha256_json" ${{ inputs.release_tag }}
104+
fi

.github/workflows/release_publish.yml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,8 @@ on:
1414
release_handle:
1515
description: 'JSON string containing release handle information'
1616
required: true
17-
cask:
18-
description: 'Cask to publish'
17+
channel:
18+
description: 'Type of stability (stable, rc)'
1919
required: true
2020

2121
# UUID is used to help automation to identify workflow run in the list of workflow runs.
@@ -72,11 +72,12 @@ jobs:
7272
with:
7373
run_id: ${{ steps.parse-handle.outputs.run_id }}
7474
release_type: ${{ github.event.inputs.release_type }}
75+
release_tag: ${{ github.event.inputs.release_tag }}
7576
gh_token: ${{ secrets.GITHUB_TOKEN }}
77+
channel: ${{ inputs.channel }}
7678
BREW_S3_REGION: ${{ github.event.inputs.release_type == 'public' && secrets.S3_REGION || secrets.S3_REGION_STAGING }}
7779
BREW_S3_BUCKET: ${{ github.event.inputs.release_type == 'public' && secrets.S3_BUCKET || secrets.S3_BUCKET_STAGING }}
7880
BREW_S3_IAM_ARN: ${{ github.event.inputs.release_type == 'public' && secrets.S3_IAM_ARN || secrets.S3_IAM_ARN_STAGING }}
79-
cask: ${{ inputs.cask }}
8081

8182
- name: Merge back to release branch
8283
id: merge-back

0 commit comments

Comments
 (0)