Skip to content
Open
87 changes: 87 additions & 0 deletions .github/workflows/deploy-managed-solution.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,87 @@
name: deploy-managed-solution
# Check out solution from Main, pack solution as managed and deploy to destination environment

on:
workflow_dispatch:
inputs:
# Change this value
solution_name:
description: 'name of the solution to worked on from Power Platform'
required: true
default: ALMLab
destination_environment_url:
description: 'Url of the Power Platform Environment to deploy to'
required: true
default: 'https://loutimtest.crm9.dynamics.com'

permissions:
contents: write
env:
#edit your values here
# ENVIRONMENT_URL should not be needed, testing before removing
ENVIRONMENT_URL: 'https://loutimdev.crm9.dynamics.com'
PP_BUILD_URL: 'https://loutimbuild.crm9.dynamics.com'
CLIENT_ID: '8e4bb30c-79c5-4a03-a11d-184322a0a793'
TENANT_ID: 'c0daba30-fba7-4669-a2fc-36142728b7e9'
SOLUTION_FOLDER: out/solutions/
SOLUTION_SOURCE_FOLDER: solutions/

jobs:
export-from-dev:
runs-on: windows-latest
# or you can say runs-on: ubuntu-latest
env:
RUNNER_DEBUG: 1

steps:
- uses: actions/checkout@v2
with:
lfs: true

- name: who-am-i action
uses: microsoft/powerplatform-actions/who-am-i@v0
with:
environment-url: ${{inputs.destination_environment_url}}
app-id: ${{env.CLIENT_ID}}
client-secret: ${{ secrets.PowerPlatformSPN }}
tenant-id: ${{env.TENANT_ID}}

- name: Pack solution
uses: microsoft/powerplatform-actions/pack-solution@v0
with:
solution-folder: ${{ env.SOLUTION_SOURCE_FOLDER}}/${{ inputs.solution_name }}
solution-file: ${{ env.SOLUTION_FOLDER}}/${{ inputs.solution_name }}.zip
solution-type: Unmanaged

- name: Import solution as unmanaged to build env
uses: microsoft/powerplatform-actions/import-solution@v0
with:
environment-url: ${{env.PP_BUILD_URL}}
app-id: ${{env.CLIENT_ID}}
client-secret: ${{ secrets.PowerPlatformSPN }}
tenant-id: ${{env.TENANT_ID}}
solution-file: ${{ env.SOLUTION_FOLDER}}/${{ inputs.solution_name }}.zip
force-overwrite: true
publish-changes: true

- name: Export solution as managed
uses: microsoft/powerplatform-actions/export-solution@v0
with:
environment-url: ${{env.PP_BUILD_URL}}
app-id: ${{env.CLIENT_ID}}
client-secret: ${{ secrets.PowerPlatformSPN }}
tenant-id: ${{env.TENANT_ID}}
solution-name: ${{ inputs.solution_name }}
managed: true
solution-output-file: ${{ env.SOLUTION_FOLDER}}/${{ inputs.solution_name }}_managed.zip

- name: Import solution to destination env
uses: microsoft/powerplatform-actions/import-solution@v0
with:
environment-url: ${{inputs.destination_environment_url}}
app-id: ${{env.CLIENT_ID}}
client-secret: ${{ secrets.PowerPlatformSPN }}
tenant-id: ${{env.TENANT_ID}}
solution-file: ${{ env.SOLUTION_FOLDER}}/${{ inputs.solution_name }}_managed.zip
force-overwrite: true
publish-changes: true
8 changes: 8 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ The following Power Platforms are used as part of this project.
|---------|:---------------------------:|
| DEV | Main development environment will all work is performed on the solution |
| BUILD | Build environment that is used by GitHub actions for building solution |
| TEST | Test environment that is used by GitHub actions |
| HOTFIX| Special hotfix environment to be used for working on hotfixes and keeping dev work isolated from hotfixes |
| PROD| Production environment that will host the final solution for production use|

