-
Notifications
You must be signed in to change notification settings - Fork 245
70 lines (68 loc) · 2.91 KB
/
chores.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
name: Scheduled Chores
on:
workflow_dispatch:
schedule:
- cron: "0 0 * * 0" # At 00:00 on Sunday
jobs:
check_api_versions:
runs-on: SFDO-Tooling-Ubuntu
outputs:
hub_version: ${{ steps.devhub-api-version.outputs.hub_version }}
cci_version: ${{ steps.cci-api-version.outputs.cci_version }}
steps:
- uses: actions/checkout@v4
with:
ref: main
- name: Get Dev Hub API Version
id: devhub-api-version
env:
HUB_URL: ${{ format('{0}/services/data', secrets.SFDO_HUB_URL) }}
run: |
version=$(curl -s $HUB_URL | jq -r '.[-1] | .version')
echo "hub_version=$version" >> $GITHUB_OUTPUT
- name: Get CURRENT_SF_API_VERSION
id: cci-api-version
run: |
version=$(yq '.project.package.api_version' cumulusci/cumulusci.yml)
echo "cci_version=$version" >> $GITHUB_OUTPUT
update_api_versions:
runs-on: SFDO-Tooling-Ubuntu
needs: check_api_versions
if: ${{ needs.check_api_versions.outputs.hub_version != needs.check_api_versions.outputs.cci_version }}
env:
VERSION: ${{ needs.check_api_versions.outputs.hub_version }}
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
ref: main
- name: Set CURRENT_SF_API_VERSION
id: set-cci-api-version
run: |
yq --indent 4 --inplace '
.project.package.api_version = strenv(VERSION)
' cumulusci/cumulusci.yml
- name: Commit changes
run: |
git config user.name github-actions[bot]
git config user.email 41898282+github-actions[bot]@users.noreply.github.com
git switch -c "update-sfdc-api-v$VERSION"
git add cumulusci/cumulusci.yml
git commit -m "Automated update to sfdc API version $VERSION"
git push origin "update-sfdc-api-v$VERSION"
- env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
gh pr create --fill --label 'auto-pr'
test_sfdx_release_candidate:
uses: ./.github/workflows/release_test_sfdx.yml
with:
sfdx-release-channel: stable-rc
secrets:
CUMULUSCI_ORG_packaging: ${{ secrets.CUMULUSCI_ORG_packaging }}
CUMULUSCI_SERVICE_github: ${{ secrets.CUMULUSCI_SERVICE_github }}
CCITEST_APP_KEY: ${{ secrets.CCITEST_APP_KEY }}
SFDX_CLIENT_ID: ${{ secrets.SFDX_CLIENT_ID }}
SFDX_HUB_KEY: ${{ secrets.SFDX_HUB_KEY }}
SFDX_HUB_KEY_BASE64: ${{ secrets.SFDX_HUB_KEY_BASE64 }}
SFDX_HUB_USERNAME: ${{ secrets.SFDX_HUB_USERNAME }}