From 41c091e224d7ca6a33bac991ff5a6fed51701fad Mon Sep 17 00:00:00 2001 From: Ruslan Kurchenko Date: Fri, 1 Sep 2023 00:15:51 +0300 Subject: [PATCH 1/8] feat(template): github - base version of Defined Release action --- .github/workflows/quickbuild-deploy-build.yml | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/.github/workflows/quickbuild-deploy-build.yml b/.github/workflows/quickbuild-deploy-build.yml index f033c64..9d26d97 100644 --- a/.github/workflows/quickbuild-deploy-build.yml +++ b/.github/workflows/quickbuild-deploy-build.yml @@ -131,3 +131,16 @@ jobs: sfp orchestrator:publish -d artifacts --npm --scope @${{ github.repository_owner }} --gittag --pushgittag env: NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }} + + - name: 'Define Release' + run: | + RELEASE_NAME=${GITHUB_RUN_ID} + if [ "$RELEASE_NAME_PREFIX" != "" ]; then RELEASE_NAME="${RELEASE_NAME_PREFIX}-${GITHUB_RUN_ID}"; fi + + TARGET_BRANCH="release-definition" + if [ "$RELEASE_DEF_TARGET_BRANCH" != "" ]; then TARGET_BRANCH="$RELEASE_DEF_TARGET_BRANCH"; fi + + git tag -a $RELEASE_NAME -m "$RELEASE_NAME" + git push origin $RELEASE_NAME + + sfp releasedefinition:generate --branchname "$TARGET_BRANCH_BANE" --gitref "$RELEASE_NAME" --configfile release-config/config.yml --releasename "$RELEASE_NAME" From 25410b00554bebd863b47022f903c4c5e7925afa Mon Sep 17 00:00:00 2001 From: Ruslan Kurchenko Date: Fri, 1 Sep 2023 00:42:29 +0300 Subject: [PATCH 2/8] feat(template): github - Define patch release automatically on push --- .github/workflows/release-build-publish.yml | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/.github/workflows/release-build-publish.yml b/.github/workflows/release-build-publish.yml index fca3374..f6e120e 100644 --- a/.github/workflows/release-build-publish.yml +++ b/.github/workflows/release-build-publish.yml @@ -71,4 +71,17 @@ jobs: run: | sfp orchestrator:publish -d artifacts --npm --scope @${{ github.repository_owner }} --gittag --pushgittag env: - NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }} \ No newline at end of file + NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }} + + - name: 'Define Release' + run: | + RELEASE_NAME=${GITHUB_RUN_ID} + if [ "$RELEASE_NAME_PREFIX" != "" ]; then RELEASE_NAME="${RELEASE_NAME_PREFIX}-${GITHUB_RUN_ID}"; fi + + TARGET_BRANCH="release-definition" + if [ "$RELEASE_DEF_TARGET_BRANCH" != "" ]; then TARGET_BRANCH="$RELEASE_DEF_TARGET_BRANCH"; fi + + git tag -a $RELEASE_NAME -m "$RELEASE_NAME" + git push origin $RELEASE_NAME + + sfp releasedefinition:generate --branchname "$TARGET_BRANCH_BANE" --gitref "$RELEASE_NAME" --configfile release-config/config.yml --releasename "$RELEASE_NAME" From 0821e240d5579de24817a1c1e590445aa96f109f Mon Sep 17 00:00:00 2001 From: Ruslan Kurchenko Date: Fri, 1 Sep 2023 00:43:20 +0300 Subject: [PATCH 3/8] feat(template): github - Release based on defined file with certain package versions --- .github/workflows/release.yml | 48 +++++++++-------------------------- 1 file changed, 12 insertions(+), 36 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index ba17bea..dca4356 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -21,6 +21,10 @@ on: pathToReleaseDef: description: "Path to release definition file" required: true + releaseDefBranch: + description: "Branch to fetch release definition file from" + required: true + default: "release-definition" #Set the environment variables for tracking metrics #env: @@ -53,17 +57,17 @@ jobs: # Release to environment - name: 'Release to ST' - run: 'sfp orchestrator:release -u st -p ${{ github.event.inputs.pathToReleaseDef }} --npm --scope ${{ github.repository_owner }} --generatechangelog --branchname changelog -g "::group::,::endgroup::"' + run: | + git checkout ${{ github.event.inputs.releaseDefBranch }} + sfp orchestrator:release -u st -p ${{ github.event.inputs.pathToReleaseDef }} --npm --scope ${{ github.repository_owner }} --generatechangelog --branchname changelog -g "::group::,::endgroup::" env: NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }} SIT: runs-on: ubuntu-latest container: ghcr.io/dxatscale/sfpowerscripts - if: github.ref == 'refs/heads/main' || contains(github.ref,'refs/heads/release') environment: name: SIT - needs: ST steps: - uses: actions/checkout@v2 @@ -84,37 +88,9 @@ jobs: # Release to environment - name: 'Release to SIT' - run: 'sfp orchestrator:release -u sit -p ${{ github.event.inputs.pathToReleaseDef }} --npm --scope ${{ github.repository_owner }} --generatechangelog --branchname changelog -g "::group::,::endgroup::" ' - env: - NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }} - - UAT: - runs-on: ubuntu-latest - container: ghcr.io/dxatscale/sfpowerscripts - if: contains(github.ref,'refs/heads/release') - environment: - name: UAT - - steps: - - uses: actions/checkout@v2 - with: - fetch-depth: 0 - - - - name: Authenticate to UAT run: | - echo "${{ secrets.UAT_SFDX_AUTH_URL }}" > ./authfile - sf org login sfdx-url -f ./authfile -a uat - - # Authenticate to npm - - uses: actions/setup-node@v3 - with: - registry-url: 'https://npm.pkg.github.com' - - - # Release to environment - - name: 'Release to UAT' - run: 'sfp orchestrator:release -u uat -p ${{ github.event.inputs.pathToReleaseDef }} --npm --scope ${{ github.repository_owner }} --generatechangelog --branchname changelog -g "::group::,::endgroup::"' + git checkout ${{ github.event.inputs.releaseDefBranch }} + sfp orchestrator:release -u sit -p ${{ github.event.inputs.pathToReleaseDef }} --npm --scope ${{ github.repository_owner }} --generatechangelog --branchname changelog -g "::group::,::endgroup::" env: NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }} @@ -122,10 +98,8 @@ jobs: PROD: runs-on: ubuntu-latest container: ghcr.io/dxatscale/sfpowerscripts - if: contains(github.ref,'refs/heads/release') environment: name: PROD - needs: UAT steps: - uses: actions/checkout@v2 @@ -147,6 +121,8 @@ jobs: # Release to environment - name: 'Release to PROD' - run: 'sfp orchestrator:release -u prod -p ${{ github.event.inputs.pathToReleaseDef }} --npm --scope ${{ github.repository_owner }} --generatechangelog --branchname changelog -g "::group::,::endgroup::"' + run: | + git checkout ${{ github.event.inputs.releaseDefBranch }} + sfp orchestrator:release -u prod -p ${{ github.event.inputs.pathToReleaseDef }} --npm --scope ${{ github.repository_owner }} --generatechangelog --branchname changelog -g "::group::,::endgroup::" env: NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }} \ No newline at end of file From 85df742479d91d58201213d8173b781a9dacca1c Mon Sep 17 00:00:00 2001 From: Ruslan Kurchenko Date: Sat, 2 Sep 2023 13:35:50 +0300 Subject: [PATCH 4/8] feat(template): github - Simplify release pipeline DEV - STAGING - PROD --- .github/workflows/release.yml | 69 ++++++++++++----------------------- 1 file changed, 24 insertions(+), 45 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index dca4356..053e394 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -4,15 +4,14 @@ # Follows reference pipeline available at docs.dxatscale.io # #----------------------------------------------------------------------------------------------------- -# To know more about dxatscale, visit https://docs.dxatscale.io -# To know more on sfpowerscripts, visit- https://sfpowerscripts.dxatscale.io/ -# To know more on sfpowerkit, visit- https://github.com/Accenture/sfpowerkit +# To know more about dxatscale, visit - https://docs.dxatscale.io +# To know more on sfpowerscripts, visit - https://sfpowerscripts.dxatscale.io/ # This pipeline is used to release a set of packages into respective environments # Changelog will be written to changelog branch -name: 'CD Pipeline - User Triggered' +name: 'release' on: @@ -26,48 +25,27 @@ on: required: true default: "release-definition" -#Set the environment variables for tracking metrics -#env: - #SFPOWERSCRIPTS_NEWRELIC: 'true' - #SFPOWERSCRIPTS_NEWRELIC_API_KEY: '${{ secrets.NEWRELIC_INSIGHT_INSERT_KEYS }}' - #SFPOWERSCRIPTS_DATADOG: 'true' - #SFPOWERSCRIPTS_DATADOG_HOST: '${{ secrets.DATADOG_HOST }}' - #SFPOWERSCRIPTS_DATADOG_API_KEY: '${{ secrets.DATADOG_API_KEY }}' +# Set the environment variables +#---------------------------------------------------------------------------------------------------- +# Authentication: +# - STAGING_SFDX_AUTH_URL +# - PROD_SFDX_AUTH_URL +#----------------------------------------------------------------------------------------------------- +# Tracking Metrics: +# - SFPOWERSCRIPTS_NEWRELIC: 'true' +# - SFPOWERSCRIPTS_NEWRELIC_API_KEY: '${{ secrets.NEWRELIC_INSIGHT_INSERT_KEYS }}' +# - SFPOWERSCRIPTS_DATADOG: 'true' +# - SFPOWERSCRIPTS_DATADOG_HOST: '${{ secrets.DATADOG_HOST }}' +# - SFPOWERSCRIPTS_DATADOG_API_KEY: '${{ secrets.DATADOG_API_KEY }}' jobs: - ST: - runs-on: ubuntu-latest - container: ghcr.io/dxatscale/sfpowerscripts - environment: - name: ST - steps: - - uses: actions/checkout@v2 - with: - fetch-depth: 0 - - - name: Authenticate to ST sandbox - run: | - echo "${{ secrets.ST_SFDX_AUTH_URL }}" > ./authfile - sf org login sfdx-url -f ./authfile -a st - - # Authenticate to npm - - uses: actions/setup-node@v3 - with: - registry-url: 'https://npm.pkg.github.com' - - # Release to environment - - name: 'Release to ST' - run: | - git checkout ${{ github.event.inputs.releaseDefBranch }} - sfp orchestrator:release -u st -p ${{ github.event.inputs.pathToReleaseDef }} --npm --scope ${{ github.repository_owner }} --generatechangelog --branchname changelog -g "::group::,::endgroup::" - env: - NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }} - SIT: + STAGING: runs-on: ubuntu-latest container: ghcr.io/dxatscale/sfpowerscripts + if: github.ref == 'refs/heads/main' || contains(github.ref,'refs/heads/release') environment: - name: SIT + name: STAGING steps: - uses: actions/checkout@v2 @@ -75,9 +53,9 @@ jobs: fetch-depth: 0 - - name: Authenticate to SIT sandbox + - name: Authenticate to STAGING environment run: | - echo "${{ secrets.SIT_SFDX_AUTH_URL }}" > ./authfile + echo "${{ secrets.STAGING_SFDX_AUTH_URL }}" > ./authfile sf org login sfdx-url -f ./authfile -a sit # Authenticate to npm @@ -87,7 +65,7 @@ jobs: # Release to environment - - name: 'Release to SIT' + - name: Release to STAGING run: | git checkout ${{ github.event.inputs.releaseDefBranch }} sfp orchestrator:release -u sit -p ${{ github.event.inputs.pathToReleaseDef }} --npm --scope ${{ github.repository_owner }} --generatechangelog --branchname changelog -g "::group::,::endgroup::" @@ -98,6 +76,7 @@ jobs: PROD: runs-on: ubuntu-latest container: ghcr.io/dxatscale/sfpowerscripts + if: github.ref == 'refs/heads/main' || contains(github.ref,'refs/heads/release') environment: name: PROD @@ -109,7 +88,7 @@ jobs: - name: Authenticate to PROD run: | - echo "${{ secrets.DEVHUB_SFDX_AUTH_URL }}" > ./authfile + echo "${{ secrets.PROD_SFDX_AUTH_URL }}" > ./authfile sf org login sfdx-url -f ./authfile -a prod @@ -120,7 +99,7 @@ jobs: # Release to environment - - name: 'Release to PROD' + - name: Release to PROD run: | git checkout ${{ github.event.inputs.releaseDefBranch }} sfp orchestrator:release -u prod -p ${{ github.event.inputs.pathToReleaseDef }} --npm --scope ${{ github.repository_owner }} --generatechangelog --branchname changelog -g "::group::,::endgroup::" From b270dc752f6a5c35a81d73c6d34cc0c28d41adae Mon Sep 17 00:00:00 2001 From: Ruslan Kurchenko Date: Sat, 2 Sep 2023 13:36:36 +0300 Subject: [PATCH 5/8] feat(template): github - Update .gitignore --- .gitignore | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitignore b/.gitignore index 0bf45d4..312b7ba 100644 --- a/.gitignore +++ b/.gitignore @@ -3,3 +3,4 @@ artifacts .sfdx .sf .npmrc +.idea From 64596931cd2a33878875e40b9d531cadbddb7931 Mon Sep 17 00:00:00 2001 From: Ruslan Kurchenko Date: Sat, 2 Sep 2023 13:44:46 +0300 Subject: [PATCH 6/8] feat(template): github - Cleanup build workflow --- .github/workflows/quickbuild-deploy-build.yml | 43 +++++++++---------- 1 file changed, 21 insertions(+), 22 deletions(-) diff --git a/.github/workflows/quickbuild-deploy-build.yml b/.github/workflows/quickbuild-deploy-build.yml index 9d26d97..0a74c76 100644 --- a/.github/workflows/quickbuild-deploy-build.yml +++ b/.github/workflows/quickbuild-deploy-build.yml @@ -5,11 +5,10 @@ #----------------------------------------------------------------------------------------------------- # To know more about dxatscale, visit https://docs.dxatscale.io # To know more on sfpowerscripts, visit- https://sfpowerscripts.dxatscale.io/ -# To know more on sfpowerkit, visit- https://github.com/Accenture/sfpowerkit -# This pipeline quickbuilds, deploy to DEV, builds and publishes packages to artifact repository +# This pipeline quickbuilds, deploy to DEV, builds and publishes packages to artifact repository and creates a release definition -name: 'CI Pipeline - Auto Triggered' +name: 'build' on: @@ -17,27 +16,27 @@ on: branches: - main - workflow_dispatch: - - -#Set the environment variables for tracking metrics -#env: - #SFPOWERSCRIPTS_NEWRELIC: 'true' - #SFPOWERSCRIPTS_NEWRELIC_API_KEY: '${{ secrets.NEWRELIC_INSIGHT_INSERT_KEYS }}' - #SFPOWERSCRIPTS_DATADOG: 'true' - #SFPOWERSCRIPTS_DATADOG_HOST: '${{ secrets.DATADOG_HOST }}' - #SFPOWERSCRIPTS_DATADOG_API_KEY: '${{ secrets.DATADOG_API_KEY }}' - - +# Set the environment variables +#---------------------------------------------------------------------------------------------------- +# Authentication: +# - DEV_SFDX_AUTH_URL +# - DEVHUB_SFDX_AUTH_URL +#----------------------------------------------------------------------------------------------------- +# Tracking Metrics: +# - SFPOWERSCRIPTS_NEWRELIC: 'true' +# - SFPOWERSCRIPTS_NEWRELIC_API_KEY: '${{ secrets.NEWRELIC_INSIGHT_INSERT_KEYS }}' +# - SFPOWERSCRIPTS_DATADOG: 'true' +# - SFPOWERSCRIPTS_DATADOG_HOST: '${{ secrets.DATADOG_HOST }}' +# - SFPOWERSCRIPTS_DATADOG_API_KEY: '${{ secrets.DATADOG_API_KEY }}' jobs: quickbuild: - name: 'Quickbuild packages' + name: 'Quickbuild Packages' runs-on: ubuntu-latest container: ghcr.io/dxatscale/sfpowerscripts - if: github.ref == 'refs/heads/main' + if: github.ref == 'refs/heads/main' steps: - uses: actions/checkout@v2 with: @@ -48,7 +47,7 @@ jobs: echo "${{ secrets.DEVHUB_SFDX_AUTH_URL }}" > ./authfile sf org login sfdx-url -f authfile -a devhub - - name: 'Create packages' + - name: 'Create Packages' id: sfpowerscripts-build run: | sfp orchestrator:quickbuild -v devhub --diffcheck --buildnumber ${GITHUB_RUN_ID} --branch ${GITHUB_REF#refs/heads/} @@ -60,7 +59,7 @@ jobs: path: artifacts deploy: - name: 'Deploy to Dev' + name: 'Deploy to DEV' runs-on: ubuntu-latest container: ghcr.io/dxatscale/sfpowerscripts needs: quickbuild @@ -94,7 +93,7 @@ jobs: sfp orchestrator:deploy -u dev --skipifalreadyinstalled -g "::group::,::endgroup::" buildAndPublish: - name: 'Build and Publish' + name: 'Build & Publish' runs-on: ubuntu-latest container: ghcr.io/dxatscale/sfpowerscripts needs: deploy @@ -110,7 +109,7 @@ jobs: echo "${{ secrets.DEVHUB_SFDX_AUTH_URL }}" > ./authfile sf org login sfdx-url -f authfile -a devhub - - name: 'Create packages' + - name: 'Build Packages' id: sfpowerscripts-build run: | sfp orchestrator:build -v devhub --diffcheck --branch ${GITHUB_REF#refs/heads/} --buildnumber ${GITHUB_RUN_ID} @@ -126,7 +125,7 @@ jobs: with: registry-url: 'https://npm.pkg.github.com' - - name: Publish + - name: 'Publish Packages' run: | sfp orchestrator:publish -d artifacts --npm --scope @${{ github.repository_owner }} --gittag --pushgittag env: From cfbfe05fa95c662c2f9bb3e20c9aa02cc1dd3881 Mon Sep 17 00:00:00 2001 From: Ruslan Kurchenko Date: Wed, 27 Sep 2023 00:17:51 +0300 Subject: [PATCH 7/8] feat(template): github - Clean commands params - Clean from redundant check - Define a correct concurrency of the build jobs --- .github/workflows/README.md | 38 ++++++++----------- ...ease-build-publish.yml => build-patch.yml} | 21 +++++----- .github/workflows/quickbuild-deploy-build.yml | 37 +++++++++--------- .github/workflows/release.yml | 28 +++++++------- .github/workflows/validate.yml | 10 ++--- 5 files changed, 61 insertions(+), 73 deletions(-) rename .github/workflows/{release-build-publish.yml => build-patch.yml} (89%) diff --git a/.github/workflows/README.md b/.github/workflows/README.md index 4002aa6..b23ae8a 100644 --- a/.github/workflows/README.md +++ b/.github/workflows/README.md @@ -1,49 +1,43 @@ ![image](https://gblobscdn.gitbook.com/assets%2F-MI39dIf1BuKlg_oSIG_%2F-MersLlsLMydZ6V7hfP-%2F-MersUtb9fBk1m9NMuMc%2Fflowdiagram_revised.png?alt=media&token=b613b0a8-99e3-4702-8f38-033cb1d7700d) -This repo contains the follwing YAML based Github Pipeline defintions +This repo contains the following YAML based Github Pipeline definitions -- validate.yml +- validate.yml Pull Request Validation Pipeline, that validates incoming changes against a scratch org fetched from the pool - -- quickbuild-build-deploy.yml - Pipeline that gets triggered on a merge to the trunk (main), resulting in building a set of packages, deploying to a dev sandbox ( and then build a set of validated packages and finally publish that to artifact repository +- quickbuild-deploy-build.yml -- release-build-publish.yml + Pipeline that gets triggered on a merge to the trunk (main), resulting in building a set of packages, deploying to a dev environment and then build a set of validated packages and finally publish that to artifact repository. It also creates a release definition file which concurrency used to deploy a release to desired environment (test, production, etc.) - Triggered on a merge to a release/x branch. Assumes a change has been created/tested in main/dev (quickbuild-build-deploy.yml) and needs to be included in the release via a cherry-pick to the release branch. This builds and publishes off the relase branch making it avialble for the release pipeline. +- build-patch.yml + Triggered on a merge to a release/x branch. Assumes a change has been created/tested in main/dev (quickbuild-deploy-build.yml) and needs to be included in the release via a cherry-pick to the release branch. This builds and publishes off the release branch making it available for the release pipeline. It also creates a release definition file for the patch release. - release.yml - A release pipeline that utilizes the release defintion to fetch artifacts from artifactory and then deploy to a sandbox - + A release pipeline that utilizes the release definition to fetch artifacts from artifactory and then deploy to a desired environment (test, production, etc.) - env-operations - - prepare-ci-poool.yml + - prepare-ci-pool.yml Pipeline to prepare command is used to build scratch org pools for CI purposes - - prepare-dev-poool.yml + - prepare-dev-pool.yml Pipeline to prepare command is used to build scratch org pools for development - + - pool-cleaner.yml - Pipeline to drop the entire pools and facilatate for recreation at end of a day + Pipeline to drop the entire pools and facilitate for recreation at end of a day - delete-scratchorg-pool.yml - Delete a particular scratch org fetched from the pool, to be used where the devs dont have access to delete scratch orgs from command line (Free Developer License) + Delete a particular scratch org fetched from the pool, to be used where the devs dont have access to delete scratch orgs from command line (Free Developer License) -The sample pipelines utilise an azure pipelines variable group called DEVHUB which contains the following variables. As a prerequisite, this has to be setup manually -- DEVHUB_SFDX_AUTH_URL : The auth url to DevHub, You can retrieve the auth URL by following the ling here https://developer.salesforce.com/docs/atlas.en-us.sfdx_cli_reference.meta/sfdx_cli_reference/cli_reference_auth_sfdxurl.htm +The sample pipelines utilize an azure pipelines variable group called DEVHUB which contains the following variables. As a prerequisite, this has to be setup manually - DEV_SFDX_AUTH_URL: The auth url to Developer Sandbox, You can retrieve the auth URL by following the ling here https://developer.salesforce.com/docs/atlas.en-us.sfdx_cli_reference.meta/sfdx_cli_reference/cli_reference_auth_sfdxurl.htm +- TEST_SFDX_AUTH_URL: The auth url to TEST Sandbox, You can retrieve the auth URL by following the ling here https://developer.salesforce.com/docs/atlas.en-us.sfdx_cli_reference.meta/sfdx_cli_reference/cli_reference_auth_sfdxurl.htm -- ST_SFDX_AUTH_URL: The auth url to ST Sandbox, You can retrieve the auth URL by following the ling here https://developer.salesforce.com/docs/atlas.en-us.sfdx_cli_reference.meta/sfdx_cli_reference/cli_reference_auth_sfdxurl.htm - - -- SIT_SFDX_AUTH_URL: The auth url to SIT Sandbox, You can retrieve the auth URL by following the ling here https://developer.salesforce.com/docs/atlas.en-us.sfdx_cli_reference.meta/sfdx_cli_reference/cli_reference_auth_sfdxurl.htm - -- UAT_SFDX_AUTH_URL: The auth url to UAT Sandbox, You can retrieve the auth URL by following the ling here https://developer.salesforce.com/docs/atlas.en-us.sfdx_cli_reference.meta/sfdx_cli_reference/cli_reference_auth_sfdxurl.htm +- DEVHUB_SFDX_AUTH_URL: The auth url to DevHub, You can retrieve the auth URL by following the ling here https://developer.salesforce.com/docs/atlas.en-us.sfdx_cli_reference.meta/sfdx_cli_reference/cli_reference_auth_sfdxurl.htm +- PROD_SFDX_AUTH_URL: The auth url to DevHub, You can retrieve the auth URL by following the ling here https://developer.salesforce.com/docs/atlas.en-us.sfdx_cli_reference.meta/sfdx_cli_reference/cli_reference_auth_sfdxurl.htm \ No newline at end of file diff --git a/.github/workflows/release-build-publish.yml b/.github/workflows/build-patch.yml similarity index 89% rename from .github/workflows/release-build-publish.yml rename to .github/workflows/build-patch.yml index f6e120e..12c8aad 100644 --- a/.github/workflows/release-build-publish.yml +++ b/.github/workflows/build-patch.yml @@ -2,7 +2,7 @@ #---------------------------------------------------------------------------------------------------- # Maintained by @aly76 for DX@Scale # Follows reference pipeline available at docs.dxatscale.io -# +# #----------------------------------------------------------------------------------------------------- # To know more about dxatscale, visit https://docs.dxatscale.io # To know more on sfpowerscripts, visit- https://sfpowerscripts.dxatscale.io/ @@ -10,7 +10,7 @@ # This pipeline builds on a release branch. Assumes you've cherry-picked a fix from master (thats been tested in DEV etc). Makes the change available for release -name: 'CI Pipeline - Release Build - Auto Triggered' +name: 'CI - Build Patch' on: @@ -35,11 +35,10 @@ on: jobs: buildAndPublish: - name: 'Build and Publish' + name: 'Build & Publish' runs-on: ubuntu-latest container: ghcr.io/dxatscale/sfpowerscripts - concurrency: build - if: contains(github.ref,'release') || github.ref == 'refs/heads/release/**' + concurrency: build-patch steps: - uses: actions/checkout@v2 with: @@ -50,7 +49,7 @@ jobs: echo "${{ secrets.DEVHUB_SFDX_AUTH_URL }}" > ./authfile sf org login sfdx-url -f authfile -a devhub - - name: 'Create packages' + - name: 'Create Packages' id: sfpowerscripts-build run: | sfp orchestrator:build -v devhub --diffcheck --branch ${GITHUB_REF#refs/heads/} --buildnumber ${GITHUB_RUN_ID} @@ -67,7 +66,7 @@ jobs: registry-url: 'https://npm.pkg.github.com' scope: '@${{ github.repository_owner }}' - - name: Publish + - name: 'Publish Packages' run: | sfp orchestrator:publish -d artifacts --npm --scope @${{ github.repository_owner }} --gittag --pushgittag env: @@ -76,12 +75,12 @@ jobs: - name: 'Define Release' run: | RELEASE_NAME=${GITHUB_RUN_ID} - if [ "$RELEASE_NAME_PREFIX" != "" ]; then RELEASE_NAME="${RELEASE_NAME_PREFIX}-${GITHUB_RUN_ID}"; fi - + if [ "$RELEASE_NAME_PREFIX" != "" ]; then RELEASE_NAME="${RELEASE_NAME_PREFIX}-${GITHUB_RUN_ID}"; fi + TARGET_BRANCH="release-definition" if [ "$RELEASE_DEF_TARGET_BRANCH" != "" ]; then TARGET_BRANCH="$RELEASE_DEF_TARGET_BRANCH"; fi - + git tag -a $RELEASE_NAME -m "$RELEASE_NAME" git push origin $RELEASE_NAME - + sfp releasedefinition:generate --branchname "$TARGET_BRANCH_BANE" --gitref "$RELEASE_NAME" --configfile release-config/config.yml --releasename "$RELEASE_NAME" diff --git a/.github/workflows/quickbuild-deploy-build.yml b/.github/workflows/quickbuild-deploy-build.yml index 0a74c76..94e9280 100644 --- a/.github/workflows/quickbuild-deploy-build.yml +++ b/.github/workflows/quickbuild-deploy-build.yml @@ -1,14 +1,14 @@ # DX@Scale CI/CD Template for GitHub #---------------------------------------------------------------------------------------------------- # Follows reference pipeline available at docs.dxatscale.io -# +# #----------------------------------------------------------------------------------------------------- # To know more about dxatscale, visit https://docs.dxatscale.io # To know more on sfpowerscripts, visit- https://sfpowerscripts.dxatscale.io/ # This pipeline quickbuilds, deploy to DEV, builds and publishes packages to artifact repository and creates a release definition -name: 'build' +name: 'CI - Build' on: @@ -36,7 +36,6 @@ jobs: name: 'Quickbuild Packages' runs-on: ubuntu-latest container: ghcr.io/dxatscale/sfpowerscripts - if: github.ref == 'refs/heads/main' steps: - uses: actions/checkout@v2 with: @@ -45,12 +44,12 @@ jobs: - name: 'Authenticate Dev Hub' run: | echo "${{ secrets.DEVHUB_SFDX_AUTH_URL }}" > ./authfile - sf org login sfdx-url -f authfile -a devhub + sf org login sfdx-url --sfdx-url-file authfile --alias devhub - name: 'Create Packages' id: sfpowerscripts-build run: | - sfp orchestrator:quickbuild -v devhub --diffcheck --buildnumber ${GITHUB_RUN_ID} --branch ${GITHUB_REF#refs/heads/} + sfp orchestrator:quickbuild --devhubalias devhub --diffcheck --buildnumber ${GITHUB_RUN_ID} --branch ${GITHUB_REF#refs/heads/} # Publish artifacts - uses: actions/upload-artifact@v2 @@ -63,7 +62,6 @@ jobs: runs-on: ubuntu-latest container: ghcr.io/dxatscale/sfpowerscripts needs: quickbuild - if: github.ref == 'refs/heads/main' environment: name: DEV concurrency: dev @@ -75,30 +73,29 @@ jobs: - uses: actions/download-artifact@v2 with: name: quickbuild-artifacts - path: artifacts + path: artifacts - name: 'Authenticate Dev Hub' run: | echo "${{ secrets.DEVHUB_SFDX_AUTH_URL }}" > ./authfile - sf org login sfdx-url -f authfile -a devhub + sf org login sfdx-url --sfdx-url-file ./authfile -a devhub - name: Authenticate to DEV sandbox run: | echo "${{ secrets.DEV_SFDX_AUTH_URL }}" > ./dev_authfile - sf org login sfdx-url -f ./dev_authfile -a dev + sf org login sfdx-url --sfdx-url-file ./dev_authfile --alias dev - name: 'Deploy to DEV' run: | - sfp dependency:install -u dev -v devhub - sfp orchestrator:deploy -u dev --skipifalreadyinstalled -g "::group::,::endgroup::" + sfp dependency:install --targetusername dev --targetdevhubusername devhub + sfp orchestrator:deploy --targetorg dev --skipifalreadyinstalled -g "::group::,::endgroup::" buildAndPublish: name: 'Build & Publish' runs-on: ubuntu-latest container: ghcr.io/dxatscale/sfpowerscripts needs: deploy - concurrency: build - if: github.ref == 'refs/heads/main' + concurrency: build steps: - uses: actions/checkout@v2 with: @@ -107,12 +104,12 @@ jobs: - name: 'Authenticate Dev Hub' run: | echo "${{ secrets.DEVHUB_SFDX_AUTH_URL }}" > ./authfile - sf org login sfdx-url -f authfile -a devhub + sf org login sfdx-url --sfdx-url-file authfile --alias devhub - name: 'Build Packages' id: sfpowerscripts-build run: | - sfp orchestrator:build -v devhub --diffcheck --branch ${GITHUB_REF#refs/heads/} --buildnumber ${GITHUB_RUN_ID} + sfp orchestrator:build --devhubalias devhub --diffcheck --branch ${GITHUB_REF#refs/heads/} --buildnumber ${GITHUB_RUN_ID} # Publish artifacts - uses: actions/upload-artifact@v2 @@ -127,19 +124,19 @@ jobs: - name: 'Publish Packages' run: | - sfp orchestrator:publish -d artifacts --npm --scope @${{ github.repository_owner }} --gittag --pushgittag + sfp orchestrator:publish --artifactdir artifacts --npm --scope @${{ github.repository_owner }} --gittag --pushgittag env: NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }} - name: 'Define Release' run: | RELEASE_NAME=${GITHUB_RUN_ID} - if [ "$RELEASE_NAME_PREFIX" != "" ]; then RELEASE_NAME="${RELEASE_NAME_PREFIX}-${GITHUB_RUN_ID}"; fi - + if [ "$RELEASE_NAME_PREFIX" != "" ]; then RELEASE_NAME="${RELEASE_NAME_PREFIX}-${GITHUB_RUN_ID}"; fi + TARGET_BRANCH="release-definition" if [ "$RELEASE_DEF_TARGET_BRANCH" != "" ]; then TARGET_BRANCH="$RELEASE_DEF_TARGET_BRANCH"; fi - + git tag -a $RELEASE_NAME -m "$RELEASE_NAME" git push origin $RELEASE_NAME - + sfp releasedefinition:generate --branchname "$TARGET_BRANCH_BANE" --gitref "$RELEASE_NAME" --configfile release-config/config.yml --releasename "$RELEASE_NAME" diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 053e394..7c818cc 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -2,7 +2,7 @@ #---------------------------------------------------------------------------------------------------- # Maintained by @aly76 for DX@Scale # Follows reference pipeline available at docs.dxatscale.io -# +# #----------------------------------------------------------------------------------------------------- # To know more about dxatscale, visit - https://docs.dxatscale.io # To know more on sfpowerscripts, visit - https://sfpowerscripts.dxatscale.io/ @@ -11,7 +11,7 @@ # This pipeline is used to release a set of packages into respective environments # Changelog will be written to changelog branch -name: 'release' +name: 'CD - Release' on: @@ -28,7 +28,7 @@ on: # Set the environment variables #---------------------------------------------------------------------------------------------------- # Authentication: -# - STAGING_SFDX_AUTH_URL +# - TEST_SFDX_AUTH_URL # - PROD_SFDX_AUTH_URL #----------------------------------------------------------------------------------------------------- # Tracking Metrics: @@ -40,23 +40,23 @@ on: jobs: - STAGING: + TEST: runs-on: ubuntu-latest container: ghcr.io/dxatscale/sfpowerscripts if: github.ref == 'refs/heads/main' || contains(github.ref,'refs/heads/release') environment: - name: STAGING + name: TEST steps: - uses: actions/checkout@v2 with: fetch-depth: 0 - - - name: Authenticate to STAGING environment + + - name: Authenticate to TEST environment run: | - echo "${{ secrets.STAGING_SFDX_AUTH_URL }}" > ./authfile - sf org login sfdx-url -f ./authfile -a sit + echo "${{ secrets.TEST_SFDX_AUTH_URL }}" > ./authfile + sf org login sfdx-url --sfdx-url-file ./authfile --alias test # Authenticate to npm - uses: actions/setup-node@v3 @@ -65,10 +65,10 @@ jobs: # Release to environment - - name: Release to STAGING + - name: Release to TEST run: | git checkout ${{ github.event.inputs.releaseDefBranch }} - sfp orchestrator:release -u sit -p ${{ github.event.inputs.pathToReleaseDef }} --npm --scope ${{ github.repository_owner }} --generatechangelog --branchname changelog -g "::group::,::endgroup::" + sfp orchestrator:release --targetorg test --releasedefinition ${{ github.event.inputs.pathToReleaseDef }} --npm --scope ${{ github.repository_owner }} --generatechangelog --branchname changelog -g "::group::,::endgroup::" env: NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }} @@ -89,8 +89,8 @@ jobs: - name: Authenticate to PROD run: | echo "${{ secrets.PROD_SFDX_AUTH_URL }}" > ./authfile - sf org login sfdx-url -f ./authfile -a prod - + sf org login sfdx-url --sfdx-url-file ./authfile --alias prod + # Authenticate to npm - uses: actions/setup-node@v3 @@ -102,6 +102,6 @@ jobs: - name: Release to PROD run: | git checkout ${{ github.event.inputs.releaseDefBranch }} - sfp orchestrator:release -u prod -p ${{ github.event.inputs.pathToReleaseDef }} --npm --scope ${{ github.repository_owner }} --generatechangelog --branchname changelog -g "::group::,::endgroup::" + sfp orchestrator:release --targetorg prod --releasedefinition ${{ github.event.inputs.pathToReleaseDef }} --npm --scope ${{ github.repository_owner }} --generatechangelog --branchname changelog -g "::group::,::endgroup::" env: NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }} \ No newline at end of file diff --git a/.github/workflows/validate.yml b/.github/workflows/validate.yml index fa75d46..a677224 100644 --- a/.github/workflows/validate.yml +++ b/.github/workflows/validate.yml @@ -1,7 +1,7 @@ # DX@Scale CI/CD Template for GitHub #---------------------------------------------------------------------------------------------------- # Follows reference pipeline available at docs.dxatscale.io -# +# #----------------------------------------------------------------------------------------------------- # To know more about dxatscale, visit https://docs.dxatscale.io # To know more on sfpowerscripts, visit- https://sfpowerscripts.dxatscale.io/ @@ -10,7 +10,7 @@ # This pipeline is used to validate an incoming change using a dev environment fetched from the CI pool -name: 'PR Validation - Auto Triggered' +name: 'CI - Validate' on: pull_request: @@ -30,8 +30,6 @@ on: #SFPOWERSCRIPTS_DATADOG_HOST: '${{ secrets.DATADOG_HOST }}' #SFPOWERSCRIPTS_DATADOG_API_KEY: '${{ secrets.DATADOG_API_KEY }}' - - jobs: validate: name: 'Validate Changed Packages' @@ -46,13 +44,13 @@ jobs: - name: 'Authenticate Dev Hub' run: | echo "${{ secrets.DEVHUB_SFDX_AUTH_URL }}" > ./authfile - sf org login sfdx-url -f authfile -a devhub + sf org login sfdx-url --sfdx-url-file authfile --alias devhub # Validate source and trigger test - name: 'Push source to scratch org' - run: 'sfp orchestrator:validate -p ci -v devhub -x' + run: 'sfp orchestrator:validate --pools ci --targetdevhubusername devhub --deletescratchorg' From 6f0f2b5ca23875ddb2b4d1f05c3f6bea0f261b8f Mon Sep 17 00:00:00 2001 From: Ruslan Kurchenko Date: Sat, 7 Oct 2023 00:45:40 +0300 Subject: [PATCH 8/8] feat(template): github - Restructure jobs - Naming convention - Create pools without replenishing - Use latest checkout@v4 --- .github/workflows/build-patch.yml | 2 +- ...env-operations-delete-pool-scratchorg.yml} | 2 +- .../workflows/env-operations-pool-cleaner.yml | 71 ------------------- .../env-operations-prepare-ci-pool.yml | 16 +++-- .../env-operations-prepare-dev-pool.yml | 14 ++-- .../env-operations-publish-pool-metrics.yml | 2 +- .github/workflows/quickbuild-deploy-build.yml | 8 +-- .github/workflows/release.yml | 9 ++- .github/workflows/validate.yml | 2 +- 9 files changed, 29 insertions(+), 97 deletions(-) rename .github/workflows/{env-operations-delete-scratchorg-pool.yml => env-operations-delete-pool-scratchorg.yml} (97%) delete mode 100644 .github/workflows/env-operations-pool-cleaner.yml diff --git a/.github/workflows/build-patch.yml b/.github/workflows/build-patch.yml index 12c8aad..41a81b8 100644 --- a/.github/workflows/build-patch.yml +++ b/.github/workflows/build-patch.yml @@ -40,7 +40,7 @@ jobs: container: ghcr.io/dxatscale/sfpowerscripts concurrency: build-patch steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 with: fetch-depth: 0 diff --git a/.github/workflows/env-operations-delete-scratchorg-pool.yml b/.github/workflows/env-operations-delete-pool-scratchorg.yml similarity index 97% rename from .github/workflows/env-operations-delete-scratchorg-pool.yml rename to .github/workflows/env-operations-delete-pool-scratchorg.yml index 237b867..80453cb 100644 --- a/.github/workflows/env-operations-delete-scratchorg-pool.yml +++ b/.github/workflows/env-operations-delete-pool-scratchorg.yml @@ -9,7 +9,7 @@ # Return an used scratch org back to the pool for replenishment -name: 'Scratch Org Recycler - User Triggered' +name: 'ENV - Delete Scratch Org' on: workflow_dispatch: diff --git a/.github/workflows/env-operations-pool-cleaner.yml b/.github/workflows/env-operations-pool-cleaner.yml deleted file mode 100644 index 8e4f94b..0000000 --- a/.github/workflows/env-operations-pool-cleaner.yml +++ /dev/null @@ -1,71 +0,0 @@ -# DX@Scale CI/CD Template for GitHub -#---------------------------------------------------------------------------------------------------- -# Follows reference pipeline available at docs.dxatscale.io -# -#----------------------------------------------------------------------------------------------------- -# To know more about dxatscale, visit https://docs.dxatscale.io -# To know more on sfpowerscripts, visit- https://sfpowerscripts.dxatscale.io/ -# To know more on sfpowerkit, visit- https://github.com/Accenture/sfpowerkit - - -# This pipeline deletes all the scratch orgs from the pool on a set time, so that pools can be recreated with new artifacts - -name: 'Scratch Org Pool Cleaner - Auto Scheduled' - -on: - workflow_dispatch: - schedule: - - cron: '0 13 * * *' - - - -#Set the environment variables for tracking metrics -#env: - #SFPOWERSCRIPTS_NEWRELIC: 'true' - #SFPOWERSCRIPTS_NEWRELIC_API_KEY: '${{ secrets.NEWRELIC_INSIGHT_INSERT_KEYS }}' - #SFPOWERSCRIPTS_DATADOG: 'true' - #SFPOWERSCRIPTS_DATADOG_HOST: '${{ secrets.DATADOG_HOST }}' - #SFPOWERSCRIPTS_DATADOG_API_KEY: '${{ secrets.DATADOG_API_KEY }}' - - - -jobs: - - clean-pool-dev: - name: 'Clean Dev Pool' - runs-on: ubuntu-latest - container: ghcr.io/dxatscale/sfpowerscripts - - steps: - - - uses: actions/checkout@v2 - - - - name: 'Authenticate Dev Hub' - run: | - echo "${{ secrets.DEVHUB_SFDX_AUTH_URL }}" > ./authfile - sf org login sfdx-url -f authfile -a devhub - - - - name: 'Drop the pool' - run: 'sfp pool:delete -t dev -v devhub' - - clean-pool-ci: - name: 'Clean CI Pool' - runs-on: ubuntu-latest - container: ghcr.io/dxatscale/sfpowerscripts - - - steps: - - - uses: actions/checkout@v2 - - - - name: 'Authenticate Dev Hub' - run: | - echo "${{ secrets.DEVHUB_SFDX_AUTH_URL }}" > ./authfile - sf org login sfdx-url -f authfile -a devhub - - - - name: 'Drop the pool' - run: 'sfp pool:delete -t ci -v devhub -a' diff --git a/.github/workflows/env-operations-prepare-ci-pool.yml b/.github/workflows/env-operations-prepare-ci-pool.yml index 3e2d5da..c397b16 100644 --- a/.github/workflows/env-operations-prepare-ci-pool.yml +++ b/.github/workflows/env-operations-prepare-ci-pool.yml @@ -11,13 +11,13 @@ # This pipeline creates the CI pools used during validate -name: 'Replenish CI Pools - Auto Triggered' +name: 'Pool - Create - CI' on: workflow_dispatch: inputs: gitRef: - description: "Commit Id from where the pools should be created" + description: "Commit SHA from where the pools should be created" required: false default: 'main' schedule: @@ -38,14 +38,14 @@ on: jobs: pool-ci-pool: - name: 'Replenish CI Pool' + name: 'Create CI Pool' runs-on: ubuntu-latest container: ghcr.io/dxatscale/sfpowerscripts timeout-minutes: 720 #Set to Maximum Time out steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 with: ref: ${{ github.event.inputs.gitRef }} fetch-depth: 0 @@ -61,15 +61,17 @@ jobs: with: registry-url: 'https://npm.pkg.github.com' + - name: 'Drop the pool if exists' + run: 'sfp pool:delete -t ci -v devhub -a' + - name: 'Prepare a pool of scratch orgs' run: 'sfp orchestrator:prepare -f config/project-ci-pool-def.json -v devhub' env: NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }} - + # Publish artifacts - uses: actions/upload-artifact@v2 if: ${{ always() }} with: name: scratchorg-logs-pool-ci - path: .sfpowerscripts/prepare_logs - + path: .sfpowerscripts/prepare_logs \ No newline at end of file diff --git a/.github/workflows/env-operations-prepare-dev-pool.yml b/.github/workflows/env-operations-prepare-dev-pool.yml index e12649c..b7763b0 100644 --- a/.github/workflows/env-operations-prepare-dev-pool.yml +++ b/.github/workflows/env-operations-prepare-dev-pool.yml @@ -9,13 +9,13 @@ # This pipeline creates the DEV pools -name: 'Replenish DEV Pools - Auto Triggered' +name: 'Pool - Create - DEV' on: workflow_dispatch: inputs: gitRef: - description: "Commit Id from where the pools should be created" + description: "Commit SHA from where the pools should be created" required: false default: 'main' schedule: @@ -35,13 +35,13 @@ on: jobs: pool: - name: 'Replenish Dev Pool' + name: 'Create DEV Pool' runs-on: ubuntu-latest container: ghcr.io/dxatscale/sfpowerscripts timeout-minutes: 720 #Set to Maximum Time out steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 with: ref: ${{ github.event.inputs.gitRef }} fetch-depth: 0 @@ -57,6 +57,9 @@ jobs: with: registry-url: 'https://npm.pkg.github.com' + - name: 'Drop the pool if exists' + run: 'sfp pool:delete -t dev -v devhub -a' + - name: 'Prepare a pool of scratch orgs' run: 'sfp orchestrator:prepare -f config/project-dev-pool-def.json -v devhub' env: @@ -67,5 +70,4 @@ jobs: if: ${{ always() }} with: name: scratchorg-logs-pool-ci - path: .sfpowerscripts/prepare_logs - + path: .sfpowerscripts/prepare_logs \ No newline at end of file diff --git a/.github/workflows/env-operations-publish-pool-metrics.yml b/.github/workflows/env-operations-publish-pool-metrics.yml index 477bfb2..2ff8fb1 100644 --- a/.github/workflows/env-operations-publish-pool-metrics.yml +++ b/.github/workflows/env-operations-publish-pool-metrics.yml @@ -9,7 +9,7 @@ # This pipeline publishes metrics about scratch orgs to Monitoring tool every 30 minutes -name: 'Publish Metrics for Scratch Org Pools' +name: 'Pool - Publish Metrics' on: workflow_dispatch: diff --git a/.github/workflows/quickbuild-deploy-build.yml b/.github/workflows/quickbuild-deploy-build.yml index 94e9280..aaf70a0 100644 --- a/.github/workflows/quickbuild-deploy-build.yml +++ b/.github/workflows/quickbuild-deploy-build.yml @@ -37,7 +37,7 @@ jobs: runs-on: ubuntu-latest container: ghcr.io/dxatscale/sfpowerscripts steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 with: fetch-depth: 0 @@ -66,7 +66,7 @@ jobs: name: DEV concurrency: dev steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 with: fetch-depth: 0 @@ -97,7 +97,7 @@ jobs: needs: deploy concurrency: build steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 with: fetch-depth: 0 @@ -139,4 +139,4 @@ jobs: git tag -a $RELEASE_NAME -m "$RELEASE_NAME" git push origin $RELEASE_NAME - sfp releasedefinition:generate --branchname "$TARGET_BRANCH_BANE" --gitref "$RELEASE_NAME" --configfile release-config/config.yml --releasename "$RELEASE_NAME" + sfp releasedefinition:generate --branchname "$TARGET_BRANCH_BANE" --gitref "$RELEASE_NAME" --configfile release-config/config.yml --releasename "$RELEASE_NAME" --directory "release-definitions" diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 7c818cc..be55c75 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -48,9 +48,10 @@ jobs: name: TEST steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 with: fetch-depth: 0 + ref: ${{ github.event.inputs.releaseDefBranch }} - name: Authenticate to TEST environment @@ -67,7 +68,6 @@ jobs: # Release to environment - name: Release to TEST run: | - git checkout ${{ github.event.inputs.releaseDefBranch }} sfp orchestrator:release --targetorg test --releasedefinition ${{ github.event.inputs.pathToReleaseDef }} --npm --scope ${{ github.repository_owner }} --generatechangelog --branchname changelog -g "::group::,::endgroup::" env: NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }} @@ -81,10 +81,10 @@ jobs: name: PROD steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 with: fetch-depth: 0 - + ref: ${{ github.event.inputs.releaseDefBranch }} - name: Authenticate to PROD run: | @@ -101,7 +101,6 @@ jobs: # Release to environment - name: Release to PROD run: | - git checkout ${{ github.event.inputs.releaseDefBranch }} sfp orchestrator:release --targetorg prod --releasedefinition ${{ github.event.inputs.pathToReleaseDef }} --npm --scope ${{ github.repository_owner }} --generatechangelog --branchname changelog -g "::group::,::endgroup::" env: NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }} \ No newline at end of file diff --git a/.github/workflows/validate.yml b/.github/workflows/validate.yml index a677224..5e7ef21 100644 --- a/.github/workflows/validate.yml +++ b/.github/workflows/validate.yml @@ -37,7 +37,7 @@ jobs: container: ghcr.io/dxatscale/sfpowerscripts steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 with: fetch-depth: 0