Expand All @@ -23,10 +24,17 @@ The following Power Platforms are used as part of this project.
| TENANT_ID | The Tenant ID for the Tenant hosting the Power Platform solution |
| ENVIRONMENT_URL | The URL for the Power Platform environment |
| BUILD_ENVIRONMENT_URL | The URL for the Power Platform Build environment |
| TEST_ENVIRONMENT_URL | The URL for the Power Platform Test environment |
| PRODUCTION_ENVIRONMENT_URL | The URL for the Power Platform Production environmnet |
| PowerPlatformSPN | The Secret for the Client ID that has been registered for Power Platform. This is stored in secrets on GitHub |
| GITHUB_TOKEN |

### Create App Registration in Azure for Dataverse (Power Platform)
Within Azure, create an App Registration with API access to Dataverse.

### Store App Registration Secret in GitHub Environments
Within GitHub, create an environment to store the App Registration Secret. In GitHub under Environments you can store secrets (secure information) so that it will be available but is secured.

### backfill-main-to-dev.yml
Export solution from DEV as unmanaged, upload export solution to GitHub artifact store, pack solution as unmanaged and deploy to dev/hotfix

Expand Down
6 changes: 5 additions & 1 deletion solutions/ALMLab/Entities/user9_TimeOffRequest/Entity.xml
Original file line number Diff line number Diff line change
Expand Up @@ -732,7 +732,7 @@
<Name>user9_name</Name>
<LogicalName>user9_name</LogicalName>
<RequiredLevel>required</RequiredLevel>
<DisplayMask>PrimaryName|ValidForAdvancedFind|ValidForForm|ValidForGrid|RequiredForForm</DisplayMask>
<DisplayMask>ActivityPointerRegardingName|PrimaryName|ValidForAdvancedFind|ValidForForm|ValidForGrid|RequiredForForm</DisplayMask>
<ImeMode>auto</ImeMode>
<ValidForUpdateApi>1</ValidForUpdateApi>
<ValidForReadApi>1</ValidForReadApi>
Expand Down Expand Up @@ -932,6 +932,7 @@
<IsCollaboration>0</IsCollaboration>
<AutoRouteToOwnerQueue>0</AutoRouteToOwnerQueue>
<IsConnectionsEnabled>0</IsConnectionsEnabled>
<EntityColor></EntityColor>
<IsDocumentManagementEnabled>0</IsDocumentManagementEnabled>
<AutoCreateAccessTeams>0</AutoCreateAccessTeams>
<IsOneNoteIntegrationEnabled>0</IsOneNoteIntegrationEnabled>
Expand All @@ -940,6 +941,7 @@
<IsDocumentRecommendationsEnabled>0</IsDocumentRecommendationsEnabled>
<IsBPFEntity>0</IsBPFEntity>
<OwnershipTypeMask>UserOwned</OwnershipTypeMask>
<EntityMask>ActivityPointer</EntityMask>
<IsAuditEnabled>0</IsAuditEnabled>
<IsRetrieveAuditEnabled>0</IsRetrieveAuditEnabled>
<IsRetrieveMultipleAuditEnabled>0</IsRetrieveMultipleAuditEnabled>
Expand Down Expand Up @@ -981,10 +983,12 @@
<EnforceStateTransitions>0</EnforceStateTransitions>
<CanChangeHierarchicalRelationship>1</CanChangeHierarchicalRelationship>
<EntityHelpUrlEnabled>0</EntityHelpUrlEnabled>
<EntityHelpUrl></EntityHelpUrl>
<ChangeTrackingEnabled>0</ChangeTrackingEnabled>
<CanChangeTrackingBeEnabled>1</CanChangeTrackingBeEnabled>
<IsEnabledForExternalChannels>0</IsEnabledForExternalChannels>
<IsSolutionAware>0</IsSolutionAware>
<HasRelatedActivities>True</HasRelatedActivities>
</entity>
</EntityInfo>
<FormXml />
Expand Down
2 changes: 2 additions & 0 deletions solutions/ALMLab/Other/Customizations.xml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@
<optionsets />
<WebResources />
<CustomControls />
<SolutionPluginAssemblies />
<SdkMessageProcessingSteps />
<AppModuleSiteMaps />
<AppModules />
<EntityDataProviders />
Expand Down
4 changes: 3 additions & 1 deletion solutions/ALMLab/Other/Solution.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<ImportExportXml version="9.2.23031.182" SolutionPackageVersion="9.2" languagecode="1033" generatedBy="CrmLive" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<ImportExportXml version="9.2.23033.224" SolutionPackageVersion="9.2" languagecode="1033" generatedBy="CrmLive" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<SolutionManifest>
<UniqueName>ALMLab</UniqueName>
<LocalizedNames>
Expand Down Expand Up @@ -82,6 +82,8 @@
<RootComponent type="61" schemaName="user9_/scripts/RequestedTimeOff" behavior="0" />
<RootComponent type="62" schemaName="user9_TimeOffRequest" behavior="0" />
<RootComponent type="80" schemaName="user9_TimeOffRequest" behavior="0" />
<RootComponent type="91" id="{dfa2eab9-17c7-4fe7-be38-f722ea53aa8c}" schemaName="USDAALMTimeOff, Version=1.0.0.0, Culture=neutral, PublicKeyToken=6b8a928a6b32759f" behavior="0" />
<RootComponent type="92" id="{fd9b55b1-5fe4-ed11-a7c6-001dd80706ea}" behavior="0" />
</RootComponents>
<MissingDependencies>
<MissingDependency>
Expand Down
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<?xml version="1.0" encoding="utf-8"?>
<PluginAssembly FullName="USDAALMTimeOff, Version=1.0.0.0, Culture=neutral, PublicKeyToken=6b8a928a6b32759f" PluginAssemblyId="dfa2eab9-17c7-4fe7-be38-f722ea53aa8c" CustomizationLevel="1" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<IsolationMode>2</IsolationMode>
<SourceType>0</SourceType>
<IntroducedVersion>1.0</IntroducedVersion>
<FileName>/PluginAssemblies/USDAALMTimeOff-DFA2EAB9-17C7-4FE7-BE38-F722EA53AA8C/USDAALMTimeOff.dll</FileName>
<PluginTypes>
<PluginType AssemblyQualifiedName="USDAALMTimeOff.TimeOffPlugin, USDAALMTimeOff, Version=1.0.0.0, Culture=neutral, PublicKeyToken=6b8a928a6b32759f" PluginTypeId="067970b9-44e7-4640-9d67-64f6f116b1c0" Name="USDAALMTimeOff.TimeOffPlugin">
<FriendlyName>ade2b64b-62bd-4b74-a66a-9186eea33de7</FriendlyName>
</PluginType>
</PluginTypes>
</PluginAssembly>
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
<?xml version="1.0" encoding="utf-8"?>
<SdkMessageProcessingStep Name="USDAALMTimeOff.TimeOffPlugin: Create of user9_timeoffrequest" SdkMessageProcessingStepId="{fd9b55b1-5fe4-ed11-a7c6-001dd80706ea}" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<SdkMessageId>9ebdbb1b-ea3e-db11-86a7-000a3a5473e8</SdkMessageId>
<PluginTypeName>USDAALMTimeOff.TimeOffPlugin, USDAALMTimeOff, Version=1.0.0.0, Culture=neutral, PublicKeyToken=6b8a928a6b32759f</PluginTypeName>
<PluginTypeId>067970b9-44e7-4640-9d67-64f6f116b1c0</PluginTypeId>
<PrimaryEntity>user9_timeoffrequest</PrimaryEntity>
<AsyncAutoDelete>0</AsyncAutoDelete>
<Description>USDAALMTimeOff.TimeOffPlugin: Create of user9_timeoffrequest</Description>
<FilteringAttributes></FilteringAttributes>
<InvocationSource>1</InvocationSource>
<Mode>0</Mode>
<Rank>1</Rank>
<EventHandlerTypeCode>4602</EventHandlerTypeCode>
<Stage>40</Stage>
<IsCustomizable>1</IsCustomizable>
<IsHidden>0</IsHidden>
<SupportedDeployment>0</SupportedDeployment>
<IntroducedVersion>1.0</IntroducedVersion>
<SdkMessageProcessingStepImages />
</SdkMessageProcessingStep>