Skip to content

Commit

Permalink
Set up cumulusci-next-snapshots tag with refactored 2gp feature, beta…
Browse files Browse the repository at this point in the history
…, and release flows
  • Loading branch information
jlantz committed Sep 20, 2024
1 parent 17494f7 commit 8e77c99
Show file tree
Hide file tree
Showing 18 changed files with 717 additions and 369 deletions.
145 changes: 130 additions & 15 deletions .github/workflows/beta-test-2gp.yml
Original file line number Diff line number Diff line change
@@ -1,28 +1,68 @@
name: Beta Test 2GP

on:
workflow_call:
secrets:
dev-hub-auth-url:
required: true
gh-email:
required: true
github-token:
required: true
workflow_call:
inputs:
debug:
description: "Enable debug logging output for CumulusCI"
required: false
default: false
type: boolean
package_version_id:
description: "The 04t ID of the package version to promote. if not provided, the latest beta package version will be promoted."
required: false
type: string
snapshot_name:
description: If provided, a snapshot will be created with this name after the post-install configuration is complete.
required: true
type: string
default: Beta
create_snapshot_commit_status:
required: false
default: true
description: "If true, a commit status will be set for the build. This is useful for tracking the status of the snapshot creation task."
type: boolean
create_snapshot_environment:
required: false
default: false
description: "If true, a GitHub Environment will be created for the snapshot."
type: boolean
secrets:
dev-hub-auth-url:
required: false
dev-hub-username:
required: false
dev-hub-client-id:
required: false
dev-hub-private-key:
required: false
gh-email:
required: true
github-token:
required: true
github-app-id:
required: false
github-app-key:
required: false

jobs:
beta-test:
name: "Beta Test 2GP"
runs-on: ubuntu-latest
container:
image: ghcr.io/muselab-d2x/d2x:cumulusci-next
image: ghcr.io/muselab-d2x/d2x:cumulusci-next-snapshots
options: --user root
credentials:
username: "${{ github.actor }}"
password: "${{ secrets.github-token }}"
env:
DEV_HUB_AUTH_URL: "${{ secrets.dev-hub-auth-url }}"
CUMULUSCI_SERVICE_github: "{ \"username\": \"${{ github.actor }}\", \"token\": \"${{ secrets.github-token }}\", \"email\": \"${{ secrets.gh-email }}\" }"
DEV_HUB_USERNAME: "${{ secrets.dev-hub-username }}"
DEV_HUB_CLIENT_ID: "${{ secrets.dev-hub-client-id }}"
DEV_HUB_PRIVATE_KEY: "${{ secrets.dev-hub-private-key }}"
CUMULUSCI_SERVICE_github: '{ "username": "${{ github.actor }}", "token": "${{ secrets.github-token }}", "email": "${{ secrets.gh-email }}" }'
GITHUB_APP_ID: "${{ secrets.github-app-id }}"
GITHUB_APP_KEY: "${{ secrets.github-app-key }}"
steps:
- name: Checkout
uses: actions/checkout@v2
Expand All @@ -31,14 +71,89 @@ jobs:
- name: Set default org
run: cci org default beta
- name: Install Dependencies for Resolution
run: cci flow run dependencies
run: |
set -e {
cci flow run dependencies \
$([[ "${{ inputs.debug }}" == "true" ]] && echo " --debug")
} || {
echo "::error::Failed to install dependencies. Running cci error info..."}
cci error info
exit 1
}
shell: bash

