-
Notifications
You must be signed in to change notification settings - Fork 25
90 lines (76 loc) · 3.5 KB
/
make-pr-for-nightly.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
name: make-pr-for-nightly
on:
schedule:
# Daily at:
# 6pm MST
# 7pm MST
# 8pm CST
# 9pm EST
# 11pm ARG
- cron: '0 2 * * *'
workflow_dispatch:
inputs:
only:
type: string
required: false
description: '[--only] comma-separated list, no spaces, of dependencies that you want to bump.'
jobs:
make-pr-for-nightly:
env:
GITHUB_TOKEN: ${{ secrets.SVC_CLI_BOT_GITHUB_TOKEN }}
SF_HIDE_RELEASE_NOTES: true
runs-on: 'ubuntu-latest'
steps:
- name: Check out repository as our bot user
uses: actions/checkout@v3
with:
token: ${{ secrets.SVC_CLI_BOT_GITHUB_TOKEN }}
- name: Set up NodeJS
uses: actions/setup-node@v3
with:
node-version: lts/*
- name: Look up sf latest-rc version
uses: salesforcecli/github-workflows/.github/actions/versionInfo@main
id: latest-rc-version
with:
version: latest-rc
npmPackage: '@salesforce/cli'
- name: Parse latest-rc semver
uses: booxmedialtd/ws-action-parse-semver@e4a833cf5d612066a210bd9b62d1c3b20be3b325
id: latest-rc-semver-info
with:
input_string: ${{ steps.latest-rc-version.outputs.version }}
- name: Look up sf package.json version
uses: notiz-dev/github-action-json-property@2192e246737701f108a4571462b76c75e7376216
id: package-json-version
with:
path: 'package.json'
prop_path: 'version'
- name: Parse package.json semver
uses: booxmedialtd/ws-action-parse-semver@e4a833cf5d612066a210bd9b62d1c3b20be3b325
id: package-json-semver-info
with:
input_string: ${{ steps.package-json-version.outputs.prop }}
- name: Log version info
run: |
echo "INFO | Semver version in 'latest-rc' is ${{ steps.latest-rc-version.outputs.version }}"
echo "INFO | Semver minor in 'latest-rc' is ${{ steps.latest-rc-semver-info.outputs.minor }}"
echo "INFO | Semver version in 'main' is ${{ steps.package-json-version.outputs.prop }}"
echo "INFO | Semver minor in 'main' is ${{ steps.package-json-semver-info.outputs.minor }}"
shell: bash
- name: Install @salesforce/plugin-release-management
run: npm install -g @salesforce/plugin-release-management --omit=dev
- name: Set git config defaults
uses: salesforcecli/github-workflows/.github/actions/gitConfig@main
- name: Fetch all branches
run: git fetch
# --only input using a "ternary-ish": https://github.com/actions/runner/issues/409#issuecomment-752775072
# ${{ x && 'ifTrue' || 'ifFalse' }}
- name: Build nightly PR (minor)
run: sf-release cli:release:build --start-from-github-ref main ${{ inputs.only && format('--only {0}', inputs.only) || '' }} --label nightly-automerge --release-channel nightly
# If the package.json 'minor' IS EQUAL TO the latest-rc 'minor', we want to bump 'minor'
if: ${{ steps.package-json-semver-info.outputs.minor == steps.latest-rc-semver-info.outputs.minor }}
- name: Build nightly PR (patch)
run: sf-release cli:release:build --start-from-github-ref main --patch ${{ inputs.only && format('--only {0}', inputs.only) || '' }} --label nightly-automerge --release-channel nightly
# If the package.json 'minor' IS GREATER THAN the latest-rc 'minor', we want to bump 'patch'
if: ${{ steps.package-json-semver-info.outputs.minor > steps.latest-rc-semver-info.outputs.minor }}