-
Notifications
You must be signed in to change notification settings - Fork 8
57 lines (48 loc) · 2.03 KB
/
production_release.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
name: Promote and release Salesforce package
on:
workflow_dispatch:
inputs:
packageID:
description: 'ID (starts with 04t) of the package version to promote'
required: true
versionNumber:
description: 'Package version to release (e.g., 1.0.1 or 1.1.0)'
required: true
jobs:
promote-sf-package:
runs-on: ubuntu-latest
steps:
#Install Salesforce CLI
- name: 'Install Salesforce CLI'
run: |
npm install @salesforce/cli --location=global
nodeInstallPath=$(npm config get prefix)
echo "$nodeInstallPath/bin" >> $GITHUB_PATH
sf --version
# Checkout the source code
- name: 'Checkout source code'
uses: actions/checkout@v4
# Store secret for dev hub
- name: 'Populate auth file with DEV_HUB_URL secret'
shell: bash
run: |
echo ${{ secrets.DEV_HUB_AUTH_URL_URL}} > ./DEV_HUB_AUTH_URL.txt
secretFileSize=$(wc -c "./DEV_HUB_AUTH_URL.txt" | awk '{print $1}')
if [ $secretFileSize == 1 ]; then
echo "Missing DEV_HUB_AUTH_URL secret. Is this workflow running on a fork?";
exit 1;
fi
# Authenticate dev hub
- name: 'Authenticate Dev Hub'
run: sf org login sfdx-url -f ./DEV_HUB_AUTH_URL.txt -a devhub -d
# Remove auth file
- name: 'Remove auth file'
run: rm -f ./DEV_HUB_AUTH_URL.txt
# Promote Package version
- name: Run SFDX Promote command
run: sf package version promote --package ${{ github.event.inputs.packageID }} -n
# Create release notes
- name: Create release
run: gh release create ${{ github.event.inputs.versionNumber }} --generate-notes
env:
GITHUB_TOKEN: ${{ secrets.CUMULUSCI_SERVICE_GITHUB }}