start-packaging #225
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
# Unique name for this workflow | |
name: Packaging | |
# Workflow starts when receiving custom event sent by CI workflow | |
on: | |
repository_dispatch: | |
types: [start-packaging] | |
permissions: | |
issues: write | |
pull-requests: write | |
contents: write | |
# Jobs to be executed | |
jobs: | |
release-package-version: | |
runs-on: ubuntu-latest | |
steps: | |
# Checkout the source code | |
- name: "Checkout source code" | |
uses: actions/checkout@v4 | |
with: | |
ref: ${{ github.event.client_payload.ref }} | |
# Install Volta to enforce proper node and package manager versions | |
- name: "Install Volta" | |
uses: volta-cli/action@v4 | |
# Cache node_modules to speed up the process | |
- name: "Restore node_modules cache" | |
id: cache-npm | |
uses: actions/cache@v4 | |
with: | |
path: node_modules | |
key: npm-${{ hashFiles('**/package-lock.json') }} | |
restore-keys: | | |
npm-${{ env.cache-name }}- | |
npm- | |
# Install Salesforce CLI | |
- name: "Install Salesforce CLI latest" | |
run: | | |
npm install @salesforce/cli --location=global | |
nodeInstallPath=$(npm config get prefix) | |
echo "$nodeInstallPath/bin" >> $GITHUB_PATH | |
# Confirm version Salesforce CLI | |
- name: "Confirm Salesforce CLI version" | |
run: | | |
sfdx --version | |
# Install npm dependencies for cssgen | |
- name: "Install npm dependencies" | |
if: steps.cache-npm.outputs.cache-hit != 'true' | |
run: npm ci | |
env: | |
GHCR_TOKEN: ${{ secrets.GHCR_ACCESS_TOKEN }} | |
# Prep | |
- name: "Prepare repo" | |
run: npm run prep | |
# Generate css from scss | |
- name: "Automatically generate css" | |
run: npm run cssgen | |
# Generate omnistudio versions of source | |
- name: "Automatically generate Omnistudio source" | |
run: npm run osfilegen | |
# Store secret for dev hub | |
- name: "Populate auth file with DEVHUB_SFDX_URL secret" | |
shell: bash | |
run: | | |
echo ${{ secrets.DEVHUB_SFDX_URL }} > ./DEVHUB_SFDX_URL.txt | |
secretFileSize=$(wc -c "./DEVHUB_SFDX_URL.txt" | awk '{print $1}') | |
if [ $secretFileSize == 1 ]; then | |
echo "Missing DEVHUB_SFDX_URL secret. Is this workflow running on a fork?"; | |
exit 1; | |
fi | |
# Authenticate dev hub | |
- name: "Authenticate Dev Hub" | |
run: sfdx auth:sfdxurl:store -f ./DEVHUB_SFDX_URL.txt -a devhub -d | |
# Remove auth file | |
- name: "Remove auth file" | |
run: rm -f ./DEVHUB_SFDX_URL.txt | |
# Create package version and extract its id | |
- name: "Create package version sfGpsDs" | |
id: createPackageVersion-sfGpsDs | |
if: ${{ github.event.client_payload.sfGpsDs == 'true' }} | |
run: | | |
set +e | |
json=$(sfdx package version create --path=sfGpsDs --installation-key-bypass --wait=20 --definition-file=config/project-scratch-def.json --code-coverage --json) | |
echo "package version create output:" | |
echo $json | |
echo "----" | |
status=$(echo $json | jq '.status') | |
if [ $status == "0" ]; then | |
packageVersionId=$(echo $json | jq -r '.result.SubscriberPackageVersionId') | |
echo "packageVersionId=$packageVersionId" >> $GITHUB_OUTPUT | |
else | |
echo "sfdx package version create failed" | |
exit $status | |
fi | |
json2=$(sfdx package version report --package $packageVersionId --json) | |
status2=$(echo $json2 | jq '.status') | |
if [ $status2 == "0" ]; then | |
versionNumber=$(echo $json2 | jq -r '.result.Version') | |
echo "versionNumber=$versionNumber" >> $GITHUB_OUTPUT | |
else | |
echo "sfdx package version report failed" | |
fi | |
exit $status2 | |
- name: "Create package version sfGpsDsAuNsw" | |
id: createPackageVersion-sfGpsDsAuNsw | |
if: ${{ github.event.client_payload.sfGpsDsAuNsw == 'true' || github.event.client_payload.sfGpsDs == 'true' }} | |
run: | | |
set +e | |
npm run aunsw-copy | |
json=$(sfdx package version create --path=sfGpsDsAuNswFull --installation-key-bypass --wait=20 --definition-file=config/project-scratch-def.json --code-coverage --json) | |
echo "package version create output:" | |
echo $json | |
echo "----" | |
status=$(echo $json | jq '.status') | |
if [ $status == "0" ]; then | |
packageVersionId=$(echo $json | jq -r '.result.SubscriberPackageVersionId') | |
echo "packageVersionId=$packageVersionId" >> $GITHUB_OUTPUT | |
else | |
echo "sfdx package version create failed" | |
exit $status | |
fi | |
json2=$(sfdx package version report --package $packageVersionId --json) | |
status2=$(echo $json2 | jq '.status') | |
if [ $status2 == "0" ]; then | |
versionNumber=$(echo $json2 | jq -r '.result.Version') | |
echo "versionNumber=$versionNumber" >> $GITHUB_OUTPUT | |
else | |
echo "sfdx package version report failed" | |
fi | |
exit $status2 | |
- name: "Create package version sfGpsDsAuNswS" | |
id: createPackageVersion-sfGpsDsAuNswS | |
if: ${{ github.event.client_payload.sfGpsDsAuNswS == 'true' || github.event.client_payload.sfGpsDs == 'true' }} | |
run: | | |
set +e | |
npm run aunsws-copy | |
json=$(sfdx package version create --path=sfGpsDsAuNswSFull --installation-key-bypass --wait=20 --definition-file=config/project-scratch-def.json --code-coverage --json) | |
echo "package version create output:" | |
echo $json | |
echo "----" | |
status=$(echo $json | jq '.status') | |
if [ $status == "0" ]; then | |
packageVersionId=$(echo $json | jq -r '.result.SubscriberPackageVersionId') | |
echo "packageVersionId=$packageVersionId" >> $GITHUB_OUTPUT | |
else | |
echo "sfdx package version create failed" | |
exit $status | |
fi | |
json2=$(sfdx package version report --package $packageVersionId --json) | |
status2=$(echo $json2 | jq '.status') | |
if [ $status2 == "0" ]; then | |
versionNumber=$(echo $json2 | jq -r '.result.Version') | |
echo "versionNumber=$versionNumber" >> $GITHUB_OUTPUT | |
else | |
echo "sfdx package version report failed" | |
fi | |
exit $status2 | |
- name: "Create package version sfGpsDsAuVic1" | |
id: createPackageVersion-sfGpsDsAuVic1 | |
if: ${{ github.event.client_payload.sfGpsDsAuVic1 == 'true' || github.event.client_payload.sfGpsDs == 'true' }} | |
run: | | |
set +e | |
npm run auvic1-copy | |
json=$(sfdx package version create --path=sfGpsDsAuVic1Full --installation-key-bypass --wait=20 --definition-file=config/project-scratch-def.json --code-coverage --json) | |
echo "package version create output:" | |
echo $json | |
echo "----" | |
status=$(echo $json | jq '.status') | |
if [ $status == "0" ]; then | |
packageVersionId=$(echo $json | jq -r '.result.SubscriberPackageVersionId') | |
echo "packageVersionId=$packageVersionId" >> $GITHUB_OUTPUT | |
else | |
echo "sfdx package version create failed" | |
exit $status | |
fi | |
json2=$(sfdx package version report --package $packageVersionId --json) | |
status2=$(echo $json2 | jq '.status') | |
if [ $status2 == "0" ]; then | |
versionNumber=$(echo $json2 | jq -r '.result.Version') | |
echo "versionNumber=$versionNumber" >> $GITHUB_OUTPUT | |
else | |
echo "sfdx package version report failed" | |
fi | |
exit $status2 | |
- name: "Create package version sfGpsDsAuVic2" | |
id: createPackageVersion-sfGpsDsAuVic2 | |
if: ${{ github.event.client_payload.sfGpsDsAuVic2 == 'true' || github.event.client_payload.sfGpsDs == 'true' }} | |
run: | | |
set +e | |
npm run auvic2-copy | |
json=$(sfdx package version create --path=sfGpsDsAuVic2Full --installation-key-bypass --wait=20 --definition-file=config/project-scratch-def.json --code-coverage --json) | |
echo "package version create output:" | |
echo $json | |
echo "----" | |
status=$(echo $json | jq '.status') | |
if [ $status == "0" ]; then | |
packageVersionId=$(echo $json | jq -r '.result.SubscriberPackageVersionId') | |
echo "packageVersionId=$packageVersionId" >> $GITHUB_OUTPUT | |
else | |
echo "sfdx package version create failed" | |
exit $status | |
fi | |
json2=$(sfdx package version report --package $packageVersionId --json) | |
status2=$(echo $json2 | jq '.status') | |
if [ $status2 == "0" ]; then | |
versionNumber=$(echo $json2 | jq -r '.result.Version') | |
echo "versionNumber=$versionNumber" >> $GITHUB_OUTPUT | |
else | |
echo "sfdx package version report failed" | |
fi | |
exit $status2 | |
- name: "Create package version sfGpsDsFrGov" | |
id: createPackageVersion-sfGpsDsFrGov | |
if: ${{ github.event.client_payload.sfGpsDsFrGov == 'true' || github.event.client_payload.sfGpsDs == 'true' }} | |
run: | | |
set +e | |
npm run frgov-copy | |
json=$(sfdx package version create --path=sfGpsDsFrGovFull --installation-key-bypass --wait=20 --definition-file=config/project-scratch-def.json --code-coverage --json) | |
echo "package version create output:" | |
echo $json | |
echo "----" | |
status=$(echo $json | jq '.status') | |
if [ $status == "0" ]; then | |
packageVersionId=$(echo $json | jq -r '.result.SubscriberPackageVersionId') | |
echo "packageVersionId=$packageVersionId" >> $GITHUB_OUTPUT | |
else | |
echo "sfdx package version create failed" | |
exit $status | |
fi | |
json2=$(sfdx package version report --package $packageVersionId --json) | |
status2=$(echo $json2 | jq '.status') | |
if [ $status2 == "0" ]; then | |
versionNumber=$(echo $json2 | jq -r '.result.Version') | |
echo "versionNumber=$versionNumber" >> $GITHUB_OUTPUT | |
else | |
echo "sfdx package version report failed" | |
fi | |
exit $status2 | |
- name: "Create package version sfGpsDsUkGov" | |
id: createPackageVersion-sfGpsDsUkGov | |
if: ${{ github.event.client_payload.sfGpsDsUkGov == 'true' || github.event.client_payload.sfGpsDs == 'true' }} | |
run: | | |
set +e | |
npm run ukgov-copy | |
json=$(sfdx package version create --path=sfGpsDsUkGovFull --installation-key-bypass --wait=20 --definition-file=config/project-scratch-def.json --code-coverage --json) | |
echo "package version create output:" | |
echo $json | |
echo "----" | |
status=$(echo $json | jq '.status') | |
if [ $status == "0" ]; then | |
packageVersionId=$(echo $json | jq -r '.result.SubscriberPackageVersionId') | |
echo "packageVersionId=$packageVersionId" >> $GITHUB_OUTPUT | |
else | |
echo "sfdx package version create failed" | |
exit $status | |
fi | |
json2=$(sfdx package version report --package $packageVersionId --json) | |
status2=$(echo $json2 | jq '.status') | |
if [ $status2 == "0" ]; then | |
versionNumber=$(echo $json2 | jq -r '.result.Version') | |
echo "versionNumber=$versionNumber" >> $GITHUB_OUTPUT | |
else | |
echo "sfdx package version report failed" | |
fi | |
exit $status2 | |
# Wait for package replication | |
- name: "Wait for package replication" | |
uses: maddox/actions/sleep@master | |
with: | |
args: 360 | |
# Create scratch org | |
- name: "Create scratch org" | |
run: sfdx org create scratch -f config/project-scratch-def.json --alias=scratch-org --set-default --duration-days=1 | |
# Deploy omnistudio to scratch org | |
- name: "Deploy Omnistudio" | |
run: sfdx package install --package=${{ vars.OMNISTUDIO_PACKAGEID }} --target-org=scratch-org --wait=20 --no-prompt --security-type=AllUsers | |
# Install new sfGpsDs package in scratch org | |
- name: "Install new sfGpsDs package version in scratch org" | |
if: ${{ github.event.client_payload.sfGpsDs == 'true' }} | |
run: | | |
sfdx package install --package ${{ steps.createPackageVersion-sfGpsDs.outputs.packageVersionId }} --wait=20 --target-org=scratch-org --no-prompt | |
sfdx package uninstall --package ${{ steps.createPackageVersion-sfGpsDs.outputs.packageVersionId }} --wait=20 --target-org=scratch-org | |
# Install new sfGpsDsAuNsw package in scratch org | |
- name: "Install new sfGpsDsAuNsw package version in scratch org" | |
if: ${{ github.event.client_payload.sfGpsDsAuNsw == 'true' || github.event.client_payload.sfGpsDs == 'true' }} | |
run: | | |
sfdx package install --package ${{ steps.createPackageVersion-sfGpsDsAuNsw.outputs.packageVersionId }} --wait=20 --target-org=scratch-org --no-prompt | |
sfdx package uninstall --package ${{ steps.createPackageVersion-sfGpsDsAuNsw.outputs.packageVersionId }} --wait=20 --target-org=scratch-org | |
# Install new sfGpsDsAuNswS package in scratch org | |
- name: "Install new sfGpsDsAuNswS package version in scratch org" | |
if: ${{ github.event.client_payload.sfGpsDsAuNswS == 'true' || github.event.client_payload.sfGpsDs == 'true' }} | |
run: | | |
sfdx package install --package ${{ steps.createPackageVersion-sfGpsDsAuNswS.outputs.packageVersionId }} --wait=20 --target-org=scratch-org --no-prompt | |
sfdx package uninstall --package ${{ steps.createPackageVersion-sfGpsDsAuNswS.outputs.packageVersionId }} --wait=20 --target-org=scratch-org | |
# Install new sfGpsDsAuVic1 package in scratch org | |
- name: "Install new sfGpsDsAuVic1 package version in scratch org" | |
if: ${{ github.event.client_payload.sfGpsDsAuVic1 == 'true' || github.event.client_payload.sfGpsDs == 'true' }} | |
run: | | |
sfdx package install --package ${{ steps.createPackageVersion-sfGpsDsAuVic1.outputs.packageVersionId }} --wait=20 --target-org=scratch-org --no-prompt | |
sfdx package uninstall --package ${{ steps.createPackageVersion-sfGpsDsAuVic1.outputs.packageVersionId }} --wait=20 --target-org=scratch-org | |
# Install new sfGpsDsAuVic2 package in scratch org | |
- name: "Install new sfGpsDsAuVic2 package version in scratch org" | |
if: ${{ github.event.client_payload.sfGpsDsAuVic2 == 'true' || github.event.client_payload.sfGpsDs == 'true' }} | |
run: | | |
sfdx package install --package ${{ steps.createPackageVersion-sfGpsDsAuVic2.outputs.packageVersionId }} --wait=20 --target-org=scratch-org --no-prompt | |
sfdx package uninstall --package ${{ steps.createPackageVersion-sfGpsDsAuVic2.outputs.packageVersionId }} --wait=20 --target-org=scratch-org | |
# Install new sfGpsDsFrGov package in scratch org | |
- name: "Install new sfGpsFrUkGov package version in scratch org" | |
if: ${{ github.event.client_payload.sfGpsDsFrGov == 'true' || github.event.client_payload.sfGpsDs == 'true' }} | |
run: | | |
sfdx package install --package ${{ steps.createPackageVersion-sfGpsDsFrGov.outputs.packageVersionId }} --wait=20 --target-org=scratch-org --no-prompt | |
sfdx package uninstall --package ${{ steps.createPackageVersion-sfGpsDsFrGov.outputs.packageVersionId }} --wait=20 --target-org=scratch-org | |
# Install new sfGpsDsUkGov package in scratch org | |
- name: "Install new sfGpsDsUkGov package version in scratch org" | |
if: ${{ github.event.client_payload.sfGpsDsUkGov == 'true' || github.event.client_payload.sfGpsDs == 'true' }} | |
run: | | |
sfdx package install --package ${{ steps.createPackageVersion-sfGpsDsUkGov.outputs.packageVersionId }} --wait=20 --target-org=scratch-org --no-prompt | |
sfdx package uninstall --package ${{ steps.createPackageVersion-sfGpsDsUkGov.outputs.packageVersionId }} --wait=20 --target-org=scratch-org | |
# Update sfGpsDs force:force:package:install link in readme | |
- name: "Update package sfGpsDs install link in readme" | |
if: ${{ github.event.client_payload.sfGpsDs == 'true' }} | |
run: | | |
packageVersionId="${{ steps.createPackageVersion-sfGpsDs.outputs.packageVersionId }}" | |
packageLinkRegex="https:\/\/test\.salesforce\.com\/packaging\/installPackage\.apexp\?p0=[a-zA-ZA-ZA-Z0-9]{18}\" title=\"sfGpsDs\"" | |
newPackageLink="https://test.salesforce.com/packaging/installPackage.apexp?p0=${packageVersionId}\" title=\"sfGpsDs\"" | |
sed -E -i "s,${packageLinkRegex},${newPackageLink}," README.md | |
# Create sfGpsDs GH release | |
- name: "Release package sfGpsDs" | |
if: ${{ github.event.client_payload.sfGpsDs == 'true' }} | |
uses: ncipollo/release-action@v1 | |
with: | |
body: "Sandbox unmanaged package: [https://test.salesforce.com/packaging/installPackage.apexp?p0=${{ steps.createPackageVersion-sfGpsDs.outputs.packageVersionId }}](https://test.salesforce.com/packaging/installPackage.apexp?p0=${{ steps.createPackageVersion-sfGpsDs.outputs.packageVersionId }})" | |
name: "sfGpsDs ${{ steps.createPackageVersion-sfGpsDs.outputs.versionNumber }}" | |
prerelease: "true" | |
tag: "sfGpsDs-${{ steps.createPackageVersion-sfGpsDs.outputs.versionNumber }}" | |
# Update sfGpsDsAuNsw force:force:package:install link in readme | |
- name: "Update package sfGpsDsAuNsw install link in readme" | |
if: ${{ github.event.client_payload.sfGpsDsAuNsw == 'true' || github.event.client_payload.sfGpsDs == 'true' }} | |
run: | | |
packageVersionId="${{ steps.createPackageVersion-sfGpsDsAuNsw.outputs.packageVersionId }}" | |
packageLinkRegex="https:\/\/test\.salesforce\.com\/packaging\/installPackage\.apexp\?p0=[a-zA-ZA-ZA-Z0-9]{18}\" title=\"sfGpsDsAuNswFull\"" | |
newPackageLink="https://test.salesforce.com/packaging/installPackage.apexp?p0=${packageVersionId}\" title=\"sfGpsDsAuNswFull\"" | |
sed -E -i "s,${packageLinkRegex},${newPackageLink}," README.md | |
# Create sfGpsDsAuNsw GH release | |
- name: "Release package sfGpsDsAuNsw" | |
if: ${{ github.event.client_payload.sfGpsDsAuNsw == 'true' || github.event.client_payload.sfGpsDs == 'true' }} | |
uses: ncipollo/release-action@v1 | |
with: | |
body: "Sandbox unmanaged package: [https://test.salesforce.com/packaging/installPackage.apexp?p0=${{ steps.createPackageVersion-sfGpsDsAuNsw.outputs.packageVersionId }}](https://test.salesforce.com/packaging/installPackage.apexp?p0=${{ steps.createPackageVersion-sfGpsDsAuNsw.outputs.packageVersionId }})" | |
name: "sfGpsDsAuNsw ${{ steps.createPackageVersion-sfGpsDsAuNsw.outputs.versionNumber }}" | |
prerelease: "true" | |
tag: "sfGpsDsAuNsw-${{ steps.createPackageVersion-sfGpsDsAuNsw.outputs.versionNumber }}" | |
# Update sfGpsDsAuNswS force:force:package:install link in readme | |
- name: "Update package sfGpsDsAuNswS install link in readme" | |
if: ${{ github.event.client_payload.sfGpsDsAuNswS == 'true' || github.event.client_payload.sfGpsDs == 'true' }} | |
run: | | |
packageVersionId="${{ steps.createPackageVersion-sfGpsDsAuNswS.outputs.packageVersionId }}" | |
packageLinkRegex="https:\/\/test\.salesforce\.com\/packaging\/installPackage\.apexp\?p0=[a-zA-ZA-ZA-Z0-9]{18}\" title=\"sfGpsDsAuNswSFull\"" | |
newPackageLink="https://test.salesforce.com/packaging/installPackage.apexp?p0=${packageVersionId}\" title=\"sfGpsDsAuNswSFull\"" | |
sed -E -i "s,${packageLinkRegex},${newPackageLink}," README.md | |
# Create sfGpsDsAuNswS GH release | |
- name: "Release package sfGpsDsAuNswS" | |
if: ${{ github.event.client_payload.sfGpsDsAuNswS == 'true' || github.event.client_payload.sfGpsDs == 'true' }} | |
uses: ncipollo/release-action@v1 | |
with: | |
body: "Sandbox unmanaged package: [https://test.salesforce.com/packaging/installPackage.apexp?p0=${{ steps.createPackageVersion-sfGpsDsAuNswS.outputs.packageVersionId }}](https://test.salesforce.com/packaging/installPackage.apexp?p0=${{ steps.createPackageVersion-sfGpsDsAuNswS.outputs.packageVersionId }})" | |
name: "sfGpsDsAuNswS ${{ steps.createPackageVersion-sfGpsDsAuNswS.outputs.versionNumber }}" | |
prerelease: "true" | |
tag: "sfGpsDsAuNswS-${{ steps.createPackageVersion-sfGpsDsAuNswS.outputs.versionNumber }}" | |
# Update sfGpsDsAuVic force:force:package:install link in readme | |
- name: "Update package sfGpsDsAuVic install link in readme" | |
if: ${{ github.event.client_payload.sfGpsDsAuVic1 == 'true' || github.event.client_payload.sfGpsDs == 'true' }} | |
run: | | |
packageVersionId="${{ steps.createPackageVersion-sfGpsDsAuVic1.outputs.packageVersionId }}" | |
packageLinkRegex="https:\/\/test\.salesforce\.com\/packaging\/installPackage\.apexp\?p0=[a-zA-ZA-ZA-Z0-9]{18}\" title=\"sfGpsDsAuVic1Full\"" | |
newPackageLink="https://test.salesforce.com/packaging/installPackage.apexp?p0=${packageVersionId}\" title=\"sfGpsDsAuVic1Full\"" | |
sed -E -i "s,${packageLinkRegex},${newPackageLink}," README.md | |
# Create sfGpsDsAuVic GH release | |
- name: "Release package sfGpsDsAuVic" | |
if: ${{ github.event.client_payload.sfGpsDsAuVic1 == 'true' || github.event.client_payload.sfGpsDs == 'true' }} | |
uses: ncipollo/release-action@v1 | |
with: | |
body: "Sandbox unmanaged package: [https://test.salesforce.com/packaging/installPackage.apexp?p0=${{ steps.createPackageVersion-sfGpsDsAuVic1.outputs.packageVersionId }}](https://test.salesforce.com/packaging/installPackage.apexp?p0=${{ steps.createPackageVersion-sfGpsDsAuVic1.outputs.packageVersionId }})" | |
name: "sfGpsDsAuVic ${{ steps.createPackageVersion-sfGpsDsAuVic1.outputs.versionNumber }}" | |
prerelease: "true" | |
tag: "sfGpsDsAuVic-${{ steps.createPackageVersion-sfGpsDsAuVic1.outputs.versionNumber }}" | |
# Update sfGpsDsAuVic2 force:force:package:install link in readme | |
- name: "Update package sfGpsDsAuVic2 install link in readme" | |
if: ${{ github.event.client_payload.sfGpsDsAuVic2 == 'true' || github.event.client_payload.sfGpsDs == 'true' }} | |
run: | | |
packageVersionId="${{ steps.createPackageVersion-sfGpsDsAuVic2.outputs.packageVersionId }}" | |
packageLinkRegex="https:\/\/test\.salesforce\.com\/packaging\/installPackage\.apexp\?p0=[a-zA-ZA-ZA-Z0-9]{18}\" title=\"sfGpsDsAuVic2Full\"" | |
newPackageLink="https://test.salesforce.com/packaging/installPackage.apexp?p0=${packageVersionId}\" title=\"sfGpsDsAuVic2Full\"" | |
sed -E -i "s,${packageLinkRegex},${newPackageLink}," README.md | |
# Create sfGpsDsAuVic2 GH release | |
- name: "Release package sfGpsDsAuVic2" | |
if: ${{ github.event.client_payload.sfGpsDsAuVic2 == 'true' || github.event.client_payload.sfGpsDs == 'true' }} | |
uses: ncipollo/release-action@v1 | |
with: | |
body: "Sandbox unmanaged package: [https://test.salesforce.com/packaging/installPackage.apexp?p0=${{ steps.createPackageVersion-sfGpsDsAuVic2.outputs.packageVersionId }}](https://test.salesforce.com/packaging/installPackage.apexp?p0=${{ steps.createPackageVersion-sfGpsDsAuVic2.outputs.packageVersionId }})" | |
name: "sfGpsDsAuVic2 ${{ steps.createPackageVersion-sfGpsDsAuVic2.outputs.versionNumber }}" | |
prerelease: "true" | |
tag: "sfGpsDsAuVic2-${{ steps.createPackageVersion-sfGpsDsAuVic2.outputs.versionNumber }}" | |
# Update sfGpsDsFrGov force:force:package:install link in readme | |
- name: "Update package sfGpsDsFrGov install link in readme" | |
if: ${{ github.event.client_payload.sfGpsDsFrGov == 'true' || github.event.client_payload.sfGpsDs == 'true' }} | |
run: | | |
packageVersionId="${{ steps.createPackageVersion-sfGpsDsFrGov.outputs.packageVersionId }}" | |
packageLinkRegex="https:\/\/test\.salesforce\.com\/packaging\/installPackage\.apexp\?p0=[a-zA-ZA-ZA-Z0-9]{18}\" title=\"sfGpsDsFrGovFull\"" | |
newPackageLink="https://test.salesforce.com/packaging/installPackage.apexp?p0=${packageVersionId}\" title=\"sfGpsDsFrGovFull\"" | |
sed -E -i "s,${packageLinkRegex},${newPackageLink}," README.md | |
# Create sfGpsDsFrGov GH release | |
- name: "Release package sfGpsDsFrGov" | |
if: ${{ github.event.client_payload.sfGpsDsFrGov == 'true' || github.event.client_payload.sfGpsDs == 'true' }} | |
uses: ncipollo/release-action@v1 | |
with: | |
body: "Sandbox unmanaged package: [https://test.salesforce.com/packaging/installPackage.apexp?p0=${{ steps.createPackageVersion-sfGpsDsFrGov.outputs.packageVersionId }}](https://test.salesforce.com/packaging/installPackage.apexp?p0=${{ steps.createPackageVersion-sfGpsDsFrGov.outputs.packageVersionId }})" | |
name: "sfGpsDsFrGov ${{ steps.createPackageVersion-sfGpsDsFrGov.outputs.versionNumber }}" | |
prerelease: "true" | |
tag: "sfGpsDsFrGov-${{ steps.createPackageVersion-sfGpsDsFrGov.outputs.versionNumber }}" | |
# Update sfGpsDsUkGov force:force:package:install link in readme | |
- name: "Update package sfGpsDsUkGov install link in readme" | |
if: ${{ github.event.client_payload.sfGpsDsUkGov == 'true' || github.event.client_payload.sfGpsDs == 'true' }} | |
run: | | |
packageVersionId="${{ steps.createPackageVersion-sfGpsDsUkGov.outputs.packageVersionId }}" | |
packageLinkRegex="https:\/\/test\.salesforce\.com\/packaging\/installPackage\.apexp\?p0=[a-zA-ZA-ZA-Z0-9]{18}\" title=\"sfGpsDsUkGovFull\"" | |
newPackageLink="https://test.salesforce.com/packaging/installPackage.apexp?p0=${packageVersionId}\" title=\"sfGpsDsUkGovFull\"" | |
sed -E -i "s,${packageLinkRegex},${newPackageLink}," README.md | |
# Create sfGpsDsUkGov GH release | |
- name: "Release package sfGpsDsUkGov" | |
if: ${{ github.event.client_payload.sfGpsDsUkGov == 'true' || github.event.client_payload.sfGpsDs == 'true' }} | |
uses: ncipollo/release-action@v1 | |
with: | |
body: "Sandbox unmanaged package: [https://test.salesforce.com/packaging/installPackage.apexp?p0=${{ steps.createPackageVersion-sfGpsDsUkGov.outputs.packageVersionId }}](https://test.salesforce.com/packaging/installPackage.apexp?p0=${{ steps.createPackageVersion-sfGpsDsUkGov.outputs.packageVersionId }})" | |
name: "sfGpsDsUkGov ${{ steps.createPackageVersion-sfGpsDsUkGov.outputs.versionNumber }}" | |
prerelease: "true" | |
tag: "sfGpsDsUkGov-${{ steps.createPackageVersion-sfGpsDsUkGov.outputs.versionNumber }}" | |
# run prettier as sfdx-package.json gets overwritten in a non-prettier way | |
- name: "Run prettier" | |
run: npm run prettier | |
# Create PR for new package version(s) | |
- name: "Create PR for new package version" | |
id: create-pr | |
uses: peter-evans/create-pull-request@v6 | |
with: | |
title: "Released new package version(s)" | |
body: "Released new package version(s)" | |
author: eschweitzer78-bot <[email protected]> | |
commit-message: "Released new package version(s)" | |
branch: "auto/release-package-version" | |
token: ${{ secrets.BOT_ACCESS_TOKEN }} | |
# Approve pull request | |
- name: "Approve pull request" | |
uses: juliangruber/approve-pull-request-action@v2 | |
with: | |
github-token: ${{ secrets.GITHUB_TOKEN }} | |
number: ${{ steps.create-pr.outputs.pull-request-number }} | |
# Wait for CI to be skipped on pull request | |
- name: "Wait for CI to be skipped on pull request" | |
uses: maddox/actions/sleep@master | |
with: | |
args: 60 | |
# Merge pull request | |
- name: "Merge pull request" | |
uses: juliangruber/merge-pull-request-action@v1 | |
with: | |
github-token: ${{ secrets.GITHUB_TOKEN }} | |
number: ${{ steps.create-pr.outputs.pull-request-number }} | |
method: squash | |
# Housekeeping | |
- name: "Delete scratch org" | |
if: always() | |
run: sfdx org delete scratch --no-prompt --target-org=scratch-org |