Skip to content

v2.2.0

v2.2.0 #4

name: release
on:
release:
types: [published]
jobs:
create-namespaced-package-version:
uses: ./.github/workflows/create-package-version.yml
with:
branch: release
packageAlias: Apex Mockery NS Test
secrets: inherit
validate-namespace-compatibility:
uses: ./.github/workflows/validate-namespace-compatibility.yml
needs: create-namespaced-package-version
with:
packageId: ${{ needs.create-namespaced-package-version.outputs.packageId }}
secrets: inherit
create-package-version:
uses: ./.github/workflows/create-package-version.yml
with:
branch: release
packageAlias: Apex Mockery
secrets: inherit
validate-package-version:
uses: ./.github/workflows/validate-package-version.yml
needs: create-package-version
with:
packageId: ${{ needs.create-package-version.outputs.packageId }}
secrets: inherit
promote-package-version:
runs-on: ubuntu-latest
needs: [create-package-version, validate-package-version, validate-namespace-compatibility]
steps:
- name: Set environment variables
run: |
echo "SF_DISABLE_AUTOUPDATE=true" >> $GITHUB_ENV
echo "SF_DISABLE_SOURCE_MEMBER_POLLING=true" >> $GITHUB_ENV
echo "SF_DISABLE_TELEMETRY=true" >> $GITHUB_ENV
echo "SF_PROJECT_AUTOUPDATE_DISABLE_FOR_PACKAGE_VERSION_CREATE=true" >> $GITHUB_ENV
- name: Checkout
uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 20
cache: 'npm'
- name: Install sfdx and connect to DevHub
run: |
npm install --global @salesforce/cli@${{ vars.SFDX_VERSION }}
echo ${{ secrets.DEVHUB_URL }} > sfdx_auth
sf org login sfdx-url --sfdx-url-file sfdx_auth --set-default-dev-hub --alias hub
sf config set target-dev-hub=hub --global
- name: Promote latest main package version
run: sf package version promote --no-prompt --package ${{ needs.create-package-version.outputs.packageId }}
update-release:
runs-on: ubuntu-latest
needs: [create-package-version, promote-package-version]
steps:
- name: Create package links
run: |
packageId=${{ needs.create-package-version.outputs.packageId }}
links=$(cat << EOF
### Unlocked Package installation
- Production [link](https://login.salesforce.com/packaging/installPackage.apexp?p0=$packageId)
- Sandbox [link](https://test.salesforce.com/packaging/installPackage.apexp?p0=$packageId)
- sfdx command: \`sf package install --package $packageId\`
EOF
)
echo "links<<EOF" >> $GITHUB_ENV
echo "$links" >> $GITHUB_ENV
echo "EOF" >> $GITHUB_ENV
- name: Update release with package Id
uses: irongut/EditRelease@v1.2.0
with:
token: ${{ github.token }}
id: ${{ github.event.release.id }}
body: ${{ env.links }}
replacebody: false
- name: Communicate release information
uses: apexskier/github-release-commenter@v1
with:
GITHUB_TOKEN: ${{ github.token }}
comment-template: |
Shipped in [release `{release_tag}`]({release_link}).
${{ env.links }}