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 875fb98..0000000 --- a/.github/workflows/beta_release.yml +++ /dev/null @@ -1,97 +0,0 @@ -name: beta release - -on: - workflow_dispatch: - inputs: - versionName: - description: 'Name of release (e.g., Spring)' - required: true - - -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_URL}} > ./DEV_HUB_AUTH_URL.txt - secretFileSize=$(wc -c "./DEV_HUB_AUTH_URL.txt" | awk '{print $1}') - if [ $secretFileSize == 1 ]; then - echo "Missing DEV_HUB_AUTH_URL 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_URL.txt -a devhub -d - - # Remove auth file - - name: 'Remove auth file' - run: rm -f ./DEV_HUB_AUTH_URL.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 -a ${{ github.event.inputs.versionName}} -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 "packageVersionId=$packageVersionId" >> $GITHUB_OUTPUT - 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 - - # Pull Request commit generated Package Id in sfdx-package.json file. - - name: Create Pull Request - id: create-pr - uses: peter-evans/create-pull-request@v6 - with: - title: 'Bump package version to ${{ steps.createPackageVersion.outputs.packageVersionId }}' - body: | - This pull request updates the package version to ${{ steps.createPackageVersion.outputs.packageVersionId }}. - branch: 'bump-package-version-${{ steps.createPackageVersion.outputs.packageVersionId }}' - commit-message: 'chore: bump package version to ${{ steps.createPackageVersion.outputs.packageVersionId }}' - labels: 'dependencies, automated pr' - token: ${{ secrets.GITHUB_TOKEN }} - - # Approve and mark PR for auto merge - - name: 'Approve and mark PR for auto merge' - run: | - gh pr review --approve "$PR_NUMBER" - gh pr merge --admin --auto --squash --delete-branch "$PR_NUMBER" - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - PR_NUMBER: ${{ steps.create-pr.outputs.pull-request-number }} \ 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 8468961..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_URL secret' - shell: bash - run: | - echo ${{ secrets.DEV_HUB_AUTH_URL}} > ./DEV_HUB_AUTH_URL.txt - secretFileSize=$(wc -c "./DEV_HUB_AUTH_URL.txt" | awk '{print $1}') - if [ $secretFileSize == 1 ]; then - echo "Missing DEV_HUB_AUTH_URL 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_URL.txt -a devhub -d - - # Remove auth file - - name: 'Remove auth file' - run: rm -f ./DEV_HUB_AUTH_URL.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 8da8896..4f5dd83 100644 --- a/sfdx-project.json +++ b/sfdx-project.json @@ -13,4 +13,4 @@ "name": "Grants Content Kit", "sfdcLoginUrl": "https://login.salesforce.com", "sourceApiVersion": "54.0" -} \ No newline at end of file +}