From c1321664df27a9b3c4d366757fa426e6f73269e7 Mon Sep 17 00:00:00 2001 From: James Estevez Date: Fri, 14 Jun 2024 18:25:15 -0700 Subject: [PATCH] Production Onboarding --- .github/CODEOWNERS | 10 ++++ .github/workflows/beta-2gp.yml | 10 ++++ .github/workflows/beta_release.yml | 73 ----------------------------- .github/workflows/feature.yml | 12 +++++ .github/workflows/feature_build.yml | 63 ------------------------- .github/workflows/prod.yml | 8 ++++ sfdx-project.json | 19 +------- 7 files changed, 42 insertions(+), 153 deletions(-) create mode 100644 .github/CODEOWNERS create mode 100644 .github/workflows/beta-2gp.yml delete mode 100644 .github/workflows/beta_release.yml create mode 100644 .github/workflows/feature.yml delete mode 100644 .github/workflows/feature_build.yml create mode 100644 .github/workflows/prod.yml diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS new file mode 100644 index 0000000..54c05cd --- /dev/null +++ b/.github/CODEOWNERS @@ -0,0 +1,10 @@ +# Python +*.py @SFDO-Community/sfdo-release-engineers + +# CumulusCI +/cumulusci.yml @SFDO-Community/sfdo-release-engineers +/tasks/ @SFDO-Community/sfdo-release-engineers + +# Actions +/.github @SFDO-Community/sfdo-release-engineers +/scripts @SFDO-Community/sfdo-release-engineers \ No newline at end of file diff --git a/.github/workflows/beta-2gp.yml b/.github/workflows/beta-2gp.yml new file mode 100644 index 0000000..f0fa3ac --- /dev/null +++ b/.github/workflows/beta-2gp.yml @@ -0,0 +1,10 @@ +name: Upload Beta Release (2GP) +on: + push: + branches: + - 'main' +jobs: + upload-beta: + uses: SFDO-Community/standard-workflows/.github/workflows/beta-2gp.yml@main + secrets: + dev-hub-auth-url: '${{ secrets.PACKAGING_ORG_AUTH_URL }}' \ No newline at end of file diff --git a/.github/workflows/beta_release.yml b/.github/workflows/beta_release.yml deleted file mode 100644 index 3fbef48..0000000 --- a/.github/workflows/beta_release.yml +++ /dev/null @@ -1,73 +0,0 @@ -name: beta release - -on: - workflow_dispatch: - -env: - CUMULUSCI_KEYCHAIN_CLASS: cumulusci.core.keychain.EnvironmentProjectKeychain - CUMULUSCI_SERVICE_github: ${{ secrets.CUMULUSCI_SERVICE_GITHUB }} -jobs: - unit_tests: - name: "Run Beta release" - runs-on: ubuntu-latest - steps: - # Install Salesforce CLI - - name: 'Install Salesforce CLI' - run: | - npm install @salesforce/cli --location=global - nodeInstallPath=$(npm config get prefix) - echo "$nodeInstallPath/bin" >> $GITHUB_PATH - sf --version - - # Checkout the source code - - name: 'Checkout source code' - uses: actions/checkout@v4 - - # Store secret for dev hub - - name: 'Populate auth file with DEV_HUB_AUTH secret' - shell: bash - run: | - echo ${{ secrets.DEV_HUB_AUTH}} > ./DEV_HUB_AUTH.txt - secretFileSize=$(wc -c "./DEV_HUB_AUTH.txt" | awk '{print $1}') - if [ $secretFileSize == 1 ]; then - echo "Missing DEV_HUB_AUTH secret. Is this workflow running on a fork?"; - exit 1; - fi - - # Authenticate dev hub - - name: 'Authenticate Dev Hub' - run: sf org login sfdx-url -f ./DEV_HUB_AUTH.txt -a devhub -d - - # Remove auth file - - name: 'Remove auth file' - run: rm -f ./DEV_HUB_AUTH.txt - - #Create Package Version - - name: "Create package version" - id: createPackageVersion - run: | - set +e - json=$(sf package version create -p "Grants Content Kit" -x -f config/project-scratch-def.json -w 10 -b main -c --json) - echo $json - status=$(echo $json | jq '.status') - if [ $status == "0" ]; then - packageVersionId=$(echo $json | jq -r '.result.SubscriberPackageVersionId') - echo "::set-output name=packageVersionId::$packageVersionId" - else - echo "sf package creation failed" - fi - exit $status - - # Wait for package replication - - name: 'Wait for package replication' - run: sleep 360s - - # Create scratch org - - name: 'Create scratch org' - run: sf org create scratch -f config/project-scratch-def.json -a scratch-org -d -y 1 - # Install new package in scratch org - - name: 'Install new package version in scratch org' - run: sf package install -p ${{ steps.createPackageVersion.outputs.packageVersionId }} -w 10 -o scratch-org -r - # Housekeeping - - name: 'Delete scratch org' - run: sf org delete scratch -p -o scratch-org \ No newline at end of file diff --git a/.github/workflows/feature.yml b/.github/workflows/feature.yml new file mode 100644 index 0000000..484971a --- /dev/null +++ b/.github/workflows/feature.yml @@ -0,0 +1,12 @@ +name: "Feature Test" +on: + push: + branches: + - feature/** + +jobs: + feature-test: + name: "Feature Test" + uses: "SFDO-Community/standard-workflows/.github/workflows/feature.yml@main" + secrets: + dev-hub-auth-url: "${{ secrets.DEV_HUB_AUTH_URL }}" \ No newline at end of file diff --git a/.github/workflows/feature_build.yml b/.github/workflows/feature_build.yml deleted file mode 100644 index 94402e5..0000000 --- a/.github/workflows/feature_build.yml +++ /dev/null @@ -1,63 +0,0 @@ -name: Feature Build - -on: - push: - branches: - - '**' - - '!main' - paths-ignore: - - 'docs/**' - - 'README.md' -env: - CUMULUSCI_KEYCHAIN_CLASS: cumulusci.core.keychain.EnvironmentProjectKeychain - CUMULUSCI_SERVICE_github: ${{ secrets.CUMULUSCI_SERVICE_GITHUB }} -jobs: - unit_tests: - name: 'Deploy Code and Run Apex Tests' - runs-on: Ubuntu-latest - steps: - # Install Salesforce CLI - - name: 'Install Salesforce CLI' - run: | - npm install @salesforce/cli --location=global - nodeInstallPath=$(npm config get prefix) - echo "$nodeInstallPath/bin" >> $GITHUB_PATH - sf --version - - # Checkout the source code - - name: 'Checkout source code' - uses: actions/checkout@v4 - - # Store secret for dev hub - - name: 'Populate auth file with DEV_HUB_AUTH secret' - shell: bash - run: | - echo ${{ secrets.DEV_HUB_AUTH}} > ./DEV_HUB_AUTH.txt - secretFileSize=$(wc -c "./DEV_HUB_AUTH.txt" | awk '{print $1}') - if [ $secretFileSize == 1 ]; then - echo "Missing DEV_HUB_AUTH secret. Is this workflow running on a fork?"; - exit 1; - fi - - # Authenticate dev hub - - name: 'Authenticate Dev Hub' - run: sf org login sfdx-url -f ./DEV_HUB_AUTH.txt -a devhub -d - - # Remove auth file - - name: 'Remove auth file' - run: rm -f ./DEV_HUB_AUTH.txt - - # Install Python - - name: Set up Python - uses: actions/setup-python@v5 - with: - python-version: '3.10' - #Install CumulusCI - - name: Install CumulusCI - run: | - python -m pip install -U pip - pip install cumulusci - #Use CCI to deploy and test feature - - name: Deploy and Run Tests - run: | - cci flow run ci_feature --org dev --delete-org \ No newline at end of file diff --git a/.github/workflows/prod.yml b/.github/workflows/prod.yml new file mode 100644 index 0000000..a897def --- /dev/null +++ b/.github/workflows/prod.yml @@ -0,0 +1,8 @@ +on: + workflow_dispatch: +jobs: + upload-production-release-2gp: + name: "Upload Production Release (2GP)" + uses: SFDO-Community/standard-workflows/.github/workflows/production-2gp.yml@main + secrets: + dev-hub-auth-url: '${{ secrets.PACKAGING_ORG_AUTH_URL }}' \ No newline at end of file diff --git a/sfdx-project.json b/sfdx-project.json index 3541dee..cc6fb94 100644 --- a/sfdx-project.json +++ b/sfdx-project.json @@ -3,9 +3,6 @@ { "path": "force-app", "default": true, - "package": "Grants Content Kit", - "versionName": "Winter 24", - "versionNumber": "2.1.0.NEXT", "apexTestAccess": { "permissionSets": [ "GGW_User_Permissions" @@ -16,17 +13,5 @@ "name": "Grants Content Kit", "namespace": "", "sfdcLoginUrl": "https://login.salesforce.com", - "sourceApiVersion": "54.0", - "packageAliases": { - "Grants Content Kit": "0Ho8a000000fxV5CAI", - "Grants Content Kit@0.1.0-1": "04t8a000001aJXYAA2", - "Grants Content Kit@0.1.0-2": "04t8a000001aJYWAA2", - "Grants Content Kit@0.1.0-3-main": "04t8a000001B8qcAAC", - "Grants Content Kit@0.1.0-4-main": "04t8a000001B8qhAAC", - "Grants Content Kit@0.1.0-5-main": "04t8a000001B8qmAAC", - "Grants Content Kit@1.0.0-1-main": "04t8a000001B8qrAAC", - "Grants Content Kit@1.0.0-2-main": "04t8a000001B8vnAAC", - "Grants Content Kit@2.0.0-1-main": "04t8a000001B8vsAAC", - "Grants Content Kit@2.1.0-1-main": "04t8a000000qq4HAAQ" - } -} \ No newline at end of file + "sourceApiVersion": "54.0" +}