Build pipelines for Unlocked Package (#81)
* Build pipelines for Unlocked Package * Build pipelines for Unlocked Package * Build pipelines for Unlocked Package * Build pipelines for Unlocked Package * Build pipelines for Unlocked Package * Build pipelines for Unlocked Package * Build pipelines for Unlocked Package * Build pipelines for Unlocked Package * Build pipelines for Unlocked Package * Build pipelines for Unlocked Package * Build pipelines for Unlocked Package * Build issues * Build pipeline fixes * Build pipeline fixes * Build pipeline fixes * Build pipeline fixes * Build pipeline fixes * Build pipeline fixes * Add publish pipeline * New package version 0.1.0-1-feature/UnlockedManagedPackage created * Update Package Version Log with 0.1.0-1-feature/UnlockedManagedPackage-Beta
This commit is contained in:
@@ -1,7 +1,10 @@
|
|||||||
name: Create a Scratch Org, Push Source and Run Apex Tests
|
name: Build and Test
|
||||||
|
|
||||||
on:
|
on:
|
||||||
pull_request_target:
|
pull_request:
|
||||||
|
branches:
|
||||||
|
- main
|
||||||
|
types: [opened, synchronize, reopened]
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
build:
|
build:
|
||||||
@@ -13,17 +16,75 @@ jobs:
|
|||||||
with:
|
with:
|
||||||
ref: ${{github.event.pull_request.head.ref}}
|
ref: ${{github.event.pull_request.head.ref}}
|
||||||
repository: ${{github.event.pull_request.head.repo.full_name}}
|
repository: ${{github.event.pull_request.head.repo.full_name}}
|
||||||
- name: Install SFDX CLI and authorize DevHub
|
|
||||||
uses: sfdx-actions/setup-sfdx@v1
|
- name: Install Node.js
|
||||||
|
uses: actions/setup-node@v4
|
||||||
with:
|
with:
|
||||||
sfdx-auth-url: ${{ secrets.SFDX_AUTH_URL }}
|
node-version: 20
|
||||||
- run: echo y | sfdx force:org:list
|
|
||||||
- run: echo y | sfdx plugins:install shane-sfdx-plugins
|
- name: Install Salesforce CLI with NPM
|
||||||
- run: sfdx force:org:create -f config/project-scratch-def.json --setdefaultusername -d 1
|
run: npm install @salesforce/cli --global
|
||||||
- run: sfdx shane:github:src:install -c -g apex-enterprise-patterns -r fflib-apex-mocks -p sfdx-source/apex-mocks
|
|
||||||
- run: sfdx shane:github:src:install -c -g apex-enterprise-patterns -r fflib-apex-common -p sfdx-source/apex-common
|
- name: Authorize with the dev hub
|
||||||
- run: sfdx force:source:push --forceoverwrite
|
run: echo "${{ secrets.SFDX_AUTH_URL }}" | sf org login sfdx-url --alias SFDX-ENV --set-default-dev-hub --sfdx-url-stdin
|
||||||
- run: sfdx force:apex:test:run --codecoverage --resultformat human --wait 5
|
|
||||||
- name: Destroy scratch org
|
- name: Setup the config parameters needed
|
||||||
run: sfdx force:org:delete -p
|
run: |
|
||||||
if: always()
|
sf config set target-dev-hub SFDX-ENV --global
|
||||||
|
|
||||||
|
- name: Setup Git Configuration
|
||||||
|
run: |
|
||||||
|
git config --global user.name 'WimVelzeboer'
|
||||||
|
git config --global user.email 'wim@velzeboer.nl'
|
||||||
|
|
||||||
|
- name: Fetch required dependency framework fflib-apex-mocks
|
||||||
|
run: |
|
||||||
|
mkdir ./temp
|
||||||
|
cd ./temp
|
||||||
|
git clone https://github.com/apex-enterprise-patterns/fflib-apex-mocks.git
|
||||||
|
cd ..
|
||||||
|
cp -R ./temp/fflib-apex-mocks/sfdx-source/apex-mocks ./sfdx-source/
|
||||||
|
|
||||||
|
- name: Fetch required dependency framework fflib-apex-common
|
||||||
|
run: |
|
||||||
|
cd ./temp
|
||||||
|
git clone https://github.com/apex-enterprise-patterns/fflib-apex-common.git
|
||||||
|
cd ..
|
||||||
|
cp -R ./temp/fflib-apex-common/sfdx-source/apex-common ./sfdx-source/
|
||||||
|
|
||||||
|
- name: Get branch name
|
||||||
|
id: get-branch-name
|
||||||
|
run: |
|
||||||
|
if [ "${{ github.event_name }}" == "pull_request" ]; then
|
||||||
|
echo "BRANCH_NAME=${{ github.head_ref }}" >> $GITHUB_OUTPUT
|
||||||
|
else
|
||||||
|
echo "BRANCH_NAME=${GITHUB_REF#refs/heads/}" >> $GITHUB_OUTPUT
|
||||||
|
fi
|
||||||
|
|
||||||
|
- name: Generate Package Version
|
||||||
|
run: |
|
||||||
|
echo "Creating new BETA package version"
|
||||||
|
OUTPUT=`sf package version create --installation-key-bypass --package "fflibApexExtensions" --code-coverage -w 30 --definition-file config/project-scratch-def.json --branch ${{ steps.get-branch-name.outputs.BRANCH_NAME }}`
|
||||||
|
echo "$OUTPUT"
|
||||||
|
[ $? -eq 0 ] && echo "successful" || exit 1
|
||||||
|
|
||||||
|
STRING=`echo "$OUTPUT" | grep 'Package Version Id:'`
|
||||||
|
VERSION_ID="${STRING##*: }"
|
||||||
|
VERSION=`grep $VERSION_ID sfdx-project.json | cut -d "@" -f2 | cut -d "\"" -f1`
|
||||||
|
echo "Created BETA package version: $VERSION with Id: $VERSION_ID"
|
||||||
|
|
||||||
|
git commit -am "New package version $VERSION created"
|
||||||
|
|
||||||
|
echo "PACKAGE_ID=$VERSION_ID" >> "$GITHUB_ENV"
|
||||||
|
echo "PACKAGE_VERSION=$VERSION" >> "$GITHUB_ENV"
|
||||||
|
|
||||||
|
- name: Appending to package version log
|
||||||
|
run: |
|
||||||
|
DT=$(date '+%d/%m/%Y %H:%M:%S');
|
||||||
|
echo "|$PACKAGE_VERSION (BETA) | $PACKAGE_ID | Created on $DT |" >> README.md
|
||||||
|
git add README.md
|
||||||
|
git commit -am "Update Package Version Log with $PACKAGE_VERSION-Beta"
|
||||||
|
|
||||||
|
- name: Push changes to GIT
|
||||||
|
run: |
|
||||||
|
git push
|
||||||
@@ -0,0 +1,95 @@
|
|||||||
|
name: Publish a new package version
|
||||||
|
|
||||||
|
on:
|
||||||
|
pull_request:
|
||||||
|
branches:
|
||||||
|
- main
|
||||||
|
types:
|
||||||
|
- closed
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
build:
|
||||||
|
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v2
|
||||||
|
with:
|
||||||
|
ref: ${{github.event.pull_request.head.ref}}
|
||||||
|
repository: ${{github.event.pull_request.head.repo.full_name}}
|
||||||
|
|
||||||
|
- name: Install Node.js
|
||||||
|
uses: actions/setup-node@v4
|
||||||
|
with:
|
||||||
|
node-version: 20
|
||||||
|
|
||||||
|
- name: Install Salesforce CLI with NPM
|
||||||
|
run: npm install @salesforce/cli --global
|
||||||
|
|
||||||
|
- name: Authorize with the dev hub
|
||||||
|
run: echo "${{ secrets.SFDX_AUTH_URL }}" | sf org login sfdx-url --alias SFDX-ENV --set-default-dev-hub --sfdx-url-stdin
|
||||||
|
|
||||||
|
- name: Setup the config parameters needed
|
||||||
|
run: |
|
||||||
|
sf config set target-dev-hub SFDX-ENV --global
|
||||||
|
|
||||||
|
- name: Get branch name
|
||||||
|
id: get-branch-name
|
||||||
|
run: |
|
||||||
|
if [ "${{ github.event_name }}" == "pull_request" ]; then
|
||||||
|
echo "Branch name: ${{ github.head_ref }}"
|
||||||
|
echo "BRANCH_NAME=${{ github.head_ref }}" >> $GITHUB_ENV
|
||||||
|
else
|
||||||
|
echo "Branch name: ${GITHUB_REF#refs/heads/}"
|
||||||
|
echo "BRANCH_NAME=${GITHUB_REF#refs/heads/}" >> $GITHUB_ENV
|
||||||
|
fi
|
||||||
|
|
||||||
|
- name: Fetching Latest Package Version Id
|
||||||
|
run: |
|
||||||
|
DATA=`sf package version list --packages "fflibApexExtensions" --target-dev-hub HarrierDevHub --branch $BRANCH_NAME --json`
|
||||||
|
LATEST_VERSION=`echo "$DATA" | jq '.result[-1]'`
|
||||||
|
|
||||||
|
VERSION=`echo "$LATEST_VERSION" | jq -r '.Version'`
|
||||||
|
VERSION_NAME=`echo "$LATEST_VERSION" | jq -r '.Name'`
|
||||||
|
VERSION_ID=`echo "$LATEST_VERSION" | jq -r '.SubscriberPackageVersionId'`
|
||||||
|
|
||||||
|
echo "Version: $VERSION"
|
||||||
|
echo "Version Name: $VERSION_NAME"
|
||||||
|
echo "Version ID: $VERSION_ID"
|
||||||
|
|
||||||
|
echo "PACKAGE_VERSION_ID=$VERSION_ID" >> "$GITHUB_ENV"
|
||||||
|
echo "PACKAGE_VERSION_NAME=$VERSION_ID" >> "$GITHUB_ENV"
|
||||||
|
echo "PACKAGE_VERSION=$VERSION" >> "$GITHUB_ENV"
|
||||||
|
|
||||||
|
- name: Promoting BETA Package Version
|
||||||
|
run: |
|
||||||
|
sf package version promote --package $PACKAGE_VERSION_ID --target-dev-hub SFDX-ENV --no-prompt
|
||||||
|
|
||||||
|
- name: Update package version
|
||||||
|
run: |
|
||||||
|
echo "Increasing package versionName"
|
||||||
|
NEW_PACKAGE_VERSION_NAME=`echo "ver $(echo "$PACKAGE_VERSION" | cut -d ' ' -f2 | cut -d '.' -f1).$(expr "$(echo "$PACKAGE_VERSION" | cut -d ' ' -f2 | cut -d '.' -f2)" + 1)"`
|
||||||
|
cat sfdx-project.json | jq -r --arg VERSION "$NEW_PACKAGE_VERSION_NAME" '.packageDirectories |= map(select(.package == "fflibApexExtensions").versionName = $VERSION)' > tmp.json
|
||||||
|
mv tmp.json sfdx-project.json
|
||||||
|
|
||||||
|
echo "Increasing package versionNumber"
|
||||||
|
NEW_PACKAGE_VERSION=`echo "$(echo "$NEW_PACKAGE_VERSION_NAME" | cut -d ' ' -f2).0.NEXT"`
|
||||||
|
cat sfdx-project.json | jq -r --arg VERSION "$NEW_PACKAGE_VERSION" '.packageDirectories |= map(select(.package == "fflibApexExtensions").versionNumber = $VERSION)' > tmp.json
|
||||||
|
mv tmp.json sfdx-project.json
|
||||||
|
|
||||||
|
echo "NEW_PACKAGE_VERSION_NAME=$NEW_PACKAGE_VERSION_NAME" >> "$GITHUB_ENV"
|
||||||
|
echo "NEW_PACKAGE_VERSION=$NEW_PACKAGE_VERSION" >> "$GITHUB_ENV"
|
||||||
|
|
||||||
|
- name: Updating Package Version Log
|
||||||
|
run: |
|
||||||
|
sed -i "s/ (BETA) | $$PACKAGE_VERSION_ID/| $PACKAGE_VERSION_ID/g" README.md
|
||||||
|
|
||||||
|
- name: Committing can pushing changes
|
||||||
|
run: |
|
||||||
|
git config --global user.name 'WimVelzeboer'
|
||||||
|
git config --global user.email 'wim@velzeboer.nl'
|
||||||
|
git add sfdx-project.json
|
||||||
|
git add README.md
|
||||||
|
git commit -am "Update package version to $NEW_PACKAGE_VERSION"
|
||||||
|
git tag -a "v$PACKAGE_VERSION" -m "Release Version $PACKAGE_VERSION\n\nPackage Version Id: $PACKAGE_VERSION_ID"
|
||||||
|
git push --tags
|
||||||
@@ -0,0 +1,20 @@
|
|||||||
|
name: Create Release
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
tags:
|
||||||
|
- 'v*'
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
release:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- name: Create Release
|
||||||
|
env:
|
||||||
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
run: |
|
||||||
|
tag="${{ github.ref_name }}"
|
||||||
|
gh release create "$tag" \
|
||||||
|
--repo="$GITHUB_REPOSITORY" \
|
||||||
|
--title="${tag#v}" \
|
||||||
|
--generate-notes \
|
||||||
|
--draft=false
|
||||||
@@ -51,9 +51,11 @@ Some of the changes that have major impact are listed here;
|
|||||||
|
|
||||||
### Updates January 2026
|
### Updates January 2026
|
||||||
- **fflib_ArrayUtils** <br/>
|
- **fflib_ArrayUtils** <br/>
|
||||||
_replaceKey_,<br/>Add method to replace the key of a given map.</br>
|
_copyFields_,<br/>Add method that copies field values in bulk from one domain to another related domain<br/>
|
||||||
_replaceValue_,<br/>Add three method overloads for merging a source map of idById and replacement map of idByString, idByDecimal or idByBoolean.</br>
|
_mergeMaps_,<br/>Add method overload to merge two maps of idByBoolean<br/>
|
||||||
_mergeMaps_,<br/>Add method overload to merge two maps of idByBoolean<br/><br/>
|
_replaceKey_,<br/>Add method to replace the key of a given map.<br/>
|
||||||
|
_replaceValue_,<br/>Add three method overloads for merging a source map of idById and replacement map of idByString, idByDecimal or idByBoolean.<br/><br/>
|
||||||
|
|
||||||
- **fflib_SObjects2**<br/>
|
- **fflib_SObjects2**<br/>
|
||||||
The following methods have been added to the SObjects2 class:<br/>
|
The following methods have been added to the SObjects2 class:<br/>
|
||||||
_getBooleanFieldByIdField_<br/>
|
_getBooleanFieldByIdField_<br/>
|
||||||
@@ -105,3 +107,8 @@ We are pleased to announce that the fflib-apex-extensions Project is accepting d
|
|||||||
> 8BMsQrdLiBvKaP87GFMPE9Wa1US79ygcp3b9kwoDq1iBW9JEYbcgpDS3hMp2p7ePWiCEKg2fdTucUbpNTtGbnvCCQZTMSu1
|
> 8BMsQrdLiBvKaP87GFMPE9Wa1US79ygcp3b9kwoDq1iBW9JEYbcgpDS3hMp2p7ePWiCEKg2fdTucUbpNTtGbnvCCQZTMSu1
|
||||||
|
|
||||||
Thank you for your donations!
|
Thank you for your donations!
|
||||||
|
|
||||||
|
## Package version log
|
||||||
|
|
||||||
|
| Package version | Package ID | Description |
|
||||||
|
|-----------------|--------------------|--------------------------||0.1.0-1-feature/UnlockedManagedPackage (BETA) | 04tJ8000000kaKQIAY | Created on 26/03/2026 18:14:51 |
|
||||||
|
|||||||
@@ -1,6 +1,8 @@
|
|||||||
{
|
{
|
||||||
"orgName": "fflib-apex-extensions",
|
"orgName": "fflib-apex-extensions",
|
||||||
"edition": "Developer",
|
"edition": "Developer",
|
||||||
|
"country": "US",
|
||||||
|
"language": "en_US",
|
||||||
"features": ["EnableSetPasswordInApi"],
|
"features": ["EnableSetPasswordInApi"],
|
||||||
"settings": {
|
"settings": {
|
||||||
"lightningExperienceSettings": {
|
"lightningExperienceSettings": {
|
||||||
|
|||||||
+11
-3
@@ -1,12 +1,20 @@
|
|||||||
{
|
{
|
||||||
"packageDirectories": [
|
"packageDirectories": [
|
||||||
{
|
{
|
||||||
"path": "sfdx-source/apex-extensions",
|
"versionName": "ver 0.1",
|
||||||
"default": true
|
"versionNumber": "0.1.0.NEXT",
|
||||||
|
"path": "sfdx-source",
|
||||||
|
"default": true,
|
||||||
|
"package": "fflibApexExtensions",
|
||||||
|
"versionDescription": "Extension Package for the fflib-apex-common Library with many advanced features"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"name": "fflib-apex-extensions",
|
"name": "fflib-apex-extensions",
|
||||||
"namespace": "",
|
"namespace": "",
|
||||||
"sfdcLoginUrl": "https://login.salesforce.com",
|
"sfdcLoginUrl": "https://login.salesforce.com",
|
||||||
"sourceApiVersion": "65.0"
|
"sourceApiVersion": "65.0",
|
||||||
|
"packageAliases": {
|
||||||
|
"fflibApexExtensions": "0HoJ8000000KyjfKAC",
|
||||||
|
"fflibApexExtensions@0.1.0-1-feature/UnlockedManagedPackage": "04tJ8000000kaKQIAY"
|
||||||
|
}
|
||||||
}
|
}
|
||||||
Reference in New Issue
Block a user