-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
73 lines (71 loc) · 2.83 KB
/
slack-rc-notification.yml
File metadata and controls
73 lines (71 loc) · 2.83 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
##############################################################################################
#
# Slack RC Notification (reusable)
#
# Posts an RC build notification to the release Slack channel.
# Callers can pass build metadata (semver, build numbers) directly from build
# outputs for accuracy, or omit them to fall back to reading from the branch.
#
##############################################################################################
name: Slack RC Notification
on:
workflow_call:
inputs:
source_branch:
description: 'Branch to checkout for reading build metadata and changelog (e.g. release/7.71.0)'
required: true
type: string
semver:
description: 'Semantic version (optional; falls back to reading from branch checkout)'
required: false
type: string
default: ''
ios_build_number:
description: 'iOS build number (optional; falls back to reading from branch checkout)'
required: false
type: string
default: ''
android_build_number:
description: 'Android build number (optional; falls back to reading from branch checkout)'
required: false
type: string
default: ''
pr_number:
description: 'PR number for linking to cherry-picks section in release PR comment'
required: false
type: string
default: ''
jobs:
slack-notification:
name: Post Slack Notification
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
ref: ${{ inputs.source_branch }}
fetch-depth: 0
- uses: actions/setup-node@v4
with:
node-version-file: '.nvmrc'
cache: yarn
- name: Read build metadata from repo
if: inputs.semver == '' || inputs.ios_build_number == '' || inputs.android_build_number == ''
id: build-meta
run: ./scripts/get-build-metadata.sh --ci
- name: Install dependencies
run: yarn install --immutable
- name: Post Slack notification
run: |
if node ./scripts/slack-rc-notification.mjs; then
echo "Slack notification sent successfully"
else
echo "Slack notification failed, continuing (non-critical)"
fi
env:
SEMVER: ${{ inputs.semver || steps.build-meta.outputs.semantic_version }}
IOS_BUILD_NUMBER: ${{ inputs.ios_build_number || steps.build-meta.outputs.ios_version_code }}
ANDROID_BUILD_NUMBER: ${{ inputs.android_build_number || steps.build-meta.outputs.android_version_code }}
BUILD_PIPELINE_URL: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}
ANDROID_PUBLIC_URL: ${{ secrets.ANDROID_PUBLIC_BUCKET_URL }}
SLACK_BOT_TOKEN: ${{ secrets.SLACK_BOT_TOKEN }}
PR_NUMBER: ${{ inputs.pr_number }}