- name: Build Beta Package
run: cci flow run release_2gp_beta
run: |
set -e {
cci flow run release_2gp_beta \
$([[ "${{ inputs.debug }}" == "true" ]] && echo " --debug")
} || {
echo "::error::Failed to build beta package. Running cci error info..."}
cci error info
exit 1
}
shell: bash
- name: Install and Configure Beta Package
run: |
{
cci flow run ci_beta \
--skip-from run-tests \
$([[ "${{ inputs.debug }}" == "true" ]] && echo " --debug")
} || {
echo "::error::Failed to run beta test. Running cci error info..."}
cci error info
exit 1
}
- name: Start Scratch Org Snapshot
- name: Start Snapshot
id: start_snapshot
if: ${{ inputs.snapshot_name != '' }}
run: |
set -e {
cci task run create_snapshot \
--wait False \
--snapshot-name ${{ inputs.snapshot_name }} \
$([[ "${{ inputs.debug }}" == "true" ]] && echo " --debug") \
$([[ "${{ inputs.create_snapshot_commit_status }}" == "true" ]] && echo " --create-commit-status") \
$([[ "${{ inputs.create_snapshot_environment }}" == "true" ]] && echo " --create-environment") \
$([[ "${{ inputs.debug }}" == "true" ]] && echo " --debug")
} || {
echo "::error::Failed to start the snapshot. Running cci error info..."
cci error info
exit 1
}
shell: bash
- name: Run Apex Tests
run: |
set -e {
cci flow run ci_beta --start-from run_tests \
$([[ "${{ inputs.debug }}" == "true" ]] && echo " --debug")
} || {
echo "::error::Apex test failure. Running cci error info..."
cci error info
exit 1
}
shell: bash
- name: Run Beta Test
run: cci flow run ci_beta
continue-on-error: true
- name: Finalize Snapshot
if: (inputs.snapshot_name != '' && "${{ steps.start_snapshot.outputs.SNAPSHOT_ID}}" != "")
run: |
set -e {
cci task run create_snapshot \
--wait True \
--snapshot-id ${{ inputs.snapshot_name }} \
$([[ "${{ inputs.debug }}" == "true" ]] && echo " --debug") \
$([[ -n "${{ inputs.create_snapshot_commit_status }}" ]] && echo "--create-commit-status ${{ inputs.create_snapshot_commit_status }}") \
$([[ -n "${{ inputs.create_snapshot_environment }}" ]] && echo "--create-environment-status ${{ inputs.create_snapshot_environment }}")
} || {
echo "::error::Failed to finalize the snapshot. Running cci error info..."
cci error info
exit 1
}
shell: bash

- name: Delete Scratch Org
if: ${{ always() }}
run: |
cci org scratch_delete beta
cci org scratch_delete beta
shell: bash
44 changes: 22 additions & 22 deletions .github/workflows/beta-test-env.yml
Original file line number Diff line number Diff line change
@@ -1,41 +1,41 @@
name: Beta Test

on:
workflow_call:
inputs:
env-name:
required: true
default: 1GP Packaging Beta
type: string
debug:
required: false
default: false
type: boolean
secrets:
packaging-org-auth-url:
required: true
dev-hub-auth-url:
required: true
gh-email:
required: true
github-token:
required: true
workflow_call:
inputs:
env-name:
required: true
default: 1GP Packaging Beta
type: string
debug:
required: false
default: false
type: boolean
secrets:
packaging-org-auth-url:
required: true
dev-hub-auth-url:
required: true
gh-email:
required: true
github-token:
required: true

jobs:
beta-test:
name: "Beta Test"
runs-on: ubuntu-latest
environment: ${{ inputs.env-name }}
container:
image: ghcr.io/muselab-d2x/d2x:cumulusci-next
image: ghcr.io/muselab-d2x/d2x:cumulusci-next-snapshots
options: --user root
credentials:
username: ${{ github.actor }}
password: ${{ secrets.github-token }}
env:
DEV_HUB_AUTH_URL: "${{ secrets.dev-hub-auth-url }}"
PACKAGING_ORG_AUTH_URL: "${{ secrets.packaging-org-auth-url }}"
CUMULUSCI_SERVICE_github: "{ \"username\": \"${{ github.actor }}\", \"token\": \"${{ secrets.github-token }}\", \"email\": \"${{ secrets.gh-email }}\" }"
CUMULUSCI_SERVICE_github: '{ "username": "${{ github.actor }}", "token": "${{ secrets.github-token }}", "email": "${{ secrets.gh-email }}" }'
steps:
- name: Checkout
uses: actions/checkout@v2
Expand All @@ -51,5 +51,5 @@ jobs:
- name: Delete Scratch Org
if: ${{ always() }}
run: |
cci org scratch_delete beta
cci org scratch_delete beta
shell: bash
22 changes: 11 additions & 11 deletions .github/workflows/beta-test-unlocked.yml
Original file line number Diff line number Diff line change
@@ -1,28 +1,28 @@
name: Beta Test 2GP

