-
Notifications
You must be signed in to change notification settings - Fork 0
73 lines (57 loc) · 2.22 KB
/
package-version-creation.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
name: Release - Package Version Creation
on:
pull_request:
branches:
- 'release/*'
- 'Release/*'
jobs:
build-and-deploy:
runs-on: ubuntu-latest
env:
PBO_AUTH_URL: ${{ secrets.PBO_AUTH_URL }}
steps:
- name: Checkout This Repository
uses: actions/checkout@v4
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '20'
- name: Install jq
run: sudo apt-get install jq
- name: Make script executable
run: chmod +x scripts/update-app-info-version.sh
- name: Verify And Update App Version
run: scripts/update-app-info-version.sh
- name: Install Salesforce CLI
run: npm install @salesforce/cli --global
- name: Create authentication file from secret
run: echo ${PBO_AUTH_URL} > secret.json
- name: Authenticate to Dev Hub
run: sf org login sfdx-url -f secret.json --set-default-dev-hub
- name: Create Package Version
run: |
PACKAGE_VERSION_ID=$(sf package version create -p "Adyen Salesforce Order Management" -c -k Payments@Adyen -w 10 --json | jq -r '.result.Id')
echo "PACKAGE_VERSION_ID=$PACKAGE_VERSION_ID" >> $GITHUB_ENV
- name: Poll for Package Creation Status
run: |
while true; do
STATUS=$(sf package version report --package "$PACKAGE_VERSION_ID" --json | jq -r '.result.Status')
if [ "$STATUS" == "Success" ]; then
echo "Package creation completed successfully."
break
elif [ "$STATUS" == "Error" ]; then
echo "Package creation failed."
exit 1
else
echo "Package creation is in progress. Current status: $STATUS"
fi
# Wait for 2 minutes before checking again
sleep 120
done
- name: Commit Modified Files
run: |
git config --global user.name 'GitHub Actions'
git config --global user.email '[email protected]'
git add sfdx-project.json
git commit -m "chore: Update sfdx-project.json with new package version id: $PACKAGE_VERSION_ID"
git push origin "$GITHUB_REF"