Repository navigation
51 lines (41 loc) · 1.61 KB
/
Copy pathpush-develop.yml
File metadata and controls
51 lines (41 loc) · 1.61 KB
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
name: Create pre-release version
on:
push:
branches: [ develop ]
jobs:
pre_release:
# The type of runner that the job will run on
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Install Salesforce CLI
run: |
wget https://developer.salesforce.com/media/salesforce-cli/sfdx-linux-amd64.tar.xz
mkdir sfdx-cli
tar xJf sfdx-linux-amd64.tar.xz -C sfdx-cli --strip-components 1
./sfdx-cli/install
- name: Populate auth file
shell: bash
run: 'echo ${{secrets.DEVHUB_SFDX_URL}} > ./DEVHUB_SFDX_URL.txt'
- name: Authenticate Dev Hub
run: 'sfdx force:auth:sfdxurl:store -f ./DEVHUB_SFDX_URL.txt -a devhub -d'
- name: Create new version
run: |
sfdx force:package:version:create -x -p "Spaghetti CMD" -w 60 --codecoverage
new_version_id=$(grep -o "04t[[:alnum:]]\{15\}" sfdx-project.json | tail -n1)
echo "version_id=${new_version_id}" >> $GITHUB_ENV
- name: Check code coverage
run: |
test $(sfdx force:package:version:report -p "$version_id" --json | jq .result.HasPassedCodeCoverageCheck) = 'true'
- name: Install new version in Dev Hub
run: |
sfdx force:package:install -p "$version_id" -u devhub --wait 10 --publishwait 10
- name: Store new version id
run: |
sed -i -e "s/04t[[:alnum:]]\{15\}/${version_id}/" README.md
git config user.name "release[bot]"
git config user.email "<>"
git add README.md
git add sfdx-project.json
git commit -m "Updating new pre-release version"
git push