on:
workflow_call:
secrets:
dev-hub-auth-url:
required: true
gh-email:
required: true
github-token:
required: true
workflow_call:
secrets:
dev-hub-auth-url:
required: true
gh-email:
required: true
github-token:
required: true

jobs:
beta-test:
name: "Beta Test Unlocked"
runs-on: ubuntu-latest
container:
image: ghcr.io/muselab-d2x/d2x:cumulusci-next
image: ghcr.io/muselab-d2x/d2x:cumulusci-next-snapshots
options: --user root
credentials:
username: ${{ github.actor }}
password: ${{ secrets.github-token }}
env:
DEV_HUB_AUTH_URL: "${{ secrets.dev-hub-auth-url }}"
CUMULUSCI_SERVICE_github: "{ \"username\": \"${{ github.actor }}\", \"token\": \"${{ secrets.github-token }}\", \"email\": \"${{ secrets.gh-email }}\" }"
CUMULUSCI_SERVICE_github: '{ "username": "${{ github.actor }}", "token": "${{ secrets.github-token }}", "email": "${{ secrets.gh-email }}" }'
steps:
- name: Checkout
uses: actions/checkout@v2
Expand All @@ -38,5 +38,5 @@ jobs:
- name: Delete Scratch Org
if: ${{ always() }}
run: |
cci org scratch_delete beta
cci org scratch_delete beta
shell: bash
26 changes: 13 additions & 13 deletions .github/workflows/beta-test.yml
Original file line number Diff line number Diff line change
@@ -1,31 +1,31 @@
name: Beta Test

on:
workflow_call:
secrets:
packaging-org-auth-url:
required: true
dev-hub-auth-url:
required: true
gh-email:
required: true
github-token:
required: true
workflow_call:
secrets:
packaging-org-auth-url:
required: true
dev-hub-auth-url:
required: true
gh-email:
required: true
github-token:
required: true

jobs:
beta-test:
name: "Beta Test"
runs-on: ubuntu-latest
container:
image: ghcr.io/muselab-d2x/d2x:cumulusci-next
image: ghcr.io/muselab-d2x/d2x:cumulusci-next-snapshots
options: --user root
credentials:
username: ${{ github.actor }}
password: ${{ secrets.github-token }}
env:
DEV_HUB_AUTH_URL: "${{ secrets.dev-hub-auth-url }}"
PACKAGING_ORG_AUTH_URL: "${{ secrets.packaging-org-auth-url }}"
CUMULUSCI_SERVICE_github: "{ \"username\": \"${{ github.actor }}\", \"token\": \"${{ secrets.github-token }}\", \"email\": \"${{ secrets.gh-email }}\" }"
CUMULUSCI_SERVICE_github: '{ "username": "${{ github.actor }}", "token": "${{ secrets.github-token }}", "email": "${{ secrets.gh-email }}" }'
steps:
- name: Checkout
uses: actions/checkout@v2
Expand All @@ -41,5 +41,5 @@ jobs:
- name: Delete Scratch Org
if: ${{ always() }}
run: |
cci org scratch_delete beta
cci org scratch_delete beta
shell: bash
50 changes: 25 additions & 25 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -1,31 +1,31 @@
name: Build Docker Image

on:
push:
branches:
- cumulusci-next
workflow_dispatch:
push:
branches:
- cumulusci-next-snapshots
workflow_dispatch:

jobs:
build:
runs-on: ubuntu-latest
build:
runs-on: ubuntu-latest

steps:
- name: Checkout repository
uses: actions/checkout@v2
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1
- name: Login to GitHub Container Registry
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build and push Docker image
uses: docker/build-push-action@v2
with:
context: .
push: ${{ github.event_name == 'push' }}
tags: |
ghcr.io/${{ github.repository }}:cumulusci-next
ghcr.io/${{ github.repository }}:${{ github.sha }}
steps:
- name: Checkout repository
uses: actions/checkout@v2
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1
- name: Login to GitHub Container Registry
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build and push Docker image
uses: docker/build-push-action@v2
with:
context: .
push: ${{ github.event_name == 'push' }}
tags: |
ghcr.io/${{ github.repository }}:cumulusci-next-snapshots
ghcr.io/${{ github.repository }}:${{ github.sha }}
Loading

0 comments on commit 8e77c99

Please sign in to comment.