-
Notifications
You must be signed in to change notification settings - Fork 25
112 lines (102 loc) · 4.11 KB
/
promote-nightly-to-rc.yml
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
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
name: promote-nightly-to-rc
on:
workflow_dispatch:
workflow_run:
workflows:
- promote-rc-to-latest
types:
- completed
jobs:
promote:
# Only run on 'workflow_dispatch' or if the 'workflow_run' was successful
if: ${{ !github.event.workflow_run || github.event.workflow_run.conclusion == 'success' }}
uses: ./.github/workflows/promote.yml
secrets: inherit
with:
old-channel: nightly
new-channel: latest-rc
promote-verify:
runs-on: ubuntu-latest
needs: [promote]
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: ${{ vars.NODE_VERSION_OVERRIDE || 'lts/*' }}
cache: yarn
- name: Verify promote scripts
uses: salesforcecli/github-workflows/.github/actions/retry@main
with:
max_attempts: 5
retry_wait_seconds: 120
command: ./scripts/verify-promote nightly latest-rc
- name: Install plugin-release-management
uses: salesforcecli/github-workflows/.github/actions/retry@main
with:
max_attempts: 5
retry_wait_seconds: 120
command: npm install -g @salesforce/plugin-release-management --omit=dev
- name: Version inspect (with retries)
uses: salesforcecli/github-workflows/.github/actions/retry@main
with:
max_attempts: 5
retry_wait_seconds: 120
command: sf-release cli:versions:inspect -c stable-rc -l archive --cli sf
verify-docker-version:
needs: [promote-verify]
runs-on: ubuntu-latest
steps:
- name: Get latest-rc version
id: latest-rc-version
run: |
VERSION=$(npm view @salesforce/cli@latest-rc --json | jq -r '.version')
echo "version=$VERSION" >> "$GITHUB_OUTPUT"
- name: Get docker-full CLI version
id: docker-full-version
run: |
docker pull salesforce/cli:latest-rc-full
VERSION=$(docker run --rm salesforce/cli:latest-rc-full sf version --json | jq -r '.cliVersion' | cut -d'/' -f 3)
echo "version=$VERSION" >> "$GITHUB_OUTPUT"
- name: Get docker-slim CLI version
id: docker-slim-version
run: |
docker pull salesforce/cli:latest-rc-slim
VERSION=$(docker run --rm salesforce/cli:latest-rc-slim sf version --json | jq -r '.cliVersion' | cut -d'/' -f 3)
echo "version=$VERSION" >> "$GITHUB_OUTPUT"
- name: Compare Docker versions against npm
run: |
echo "NPM latest-rc version is: ${{ steps.latest-rc-version.outputs.version }}"
echo "Docker-full version is: ${{ steps.docker-full-version.outputs.version }}"
echo "Docker-slim version is: ${{ steps.docker-slim-version.outputs.version }}"
if [ "${{ steps.latest-rc-version.outputs.version }}" == "${{ steps.docker-full-version.outputs.version }}" ] && [ "${{ steps.docker-full-version.outputs.version }}" == "${{ steps.docker-slim-version.outputs.version }}" ]; then
echo "Docker versions match npm version. Proceeding..."
else
echo "Version mismatch! Exiting..."
exit 1
fi
announce-promotion-to-slack:
needs: [promote-verify, verify-docker-version]
runs-on: ubuntu-latest
steps:
- name: Get nightly version
id: nightly-version
run: |
VERSION=$(npm view @salesforce/cli@nightly --json | jq -r '.version')
echo "version=$VERSION" >> "$GITHUB_OUTPUT"
- name: Announce promotion
id: slack
uses: slackapi/[email protected]
env:
SLACK_WEBHOOK_URL: ${{ secrets.PLATFORM_CLI_CHANNEL_SLACK_INCOMING_WEBHOOK }}
SLACK_WEBHOOK_TYPE: INCOMING_WEBHOOK
with:
payload: |
{
"blocks": [{
"type": "section",
"text": {
"type": "mrkdwn",
"text": ":owl3: `sf` version `${{ steps.nightly-version.outputs.version }}` has been promoted from `nightly` to `latest-rc` :owl3:\nRun `sf whatsnew -v latest-rc` to see what's new"
}
}]
}