Dev (#14) #1
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Publish new release | |
on: | |
push: | |
branches: [ master ] | |
jobs: | |
publish_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: | | |
npm install --global sfdx-cli | |
- name: Install jq | |
run: | | |
sudo apt-get install jq | |
- 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: Promote latest version | |
run: | | |
version_id=$(grep -o "04t[[:alnum:]]\{15\}" sfdx-project.json | tail -n1) | |
sfdx force:package:version:promote -p "$version_id" --noprompt | |
- name: Tag new release | |
run: | | |
tag_name=$(jq ".packageDirectories[0].versionName" sfdx-project.json | tr -d '"'| tr -d ' ') | |
pkg_name=$(jq ".packageDirectories[0].package" sfdx-project.json | tr -d '"') | |
git config user.name "release[bot]" | |
git config user.email "<>" | |
git tag -a "$tag_name" -m "$pkg_name $tag_name" | |
git push origin "$tag_name" |