├── .gitignore ├── PowerActionsLab.zip ├── solutions ├── ALMLab_1_0_0_1.zip └── ALMLab │ ├── Entities │ └── user9_TimeOffRequest │ │ ├── RibbonDiff.xml │ │ ├── SavedQueries │ │ ├── {1654db08-488c-e911-a954-000d3a124702}.xml │ │ ├── {ed5c7005-99b9-405c-8be2-b567f5d53817}.xml │ │ ├── {97f4550f-300a-4cda-9682-5e9265a63b85}.xml │ │ ├── {1ccf5e7d-3f21-4a26-b88e-bed015c25224}.xml │ │ ├── {18d88904-9469-4f7d-8a73-9232807276a8}.xml │ │ ├── {d633ce13-995a-43df-bf2f-d30c009d3174}.xml │ │ └── {ffc686bb-a3fd-48b5-9aa9-ee60dc921d1b}.xml │ │ ├── FormXml │ │ ├── quick │ │ │ └── {2ff605e1-b2ac-4c20-a159-84826fe68162}.xml │ │ ├── main │ │ │ └── {f81e6348-2d65-4c72-88d8-324274d7cccd}.xml │ │ └── card │ │ │ └── {1141388e-3f24-4bc7-9dbf-e1d8fb670dd9}.xml │ │ └── Entity.xml │ └── Other │ ├── Customizations.xml │ ├── Relationships.xml │ ├── Relationships │ ├── Owner.xml │ ├── Team.xml │ ├── BusinessUnit.xml │ └── SystemUser.xml │ └── Solution.xml ├── .vscode └── extensions.json ├── .editorconfig ├── CODE_OF_CONDUCT.md ├── sample-workflows ├── release-action-call.yml ├── release-action-call-vars.yml ├── actions │ └── set-pac-path │ │ └── action.yml ├── deploy-managed-application.yml ├── delete-environments.yml ├── deploy-unmanaged-application.yml ├── export-and-commit-solution.yml ├── export-and-branch-solution.yml ├── export-and-branch-solution-with-spn-auth.yml ├── export-solution-on-main.yml ├── create-envs.yml ├── release-solution-to-prod.yml ├── release-solution-env-vars.yml ├── release-solution-with-githubvars.yml ├── release-solution-to-prod-with-spn-auth.yml ├── release-solution-to-prod-with-inputs.yml └── exportandunpack.yml ├── PRIVACY.md ├── LICENSE ├── .gitattributes ├── README.md ├── .github └── workflows │ ├── export-and-branch-solution.yml │ └── release-solution-to-prod.yml └── SECURITY.md /.gitignore: -------------------------------------------------------------------------------- 1 | /node_modules/ 2 | /coverage/ 3 | /out/ 4 | /dist/ 5 | -------------------------------------------------------------------------------- /PowerActionsLab.zip: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:690191da4c7cc75669cba35061cd34da5edebad836322497193dc7d143e2aba8 3 | size 2439279 4 | -------------------------------------------------------------------------------- /solutions/ALMLab_1_0_0_1.zip: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:42c1889fc8651361a96ad71d99e322e559ef25b9f60020b7cd3507073cd46423 3 | size 8101 4 | -------------------------------------------------------------------------------- /.vscode/extensions.json: -------------------------------------------------------------------------------- 1 | { 2 | "recommendations": [ 3 | "editorconfig.editorconfig", 4 | "davidanson.vscode-markdownlint", 5 | "eamodio.gitlens", 6 | "github.vscode-pull-request-github", 7 | "me-dutour-mathieu.vscode-github-actions", 8 | "ms-azure-devops.azure-pipelines" 9 | ] 10 | } 11 | -------------------------------------------------------------------------------- /.editorconfig: -------------------------------------------------------------------------------- 1 | # Copyright (c) Microsoft Corporation. 2 | # Licensed under the MIT License. 3 | root = true 4 | 5 | [*] 6 | charset = utf-8 7 | end_of_line = crlf 8 | indent_style = space 9 | insert_final_newline = true 10 | trim_trailing_whitespace = true 11 | 12 | [{src,test}/**.{ts,json,js}] 13 | indent_size = 4 14 | -------------------------------------------------------------------------------- /CODE_OF_CONDUCT.md: -------------------------------------------------------------------------------- 1 | # Microsoft Open Source Code of Conduct 2 | 3 | This project has adopted the [Microsoft Open Source Code of Conduct](https://opensource.microsoft.com/codeofconduct/). 4 | 5 | Resources: 6 | 7 | - [Microsoft Open Source Code of Conduct](https://opensource.microsoft.com/codeofconduct/) 8 | - [Microsoft Code of Conduct FAQ](https://opensource.microsoft.com/codeofconduct/faq/) 9 | - Contact [opencode@microsoft.com](mailto:opencode@microsoft.com) with questions or concerns 10 | -------------------------------------------------------------------------------- /solutions/ALMLab/Entities/user9_TimeOffRequest/RibbonDiff.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /solutions/ALMLab/Other/Customizations.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 1033 16 | 17 | -------------------------------------------------------------------------------- /solutions/ALMLab/Other/Relationships.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /sample-workflows/release-action-call.yml: -------------------------------------------------------------------------------- 1 | name: Release action 2 | # Call the reusable workflow release-solution-with-inputs.yml 3 | # Release your solution to prod when you create a new release. 4 | 5 | on: 6 | release: 7 | types: [created] 8 | permissions: 9 | contents: write 10 | jobs: 11 | Release-solution-ALMLab: 12 | uses: ./.github/workflows/release-solution-to-prod-with-inputs.yml 13 | with: 14 | #You can specify the solution name here 15 | solution_name: ALMLab 16 | #Update your values here 17 | BUILD_ENVIRONMENT_URL: 18 | PRODUCTION_ENVIRONMENT_URL: 19 | CLIENT_ID: 20 | TENANT_ID: 21 | secrets: 22 | envSecret: ${{ secrets.PowerPlatformSPN }} 23 | -------------------------------------------------------------------------------- /sample-workflows/release-action-call-vars.yml: -------------------------------------------------------------------------------- 1 | name: Release action 2 | # Call the reusable workflow release-solution-with-inputs.yml 3 | # Release your solution to prod when you create a new release. 4 | 5 | on: 6 | release: 7 | types: [created] 8 | permissions: 9 | contents: write 10 | jobs: 11 | Release-solution-GitHubActionsLab: 12 | uses: ./.github/workflows/release-solution-with-githubvars.yml 13 | with: 14 | #You can specify the solution name here 15 | solution_name: GitHubActionsLab 16 | #Update your values here 17 | BUILD_ENVIRONMENT_URL: 18 | PRODUCTION_ENVIRONMENT_URL: 19 | CLIENT_ID: ------app id------ 20 | TENANT_ID: -------tenant-id 21 | 22 | secrets: 23 | envSecret: ${{ secrets.PowerPlatformSPN }} 24 | -------------------------------------------------------------------------------- /PRIVACY.md: -------------------------------------------------------------------------------- 1 | # Data Collection 2 | 3 | The software may collect information about you and your use of the software and send it to Microsoft. 4 | Microsoft may use this information to provide services and improve our products and services. 5 | You may turn off the telemetry as described in the repository. 6 | 7 | There are also some features in the software that may enable you and Microsoft to collect data 8 | from users of your applications. If you use these features, you must comply with applicable law, 9 | including providing appropriate notices to users of your applications together with 10 | a copy of Microsoft's privacy statement. 11 | 12 | Our privacy statement is located at . 13 | You can learn more about data collection and use in the help documentation and our privacy statement. 14 | Your use of the software operates as your consent to these practices. 15 | -------------------------------------------------------------------------------- /solutions/ALMLab/Other/Relationships/Owner.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | OneToMany 5 | 1 6 | 1.0 7 | 0 8 | user9_TimeOffRequest 9 | Owner 10 | NoCascade 11 | NoCascade 12 | NoCascade 13 | NoCascade 14 | NoCascade 15 | OwnerId 16 | 17 | 18 | 19 | 20 | 21 | 22 | -------------------------------------------------------------------------------- /solutions/ALMLab/Other/Relationships/Team.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | OneToMany 5 | 1 6 | 1.0 7 | 0 8 | user9_TimeOffRequest 9 | Team 10 | NoCascade 11 | NoCascade 12 | NoCascade 13 | NoCascade 14 | NoCascade 15 | OwningTeam 16 | 17 | 18 | 19 | 20 | 21 | 22 | -------------------------------------------------------------------------------- /solutions/ALMLab/Other/Relationships/BusinessUnit.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | OneToMany 5 | 1 6 | 1.0 7 | 0 8 | user9_TimeOffRequest 9 | BusinessUnit 10 | NoCascade 11 | NoCascade 12 | NoCascade 13 | NoCascade 14 | NoCascade 15 | OwningBusinessUnit 16 | 17 | 18 | 19 | 20 | 21 | 22 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) Microsoft Corporation. 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE 22 | -------------------------------------------------------------------------------- /sample-workflows/actions/set-pac-path/action.yml: -------------------------------------------------------------------------------- 1 | #comment 2 | name: set-pac-path 3 | 4 | description: "add pac cli to path so we can use it directly" 5 | 6 | runs: 7 | using: "composite" 8 | steps: 9 | # hack, but necessary until GitHub Actions for Power Platform support all pac commands 10 | - if: ${{ false }} # this will never run, but will force powerplatform-actions to download 11 | name: force-pac-download 12 | uses: microsoft/powerplatform-actions/unpack-solution@latest 13 | with: 14 | solution-file: fake.zip 15 | solution-folder: fake 16 | 17 | - if: ${{ always() }} 18 | id: get-pac-path 19 | name: get-pac-path 20 | shell: pwsh 21 | run: | 22 | $actionsPath = "${{ runner.temp }}".Replace("_temp","_actions") 23 | if ($env:RUNNER_OS -eq "Windows") { 24 | $array = Get-ChildItem $actionsPath -Recurse | Where-Object{$_.FullName.EndsWith('pac\tools\pac.exe')} 25 | } 26 | else { 27 | $array = Get-ChildItem $actionsPath -Recurse | Where-Object{$_.FullName.EndsWith('pac_linux/tools/pac')} 28 | } 29 | $pacPath = $array[0].Directory.FullName 30 | "$pacPath" >> $env:GITHUB_PATH -------------------------------------------------------------------------------- /.gitattributes: -------------------------------------------------------------------------------- 1 | # Set default behavior to automatically normalize line endings. 2 | * text=auto 3 | 4 | # win scripts 5 | *.{cmd,[cC][mM][dD]} text eol=crlf 6 | *.{bat,[bB][aA][tT]} text eol=crlf 7 | 8 | # linux/macOS scripts 9 | *.sh text eol=lf 10 | 11 | # LFS config: 12 | # Archives 13 | *.7z filter=lfs diff=lfs merge=lfs -text 14 | *.br filter=lfs diff=lfs merge=lfs -text 15 | *.gz filter=lfs diff=lfs merge=lfs -text 16 | *.nupkg filter=lfs diff=lfs merge=lfs -text 17 | *.tar filter=lfs diff=lfs merge=lfs -text 18 | *.zip filter=lfs diff=lfs merge=lfs -text 19 | 20 | # Documents 21 | *.pdf filter=lfs diff=lfs merge=lfs -text 22 | *.docx filter=lfs diff=lfs merge=lfs -text 23 | 24 | # Images 25 | *.gif filter=lfs diff=lfs merge=lfs -text 26 | *.ico filter=lfs diff=lfs merge=lfs -text 27 | *.jpg filter=lfs diff=lfs merge=lfs -text 28 | *.pdf filter=lfs diff=lfs merge=lfs -text 29 | *.png filter=lfs diff=lfs merge=lfs -text 30 | *.psd filter=lfs diff=lfs merge=lfs -text 31 | *.webp filter=lfs diff=lfs merge=lfs -text 32 | 33 | # Executables 34 | *.exe filter=lfs diff=lfs merge=lfs -text 35 | *.dll filter=lfs diff=lfs merge=lfs -text 36 | *.dynlib filter=lfs diff=lfs merge=lfs -text 37 | *.pdb filter=lfs diff=lfs merge=lfs -text 38 | *.so filter=lfs diff=lfs merge=lfs -text 39 | -------------------------------------------------------------------------------- /solutions/ALMLab/Entities/user9_TimeOffRequest/SavedQueries/{1654db08-488c-e911-a954-000d3a124702}.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 1 5 | 1 6 | 0 7 | 0 8 | 1 9 | {1654db08-488c-e911-a954-000d3a124702} 10 | 8192 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 1.0 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | -------------------------------------------------------------------------------- /solutions/ALMLab/Entities/user9_TimeOffRequest/SavedQueries/{ed5c7005-99b9-405c-8be2-b567f5d53817}.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 1 5 | 0 6 | 0 7 | 0 8 | 1 9 | {ed5c7005-99b9-405c-8be2-b567f5d53817} 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 1 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 1.0 30 | 31 | 32 | 33 | 34 | -------------------------------------------------------------------------------- /solutions/ALMLab/Entities/user9_TimeOffRequest/SavedQueries/{97f4550f-300a-4cda-9682-5e9265a63b85}.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 1 5 | 0 6 | 0 7 | 0 8 | 1 9 | {97f4550f-300a-4cda-9682-5e9265a63b85} 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 64 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 1.0 32 | 33 | 34 | 35 | 36 | -------------------------------------------------------------------------------- /solutions/ALMLab/Entities/user9_TimeOffRequest/SavedQueries/{1ccf5e7d-3f21-4a26-b88e-bed015c25224}.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 1 5 | 0 6 | 0 7 | 0 8 | 1 9 | {1ccf5e7d-3f21-4a26-b88e-bed015c25224} 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 0 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 1.0 33 | 34 | 35 | 36 | 37 | -------------------------------------------------------------------------------- /solutions/ALMLab/Entities/user9_TimeOffRequest/SavedQueries/{18d88904-9469-4f7d-8a73-9232807276a8}.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 1 5 | 0 6 | 0 7 | 0 8 | 0 9 | {18d88904-9469-4f7d-8a73-9232807276a8} 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 0 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 1.0 33 | 34 | 35 | 36 | 37 | -------------------------------------------------------------------------------- /solutions/ALMLab/Entities/user9_TimeOffRequest/SavedQueries/{d633ce13-995a-43df-bf2f-d30c009d3174}.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 1 5 | 0 6 | 0 7 | 0 8 | 1 9 | {d633ce13-995a-43df-bf2f-d30c009d3174} 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 2 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 1.0 33 | 34 | 35 | 36 | 37 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | 2 | # Power Platform actions lab 3 | 4 | This project contains sample workflows that use the [GitHub Actions for Microsoft Power Platform](https://github.com/microsoft/powerplatform-actions). 5 | These workflows illustrate how you can: 6 | - Export a solution from a development environment. 7 | - Generate a build artifact (managed solution) and import into a production environment. 8 | 9 | In the detailed [hands-on lab](https://docs.microsoft.com/en-us/power-platform/alm/tutorials/github-actions-start), you can learn more about: 10 | - Setting up environments (module 0). 11 | - Create a new solution that contains your app (module 1). 12 | - Create a new repo and two GitHub workflows using GitHub actions for the Power Platform (module 2). 13 | 14 | Demo of lab available [here](https://youtu.be/Bk4KpE_6YtY) 15 | 16 | If you are already familiar with the concept of multiple environments as well as how to use solutions to package your app, then you can safely skip the first two modules, and simply download and use the [sample ALMLab solution](https://github.com/microsoft/powerplatform-actions-lab/blob/main/solutions/ALMLab_1_0_0_1.zip) and jump straight to module 2. 17 | 18 | Learn more about the [GitHub Actions for Microsoft Power Platform](https://docs.microsoft.com/en-us/power-platform/alm/devops-github-actions) 19 | 20 | This project has adopted the [Microsoft Open Source Code of Conduct](https://opensource.microsoft.com/codeofconduct/). 21 | For more information see the [Code of Conduct FAQ](https://opensource.microsoft.com/codeofconduct/faq/) or 22 | contact [opencode@microsoft.com](mailto:opencode@microsoft.com) with any additional questions or comments. 23 | -------------------------------------------------------------------------------- /solutions/ALMLab/Entities/user9_TimeOffRequest/SavedQueries/{ffc686bb-a3fd-48b5-9aa9-ee60dc921d1b}.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 1 5 | 0 6 | 1 7 | 0 8 | 1 9 | {ffc686bb-a3fd-48b5-9aa9-ee60dc921d1b} 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 4 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 1.0 36 | 37 | 38 | 39 | 40 | -------------------------------------------------------------------------------- /.github/workflows/export-and-branch-solution.yml: -------------------------------------------------------------------------------- 1 | name: export-and-branch-solution 2 | # Export solution from DEV environment 3 | # unpack it and prepare, commit and push a git branch with the changes 4 | 5 | on: 6 | workflow_dispatch: 7 | push: 8 | branches: [ main ] 9 | pull_request: 10 | branches: [ main ] 11 | 12 | permissions: 13 | contents: write 14 | 15 | jobs: 16 | export-from-dev: 17 | runs-on: windows-latest 18 | env: 19 | RUNNER_DEBUG: 1 20 | 21 | steps: 22 | - uses: actions/checkout@v2 23 | with: 24 | lfs: true 25 | 26 | - name: who-am-i action 27 | uses: microsoft/powerplatform-actions/who-am-i@v0 28 | with: 29 | environment-url: 'https://user9-dev.crm.dynamics.com/' 30 | user-name: 'user9@wrkdevops.onmicrosoft.com' 31 | password-secret: ${{ secrets.password }} 32 | 33 | - name: export-solution action 34 | uses: microsoft/powerplatform-actions/export-solution@v0 35 | with: 36 | environment-url: 'https://user9-dev.crm.dynamics.com/' 37 | user-name: 'user9@wrkdevops.onmicrosoft.com' 38 | password-secret: ${{ secrets.password }} 39 | solution-name: ALMLab 40 | solution-output-file: out/exported/ALMLab.zip 41 | 42 | - name: unpack-solution action 43 | uses: microsoft/powerplatform-actions/unpack-solution@v0 44 | with: 45 | solution-file: out/exported/ALMLab.zip 46 | solution-folder: out/solutions/ALMLab 47 | solution-type: 'Unmanaged' 48 | overwrite-files: true 49 | 50 | - name: branch-solution, prepare it for a PullRequest 51 | uses: microsoft/powerplatform-actions/branch-solution@v0 52 | with: 53 | solution-folder: out/solutions/ALMLab 54 | solution-target-folder: solutions/ALMLab 55 | repo-token: ${{ secrets.GITHUB_TOKEN }} 56 | allow-empty-commit: true 57 | -------------------------------------------------------------------------------- /sample-workflows/deploy-managed-application.yml: -------------------------------------------------------------------------------- 1 | name: Deploy Managed Application 2 | run-name: Deploying Managed solution ${{ github.event.inputs.solution_name }} for ${{ github.event.inputs.environment_url }} environment 3 | on: 4 | workflow_dispatch: 5 | inputs: 6 | solution_name: 7 | description: "name of the Solution" 8 | required: true 9 | default: yoursolutionname 10 | # environment_id: 11 | # description: "GUID of your Dataverse environment" 12 | # required: true 13 | # default: "GUID-OF-YOUR-ENVIRONMENT" 14 | environment_url: 15 | description: "http endpoint of your Dataverse environment" 16 | required: true 17 | default: "https://[your-env].crm.dynamics.com" 18 | #solution_source_folder: 19 | # description: "Location of the solution files" 20 | #requried: true 21 | #default: . 22 | #solution_outbound_folder: 23 | # description: "solution outbound folder" 24 | #required: true 25 | #default: out/stage 26 | jobs: 27 | import-managed-solution: 28 | runs-on: ubuntu-latest 29 | steps: 30 | - uses: actions/checkout@v3 31 | with: 32 | lfs: true 33 | env: 34 | RUNNER_DEBUG: 1 35 | 36 | - name: Import solution as managed to build env 37 | uses: microsoft/powerplatform-actions/import-solution@v0 38 | with: 39 | environment-url: ${{github.event.inputs.environment_url}} 40 | app-id: ${{secrets.CLIENT_ID}} 41 | client-secret: ${{ secrets.PowerPlatformSPN }} 42 | tenant-id: ${{secrets.TENANT_ID}} 43 | solution-file: ${{ github.event.repository.name}}/${{ github.event.inputs.solution_name }}_managed.zip 44 | force-overwrite: true 45 | publish-changes: true 46 | 47 | 48 | 49 | -------------------------------------------------------------------------------- /sample-workflows/delete-environments.yml: -------------------------------------------------------------------------------- 1 | name: Delete Envs Dev Test and Prod 2 | # clean up the environment for the next demo 3 | # clean up environment tasks for QA and Prod 4 | 5 | on: 6 | workflow_dispatch: 7 | inputs: 8 | dev_env: 9 | description: 'url for the dev environment' 10 | type: string 11 | default: https://[hostname]Dev.crm.dynamics.com 12 | 13 | test_env: 14 | description: 'url for the test environment' 15 | type: string 16 | default: https://[hostname]Test.crm.dynamics.com 17 | 18 | prod_env: 19 | description: 'url for the prod environment' 20 | type: string 21 | default: https://[hostname]Prod.crm.dynamics.com 22 | 23 | 24 | 25 | 26 | 27 | jobs: 28 | Delete-Environments: 29 | runs-on: ubuntu-latest 30 | # or you can say runs-on: windows-latest 31 | env: 32 | RUNNER_DEBUG: 1 33 | 34 | steps: 35 | - uses: actions/checkout@v3 36 | with: 37 | lfs: true 38 | 39 | - name: Delete Dev Environment 40 | uses: microsoft/powerplatform-actions/delete-environment@v0 41 | with: 42 | app-id: ${{secrets.CLIENT_ID}} 43 | client-secret: ${{ secrets.PowerPlatformSPN }} 44 | tenant-id: ${{secrets.TENANT_ID}} 45 | environment-url: ${{ inputs.dev_env }} 46 | 47 | - name: Delete Test Environment 48 | uses: microsoft/powerplatform-actions/delete-environment@v0 49 | with: 50 | app-id: ${{secrets.CLIENT_ID}} 51 | client-secret: ${{ secrets.PowerPlatformSPN }} 52 | tenant-id: ${{secrets.TENANT_ID}} 53 | environment-url: ${{ inputs.test_env }} 54 | 55 | - name: Delete Production Environment 56 | uses: microsoft/powerplatform-actions/delete-environment@v0 57 | with: 58 | app-id: ${{secrets.CLIENT_ID}} 59 | client-secret: ${{ secrets.PowerPlatformSPN }} 60 | tenant-id: ${{secrets.TENANT_ID}} 61 | environment-url: ${{ inputs.prod_env }} 62 | -------------------------------------------------------------------------------- /sample-workflows/deploy-unmanaged-application.yml: -------------------------------------------------------------------------------- 1 | name: Deploy Umanaged Application 2 | run-name: Packing ${{ github.event.inputs.solution_name }} for ${{ github.event.inputs.environment_url }} environment 3 | on: 4 | workflow_dispatch: 5 | inputs: 6 | solution_name: 7 | description: "name of the Solution" 8 | required: true 9 | default: yoursolutionname 10 | # environment_id: 11 | # description: "GUID of your Dataverse environment" 12 | # required: true 13 | # default: "GUID-OF-YOUR-ENVIRONMENT" 14 | environment_url: 15 | description: "http endpoint of your Dataverse environment" 16 | required: true 17 | default: "https://[your-env].crm.dynamics.com" 18 | #solution_source_folder: 19 | # description: "Location of the solution files" 20 | #requried: true 21 | #default: . 22 | #solution_outbound_folder: 23 | # description: "solution outbound folder" 24 | #required: true 25 | #default: out/stage 26 | jobs: 27 | pack-umanaged-solution-import: 28 | runs-on: ubuntu-latest 29 | steps: 30 | - uses: actions/checkout@v3 31 | with: 32 | lfs: true 33 | env: 34 | RUNNER_DEBUG: 1 35 | 36 | 37 | - name: Pack the solution 38 | uses: microsoft/powerplatform-actions/pack-solution@v0 39 | with: 40 | solution-folder: ${{ github.event.repository.name}}/${{ github.event.inputs.solution_name }} 41 | solution-file: ${{ github.event.repository.name}}/${{ github.event.inputs.solution_name }}.zip 42 | solution-type: Unmanaged 43 | 44 | - name: Import solution as unmanaged to build env 45 | uses: microsoft/powerplatform-actions/import-solution@v0 46 | with: 47 | environment-url: ${{github.event.inputs.environment_url}} 48 | app-id: ${{secrets.CLIENT_ID}} 49 | client-secret: ${{ secrets.PowerPlatformSPN }} 50 | tenant-id: ${{secrets.TENANT_ID}} 51 | solution-file: ${{ github.event.repository.name}}/${{ github.event.inputs.solution_name }}.zip 52 | force-overwrite: true 53 | publish-changes: true 54 | 55 | 56 | 57 | -------------------------------------------------------------------------------- /solutions/ALMLab/Entities/user9_TimeOffRequest/FormXml/quick/{2ff605e1-b2ac-4c20-a159-84826fe68162}.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | {2ff605e1-b2ac-4c20-a159-84826fe68162} 5 | 1.0 6 | 1 7 | 1 8 |
9 | 10 | 11 | 12 | 14 | 15 | 16 | 17 |
18 | 19 | 21 | 22 | 23 | 24 | 25 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 35 | 36 | 37 | 38 | 39 |
40 |
41 |
42 |
43 |
44 |
45 |
46 | 1 47 | 1 48 | 49 | 50 | 51 |
52 |
-------------------------------------------------------------------------------- /solutions/ALMLab/Entities/user9_TimeOffRequest/FormXml/main/{f81e6348-2d65-4c72-88d8-324274d7cccd}.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | {f81e6348-2d65-4c72-88d8-324274d7cccd} 5 | 1.0 6 | 1 7 | 1 8 |
9 | 10 | 11 | 12 | 14 | 15 | 16 | 17 |
18 | 19 | 21 | 22 | 23 | 24 | 25 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 35 | 36 | 37 | 38 | 39 |
40 |
41 |
42 |
43 |
44 |
45 |
46 | 1 47 | 1 48 | 49 | 50 | 51 | 52 | 53 | 54 |
55 |
-------------------------------------------------------------------------------- /sample-workflows/export-and-commit-solution.yml: -------------------------------------------------------------------------------- 1 | name: export-and-commit-solution 2 | # Export solution from DEV environment 3 | # unpack it and prepare, commit and push a git branch with the changes 4 | 5 | on: 6 | workflow_dispatch: 7 | inputs: 8 | # Change this value 9 | solution_name: 10 | description: 'name of the solution to worked on from Power Platform' 11 | required: true 12 | default: GitHubActionsLab 13 | 14 | 15 | 16 | 17 | env: 18 | #edit your values here 19 | ENVIRONMENT_URL: '' 20 | CLIENT_ID: '------------appid ----------' 21 | TENANT_ID: '-----------tenant id--------' 22 | permissions: 23 | contents: write 24 | jobs: 25 | export-from-dev: 26 | runs-on: ubuntu-latest 27 | # or you can say runs-on: ubuntu-latest 28 | env: 29 | RUNNER_DEBUG: 1 30 | 31 | steps: 32 | - uses: actions/checkout@v2 33 | with: 34 | lfs: true 35 | 36 | - name: who-am-i action 37 | uses: microsoft/powerplatform-actions/who-am-i@v0 38 | with: 39 | environment-url: ${{env.ENVIRONMENT_URL}} 40 | app-id: ${{env.CLIENT_ID}} 41 | client-secret: ${{ secrets.PowerPlatformSPN }} 42 | tenant-id: ${{env.TENANT_ID}} 43 | 44 | 45 | - name: export-solution action 46 | uses: microsoft/powerplatform-actions/export-solution@v0 47 | with: 48 | environment-url: ${{env.ENVIRONMENT_URL}} 49 | app-id: ${{env.CLIENT_ID}} 50 | client-secret: ${{ secrets.PowerPlatformSPN }} 51 | tenant-id: ${{env.TENANT_ID}} 52 | solution-name: ${{ github.event.inputs.solution_name }} 53 | solution-output-file: ${{ github.event.repository.name}}/${{ github.event.inputs.solution_name }}_unmanaged.zip 54 | 55 | - name: unpack-solution action 56 | uses: microsoft/powerplatform-actions/unpack-solution@v0 57 | with: 58 | solution-file: ${{ github.event.repository.name}}/${{ github.event.inputs.solution_name }}_unmanaged.zip 59 | solution-folder: ${{ github.event.repository.name}}/${{ github.event.inputs.solution_name }} 60 | solution-type: 'Unmanaged' 61 | overwrite-files: true 62 | 63 | 64 | - name: Git Fetch and Commit 65 | run: | 66 | git fetch --all 67 | git config --global user.email "no-reply@github.com" 68 | git config --global user.name "GitHub Actions" 69 | git checkout main 70 | git add --all 71 | git commit -m "Updates from the dev environment" 72 | git remote set-url origin https://x-access-token:${{ secrets.GITHUB_TOKEN }}@github.com/${{ github.repository }} 73 | git push 74 | 75 | 76 | -------------------------------------------------------------------------------- /.github/workflows/release-solution-to-prod.yml: -------------------------------------------------------------------------------- 1 | name: release-solution-to-prod 2 | # prepare for releasing to prod: 3 | # convert solution to managed (using a build PowerPlatform environment for the conversion) 4 | # upload the solution to the GitHub artifacts and deploy to the PROD environment 5 | 6 | on: 7 | workflow_dispatch: 8 | release: 9 | types: [created] 10 | 11 | permissions: 12 | contents: write 13 | jobs: 14 | convert-to-managed: 15 | runs-on: windows-latest 16 | env: 17 | RUNNER_DEBUG: 1 18 | 19 | steps: 20 | - uses: actions/checkout@v2 21 | with: 22 | lfs: true 23 | 24 | - name: Pack solution 25 | uses: microsoft/powerplatform-actions/pack-solution@v0 26 | with: 27 | solution-folder: solutions/ALMLab 28 | solution-file: out/solutions/ALMLab.zip 29 | solution-type: Unmanaged 30 | 31 | - name: Import solution as unmanaged to build env 32 | uses: microsoft/powerplatform-actions/import-solution@v0 33 | with: 34 | environment-url: 'https://user9-build.crm.dynamics.com/' 35 | user-name: 'user9@wrkdevops.onmicrosoft.com' 36 | password-secret: ${{ secrets.password }} 37 | solution-file: out/solutions/ALMLab.zip 38 | force-overwrite: true 39 | publish-changes: true 40 | 41 | - name: Export solution as managed 42 | uses: microsoft/powerplatform-actions/export-solution@v0 43 | with: 44 | environment-url: 'https://user9-build.crm.dynamics.com/' 45 | user-name: 'user9@wrkdevops.onmicrosoft.com' 46 | password-secret: ${{ secrets.password }} 47 | solution-name: ALMLab 48 | managed: true 49 | solution-output-file: out/ship/ALMLab.zip 50 | 51 | - name: Upload the ready to ship solution to GH artifact store 52 | uses: actions/upload-artifact@v2 53 | with: 54 | name: managedSolutions 55 | path: out/ship/ALMLab.zip 56 | 57 | release-to-staging: 58 | needs: [ convert-to-managed ] 59 | runs-on: windows-latest 60 | env: 61 | RUNNER_DEBUG: 1 62 | 63 | steps: 64 | - uses: actions/checkout@v2 65 | with: 66 | lfs: true 67 | 68 | - name: Fetch the ready to ship solution from GH artifact store 69 | uses: actions/download-artifact@v2 70 | with: 71 | name: managedSolutions 72 | path: out/release/ 73 | 74 | - name: Import solution to prod env 75 | uses: microsoft/powerplatform-actions/import-solution@v0 76 | with: 77 | environment-url: 'https://user9-prod.crm.dynamics.com/' 78 | user-name: 'user9@wrkdevops.onmicrosoft.com' 79 | password-secret: ${{ secrets.password }} 80 | solution-file: out/release/ALMLab.zip 81 | force-overwrite: true 82 | publish-changes: true 83 | -------------------------------------------------------------------------------- /SECURITY.md: -------------------------------------------------------------------------------- 1 | 2 | 3 | ## Security 4 | 5 | Microsoft takes the security of our software products and services seriously, which includes all source code repositories managed through our GitHub organizations, which include [Microsoft](https://github.com/Microsoft), [Azure](https://github.com/Azure), [DotNet](https://github.com/dotnet), [AspNet](https://github.com/aspnet), [Xamarin](https://github.com/xamarin), and [our GitHub organizations](https://opensource.microsoft.com/). 6 | 7 | If you believe you have found a security vulnerability in any Microsoft-owned repository that meets [Microsoft's definition of a security vulnerability](https://docs.microsoft.com/en-us/previous-versions/tn-archive/cc751383(v=technet.10)), please report it to us as described below. 8 | 9 | ## Reporting Security Issues 10 | 11 | **Please do not report security vulnerabilities through public GitHub issues.** 12 | 13 | Instead, please report them to the Microsoft Security Response Center (MSRC) at [https://msrc.microsoft.com/create-report](https://msrc.microsoft.com/create-report). 14 | 15 | If you prefer to submit without logging in, send email to [secure@microsoft.com](mailto:secure@microsoft.com). If possible, encrypt your message with our PGP key; please download it from the [Microsoft Security Response Center PGP Key page](https://www.microsoft.com/en-us/msrc/pgp-key-msrc). 16 | 17 | You should receive a response within 24 hours. If for some reason you do not, please follow up via email to ensure we received your original message. Additional information can be found at [microsoft.com/msrc](https://www.microsoft.com/msrc). 18 | 19 | Please include the requested information listed below (as much as you can provide) to help us better understand the nature and scope of the possible issue: 20 | 21 | * Type of issue (e.g. buffer overflow, SQL injection, cross-site scripting, etc.) 22 | * Full paths of source file(s) related to the manifestation of the issue 23 | * The location of the affected source code (tag/branch/commit or direct URL) 24 | * Any special configuration required to reproduce the issue 25 | * Step-by-step instructions to reproduce the issue 26 | * Proof-of-concept or exploit code (if possible) 27 | * Impact of the issue, including how an attacker might exploit the issue 28 | 29 | This information will help us triage your report more quickly. 30 | 31 | If you are reporting for a bug bounty, more complete reports can contribute to a higher bounty award. Please visit our [Microsoft Bug Bounty Program](https://microsoft.com/msrc/bounty) page for more details about our active programs. 32 | 33 | ## Preferred Languages 34 | 35 | We prefer all communications to be in English. 36 | 37 | ## Policy 38 | 39 | Microsoft follows the principle of [Coordinated Vulnerability Disclosure](https://www.microsoft.com/en-us/msrc/cvd). 40 | 41 | -------------------------------------------------------------------------------- /sample-workflows/export-and-branch-solution.yml: -------------------------------------------------------------------------------- 1 | name: export-and-branch-solution 2 | # Export solution from DEV environment 3 | # unpack it and prepare, commit and push a git branch with the changes 4 | 5 | on: 6 | workflow_dispatch: 7 | inputs: 8 | # Change this value 9 | solution_name: 10 | description: 'name of the solution to worked on from Power Platform' 11 | required: true 12 | default: ALMLab 13 | #Do Not change these values 14 | solution_exported_folder: 15 | description: 'folder name for staging the exported solution *do not change*' 16 | required: true 17 | default: out/exported/ 18 | solution_folder: 19 | description: 'staging the unpacked solution folder before check-in *do not change*' 20 | required: true 21 | default: out/solutions/ 22 | solution_target_folder: 23 | description: 'folder name to be created and checked in *do not change*' 24 | required: true 25 | default: solutions/ 26 | 27 | env: 28 | #edit your values here 29 | ENVIRONMENT_URL: 30 | USERNAME: 31 | 32 | permissions: 33 | contents: write 34 | 35 | jobs: 36 | export-from-dev: 37 | runs-on: windows-latest 38 | env: 39 | RUNNER_DEBUG: 1 40 | 41 | steps: 42 | - uses: actions/checkout@v2 43 | with: 44 | lfs: true 45 | 46 | - name: who-am-i action 47 | uses: microsoft/powerplatform-actions/who-am-i@v0 48 | with: 49 | environment-url: ${{env.ENVIRONMENT_URL}} 50 | user-name: ${{env.USERNAME}} 51 | password-secret: ${{ secrets.password }} 52 | 53 | - name: export-solution action 54 | uses: microsoft/powerplatform-actions/export-solution@v0 55 | with: 56 | environment-url: ${{env.ENVIRONMENT_URL}} 57 | user-name: ${{env.USERNAME}} 58 | password-secret: ${{ secrets.password }} 59 | solution-name: ${{ github.event.inputs.solution_name }} 60 | solution-output-file: ${{ github.event.inputs.solution_exported_folder}}/${{ github.event.inputs.solution_name }}.zip 61 | 62 | 63 | - name: unpack-solution action 64 | uses: microsoft/powerplatform-actions/unpack-solution@v0 65 | with: 66 | solution-file: ${{ github.event.inputs.solution_exported_folder}}/${{ github.event.inputs.solution_name }}.zip 67 | solution-folder: ${{ github.event.inputs.solution_folder}}/${{ github.event.inputs.solution_name }} 68 | solution-type: 'Unmanaged' 69 | overwrite-files: true 70 | 71 | - name: branch-solution, prepare it for a PullRequest 72 | uses: microsoft/powerplatform-actions/branch-solution@v0 73 | with: 74 | solution-folder: ${{ github.event.inputs.solution_folder}}/${{ github.event.inputs.solution_name }} 75 | solution-target-folder: ${{ github.event.inputs.solution_target_folder}}/${{ github.event.inputs.solution_name }} 76 | repo-token: ${{ secrets.GITHUB_TOKEN }} 77 | allow-empty-commit: true 78 | -------------------------------------------------------------------------------- /solutions/ALMLab/Other/Relationships/SystemUser.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | OneToMany 5 | 1 6 | 1.0 7 | 0 8 | user9_TimeOffRequest 9 | SystemUser 10 | NoCascade 11 | NoCascade 12 | NoCascade 13 | NoCascade 14 | NoCascade 15 | CreatedBy 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | OneToMany 24 | 1 25 | 1.0 26 | 0 27 | user9_TimeOffRequest 28 | SystemUser 29 | NoCascade 30 | NoCascade 31 | NoCascade 32 | NoCascade 33 | NoCascade 34 | ModifiedBy 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | OneToMany 43 | 1 44 | 1.0 45 | 0 46 | user9_TimeOffRequest 47 | SystemUser 48 | NoCascade 49 | NoCascade 50 | NoCascade 51 | NoCascade 52 | NoCascade 53 | OwningUser 54 | 55 | 56 | 57 | 58 | 59 | 60 | -------------------------------------------------------------------------------- /sample-workflows/export-and-branch-solution-with-spn-auth.yml: -------------------------------------------------------------------------------- 1 | name: export-and-branch-solution 2 | # Export solution from DEV environment 3 | # unpack it and prepare, commit and push a git branch with the changes 4 | 5 | on: 6 | workflow_dispatch: 7 | inputs: 8 | # Change this value 9 | solution_name: 10 | description: 'name of the solution to worked on from Power Platform' 11 | required: true 12 | default: ALMLab 13 | #Do Not change these values 14 | solution_exported_folder: 15 | description: 'folder name for staging the exported solution *do not change*' 16 | required: true 17 | default: out/exported/ 18 | solution_folder: 19 | description: 'staging the unpacked solution folder before check-in *do not change*' 20 | required: true 21 | default: out/solutions/ 22 | solution_target_folder: 23 | description: 'folder name to be created and checked in *do not change*' 24 | required: true 25 | default: solutions/ 26 | env: 27 | #edit your values here 28 | ENVIRONMENT_URL: '' 29 | CLIENT_ID: '' 30 | TENANT_ID: '' 31 | permissions: 32 | contents: write 33 | jobs: 34 | export-from-dev: 35 | runs-on: windows-latest 36 | # or you can say runs-on: ubuntu-latest 37 | env: 38 | RUNNER_DEBUG: 1 39 | 40 | steps: 41 | - uses: actions/checkout@v2 42 | with: 43 | lfs: true 44 | 45 | - name: who-am-i action 46 | uses: microsoft/powerplatform-actions/who-am-i@v0 47 | with: 48 | environment-url: ${{env.ENVIRONMENT_URL}} 49 | app-id: ${{env.CLIENT_ID}} 50 | client-secret: ${{ secrets.PowerPlatformSPN }} 51 | tenant-id: ${{env.TENANT_ID}} 52 | 53 | 54 | - name: export-solution action 55 | uses: microsoft/powerplatform-actions/export-solution@v0 56 | with: 57 | environment-url: ${{env.ENVIRONMENT_URL}} 58 | app-id: ${{env.CLIENT_ID}} 59 | client-secret: ${{ secrets.PowerPlatformSPN }} 60 | tenant-id: ${{env.TENANT_ID}} 61 | solution-name: ${{ github.event.inputs.solution_name }} 62 | solution-output-file: ${{ github.event.inputs.solution_exported_folder}}/${{ github.event.inputs.solution_name }}.zip 63 | 64 | - name: unpack-solution action 65 | uses: microsoft/powerplatform-actions/unpack-solution@v0 66 | with: 67 | solution-file: ${{ github.event.inputs.solution_exported_folder}}/${{ github.event.inputs.solution_name }}.zip 68 | solution-folder: ${{ github.event.inputs.solution_folder}}/${{ github.event.inputs.solution_name }} 69 | solution-type: 'Unmanaged' 70 | overwrite-files: true 71 | 72 | - name: branch-solution, prepare it for a PullRequest 73 | uses: microsoft/powerplatform-actions/branch-solution@v0 74 | with: 75 | solution-folder: ${{ github.event.inputs.solution_folder}}/${{ github.event.inputs.solution_name }} 76 | solution-target-folder: ${{ github.event.inputs.solution_target_folder}}/${{ github.event.inputs.solution_name }} 77 | repo-token: ${{ secrets.GITHUB_TOKEN }} 78 | allow-empty-commit: true 79 | -------------------------------------------------------------------------------- /sample-workflows/export-solution-on-main.yml: -------------------------------------------------------------------------------- 1 | name: export-solution-on-main 2 | # Export solution from DEV environment 3 | # unpack it and prepare, commit and push a git branch with the changes 4 | 5 | on: 6 | workflow_dispatch: 7 | inputs: 8 | # Change this value 9 | solution_name: 10 | description: 'name of the solution to worked on from Power Platform' 11 | required: true 12 | default: ALMLab 13 | #Do Not change these values 14 | solution_exported_folder: 15 | description: 'folder name for staging the exported solution *do not change*' 16 | required: true 17 | default: /out 18 | solution_folder: 19 | description: 'staging the unpacked solution folder before check-in *do not change*' 20 | required: true 21 | default: /solution 22 | solution_target_folder: 23 | description: 'folder name to be created and checked in *do not change*' 24 | required: true 25 | default: solution 26 | env: 27 | #edit your values here 28 | ENVIRONMENT_URL: '' 29 | CLIENT_ID: '' 30 | TENANT_ID: '' 31 | permissions: 32 | contents: write 33 | jobs: 34 | export-from-dev: 35 | runs-on: windows-latest 36 | # or you can say runs-on: ubuntu-latest 37 | env: 38 | RUNNER_DEBUG: 1 39 | 40 | steps: 41 | - uses: actions/checkout@v3 42 | with: 43 | lfs: true 44 | 45 | - name: who-am-i action 46 | uses: microsoft/powerplatform-actions/who-am-i@v0 47 | with: 48 | environment-url: ${{env.ENVIRONMENT_URL}} 49 | app-id: ${{env.CLIENT_ID}} 50 | client-secret: ${{ secrets.PowerPlatformSPN }} 51 | tenant-id: ${{env.TENANT_ID}} 52 | 53 | 54 | 55 | - name: export-solution action 56 | uses: microsoft/powerplatform-actions/export-solution@v0 57 | with: 58 | environment-url: ${{env.ENVIRONMENT_URL}} 59 | app-id: ${{env.CLIENT_ID}} 60 | client-secret: ${{ secrets.PowerPlatformSPN }} 61 | tenant-id: ${{env.TENANT_ID}} 62 | solution-name: ${{ github.event.inputs.solution_name }} 63 | solution-output-file: ${{ github.event.inputs.solution_exported_folder}}/${{ github.event.inputs.solution_name }}.zip 64 | 65 | - name: unpack-solution action 66 | uses: microsoft/powerplatform-actions/unpack-solution@v0 67 | with: 68 | solution-file: ${{ github.event.inputs.solution_exported_folder}}/${{ github.event.inputs.solution_name }}.zip 69 | solution-folder: ${{ github.event.inputs.solution_folder}}/${{ github.event.inputs.solution_name }} 70 | solution-type: 'Unmanaged' 71 | overwrite-files: true 72 | 73 | - name: Commit changes 74 | run: | 75 | cp -r ${{ github.event.inputs.solution_folder}}/${{ github.event.inputs.solution_name }} ./${{ github.event.inputs.solution_folder}}/${{ github.event.inputs.solution_name }} 76 | git config --global user.email "no-reply@github.com" 77 | git config --global user.name "GitHub Actions" 78 | git checkout main 79 | git add --all 80 | git commit -m "Updates from the dev environment" 81 | git remote set-url origin https://x-access-token:${{ secrets.GITHUB_TOKEN }}@github.com/${{ github.repository }} 82 | git push 83 | -------------------------------------------------------------------------------- /sample-workflows/create-envs.yml: -------------------------------------------------------------------------------- 1 | name: Create Dev Test and Prod Environments 2 | # clean up the environment for the next demo 3 | # clean up environment tasks for QA and Prod 4 | 5 | on: 6 | workflow_dispatch: 7 | inputs: 8 | 9 | env_name: 10 | description: name for the environment to be created 11 | required: true 12 | default: [environmentname] 13 | 14 | client_id: 15 | description: service principal client id 16 | required: true 17 | default: [client id] 18 | 19 | user_id: 20 | description: AAD object id for the user 21 | required: true 22 | default: [AAD object id] 23 | 24 | #Do Not change these values 25 | 26 | 27 | jobs: 28 | Create-Environments: 29 | runs-on: ubuntu-latest 30 | # or you can say runs-on: windows-latest 31 | env: 32 | RUNNER_DEBUG: 1 33 | 34 | steps: 35 | - uses: actions/checkout@v3 36 | with: 37 | lfs: true 38 | 39 | - name: Create Developer Environment 40 | uses: microsoft/powerplatform-actions/create-environment@v0 41 | with: 42 | app-id: ${{secrets.CLIENT_ID}} 43 | client-secret: ${{ secrets.PowerPlatformSPN }} 44 | tenant-id: ${{secrets.TENANT_ID}} 45 | name: ${{ github.event.inputs.env_name}}_Dev 46 | type: Developer 47 | domain: ${{ github.event.inputs.env_name}}Dev 48 | 49 | - name: assign-user to developer environment 50 | uses: microsoft/powerplatform-actions/assign-user@v0 51 | with: 52 | app-id: ${{secrets.CLIENT_ID}} 53 | client-secret: ${{ secrets.PowerPlatformSPN }} 54 | tenant-id: ${{secrets.TENANT_ID}} 55 | environment: 'https://${{ github.event.inputs.env_name}}Dev.dynamics.com' 56 | user: ${{ github.event.inputs.user_id }} 57 | role: System Administrator 58 | 59 | - name: Create Test Environment 60 | uses: microsoft/powerplatform-actions/create-environment@v0 61 | with: 62 | app-id: ${{secrets.CLIENT_ID}} 63 | client-secret: ${{ secrets.PowerPlatformSPN }} 64 | tenant-id: ${{secrets.TENANT_ID}} 65 | name: ${{ github.event.inputs.env_name}}_Test 66 | type: Sandbox 67 | domain: ${{ github.event.inputs.env_name}}Test 68 | 69 | - name: assign-user to test environment 70 | uses: microsoft/powerplatform-actions/assign-user@v0 71 | with: 72 | app-id: ${{secrets.CLIENT_ID}} 73 | client-secret: ${{ secrets.PowerPlatformSPN }} 74 | tenant-id: ${{secrets.TENANT_ID}} 75 | environment: 'https://${{ github.event.inputs.env_name}}Test.crm.dynamics.com' 76 | user: ${{ github.event.inputs.user_id }} 77 | role: System Administrator 78 | 79 | 80 | - name: Create Production Environment 81 | uses: microsoft/powerplatform-actions/create-environment@v0 82 | with: 83 | app-id: ${{secrets.CLIENT_ID}} 84 | client-secret: ${{ secrets.PowerPlatformSPN }} 85 | tenant-id: ${{secrets.TENANT_ID}} 86 | name: ${{ github.event.inputs.env_name}}_Prod 87 | type: Production 88 | domain: ${{ github.event.inputs.env_name}}Prod 89 | 90 | - name: assign-user to Prod environment 91 | uses: microsoft/powerplatform-actions/assign-user@v0 92 | with: 93 | app-id: ${{secrets.CLIENT_ID}} 94 | client-secret: ${{ secrets.PowerPlatformSPN }} 95 | tenant-id: ${{secrets.TENANT_ID}} 96 | environment: 'https://${{ github.event.inputs.env_name}}Prod.crm.dynamics.com' 97 | user: ${{ github.event.inputs.user_id }} 98 | role: System Administrator 99 | -------------------------------------------------------------------------------- /solutions/ALMLab/Other/Solution.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | ALMLab 5 | 6 | 7 | 8 | 9 | 1.0.0.0 10 | 0 11 | 12 | user9 13 | 14 | 15 | 16 | 17 | 18 | 19 | user9 20 | 84688 21 | 22 |
23 | 1 24 | 1 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 1 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 |
50 |
51 | 2 52 | 1 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 1 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 |
78 |
79 |
80 | 81 | 82 | 83 | 84 |
85 |
-------------------------------------------------------------------------------- /sample-workflows/release-solution-to-prod.yml: -------------------------------------------------------------------------------- 1 | name: release-solution-to-prod 2 | # prepare for releasing to prod: 3 | # convert solution to managed (using a build PowerPlatform environment for the conversion) 4 | # upload the solution to the GitHub artifacts and deploy to the PROD environment 5 | 6 | on: 7 | workflow_dispatch: 8 | inputs: 9 | # Change this value 10 | solution_name: 11 | description: 'name of the solution to worked on from Power Platform' 12 | required: true 13 | default: ALMLab 14 | #Do Not change these values 15 | solution_shipping_folder: 16 | description: 'folder name for staging the exported solution *do not change*' 17 | required: true 18 | default: out/ship/ 19 | solution_outbound_folder: 20 | description: 'staging the unpacked solution folder before check-in *do not change*' 21 | required: true 22 | default: out/solutions/ 23 | solution_source_folder: 24 | description: 'folder name to be created and checked in *do not change*' 25 | required: true 26 | default: solutions/ 27 | solution_release_folder: 28 | description: 'folder where the released binaries are going to be hosted *do not change*' 29 | required: true 30 | default: out/release 31 | release: 32 | types: [created] 33 | 34 | env: 35 | #edit your values here 36 | BUILD_ENVIRONMENT_URL: 37 | PRODUCTION_ENVIRONMENT_URL: 38 | USERNAME: 39 | 40 | permissions: 41 | contents: write 42 | jobs: 43 | convert-to-managed: 44 | runs-on: windows-latest 45 | env: 46 | RUNNER_DEBUG: 1 47 | 48 | steps: 49 | - uses: actions/checkout@v2 50 | with: 51 | lfs: true 52 | 53 | - name: Pack solution 54 | uses: microsoft/powerplatform-actions/pack-solution@v0 55 | with: 56 | solution-folder: ${{ github.event.inputs.solution_source_folder}}/${{ github.event.inputs.solution_name }} 57 | solution-file: ${{ github.event.inputs.solution_outbound_folder}}/${{ github.event.inputs.solution_name }}.zip 58 | solution-type: Unmanaged 59 | 60 | - name: Import solution as unmanaged to build env 61 | uses: microsoft/powerplatform-actions/import-solution@v0 62 | with: 63 | environment-url: ${{env.BUILD_ENVIRONMENT_URL}} 64 | user-name: ${{env.USERNAME}} 65 | password-secret: ${{ secrets.password }} 66 | solution-file: ${{ github.event.inputs.solution_outbound_folder}}/${{ github.event.inputs.solution_name }}.zip 67 | force-overwrite: true 68 | publish-changes: true 69 | 70 | - name: Export solution as managed 71 | uses: microsoft/powerplatform-actions/export-solution@v0 72 | with: 73 | environment-url: ${{env.BUILD_ENVIRONMENT_URL}} 74 | user-name: ${{env.USERNAME}} 75 | password-secret: ${{ secrets.password }} 76 | solution-name: ${{ github.event.inputs.solution_name }} 77 | managed: true 78 | solution-output-file: ${{ github.event.inputs.solution_shipping_folder}}/${{ github.event.inputs.solution_name }}.zip 79 | 80 | - name: Upload the ready to ship solution to GH artifact store 81 | uses: actions/upload-artifact@v2 82 | with: 83 | name: managedSolutions 84 | path: ${{ github.event.inputs.solution_shipping_folder}}/${{ github.event.inputs.solution_name }}.zip 85 | 86 | release-to-staging: 87 | needs: [ convert-to-managed ] 88 | runs-on: windows-latest 89 | env: 90 | RUNNER_DEBUG: 1 91 | 92 | steps: 93 | - uses: actions/checkout@v2 94 | with: 95 | lfs: true 96 | 97 | - name: Fetch the ready to ship solution from GH artifact store 98 | uses: actions/download-artifact@v2 99 | with: 100 | name: managedSolutions 101 | path: out/release/ 102 | 103 | - name: Import solution to prod env 104 | uses: microsoft/powerplatform-actions/import-solution@v0 105 | with: 106 | environment-url: ${{env.PRODUCTION_ENVIRONMENT_URL}} 107 | user-name: ${{env.USERNAME}} 108 | password-secret: ${{ secrets.password }} 109 | solution-file: ${{ github.event.inputs.solution_release_folder}}/${{ github.event.inputs.solution_name }}.zip 110 | force-overwrite: true 111 | publish-changes: true 112 | -------------------------------------------------------------------------------- /sample-workflows/release-solution-env-vars.yml: -------------------------------------------------------------------------------- 1 | name: release-solution-env-vars 2 | # prepare for releasing to prod: 3 | # convert solution to managed (using a build PowerPlatform environment for the conversion) 4 | # upload the solution to the GitHub artifacts and deploy to the PROD environment 5 | 6 | on: 7 | workflow_dispatch: 8 | 9 | release: 10 | types: [created] 11 | 12 | 13 | 14 | 15 | env: 16 | #edit your values here 17 | BUILD_ENVIRONMENT_URL: 'https://kartiksenv.crm.dynamics.com/' 18 | PRODUCTION_ENVIRONMENT_URL: 'https://kartiksenvqa.crm.dynamics.com' 19 | CLIENT_ID: 'd4416ad8-8ed5-4776-95b7-80985180bcc0' 20 | TENANT_ID: 'ec6b17bb-11d0-4195-abd0-521c69a5d1fd' 21 | solution_name: '' 22 | solution_shipping_folder: 'out/ship' 23 | solution_outbound_folder: 'solutions//bin/Debug' 24 | solution_source_folder: 'solutions/' 25 | solution_release_folder: 'out/release' 26 | 27 | permissions: 28 | contents: write 29 | 30 | jobs: 31 | convert-to-managed: 32 | #runs-on: ubuntu-latest 33 | runs-on: windows-latest 34 | # or you can say runs-on: ubuntu-latest 35 | env: 36 | RUNNER_DEBUG: 1 37 | 38 | steps: 39 | - uses: actions/checkout@v2 40 | with: 41 | lfs: true 42 | 43 | #- name: Setup .NET 44 | # uses: actions/setup-dotnet@v1 45 | # with: 46 | # dotnet-version: 5.0.x 47 | 48 | #- name: Pack solution 49 | # uses: microsoft/powerplatform-actions@v0 50 | #with: 51 | # solution-folder: ${{ github.event.inputs.solution_source_folder}}/${{ github.event.inputs.solution_name }} 52 | #solution-file: ${{ github.event.inputs.solution_outbound_folder}}/${{ github.event.inputs.solution_name }}.zip 53 | #solution-type: Unmanaged 54 | - name: who-am-i action 55 | uses: microsoft/powerplatform-actions/who-am-i@v0 56 | with: 57 | environment-url: ${{env.BUILD_ENVIRONMENT_URL}} 58 | app-id: ${{env.CLIENT_ID}} 59 | client-secret: ${{ secrets.PowerPlatformSPN }} 60 | tenant-id: ${{env.TENANT_ID}} 61 | 62 | - name: Import solution as unmanaged to build env 63 | uses: microsoft/powerplatform-actions/import-solution@v0 64 | with: 65 | environment-url: ${{env.BUILD_ENVIRONMENT_URL}} 66 | app-id: ${{env.CLIENT_ID}} 67 | client-secret: ${{ secrets.PowerPlatformSPN }} 68 | tenant-id: ${{env.TENANT_ID}} 69 | solution-file: ${{ env.solution_outbound_folder}}/${{ env.solution_name }}.zip 70 | run-asynchronously: true 71 | force-overwrite: true 72 | publish-changes: true 73 | 74 | - name: Export solution as managed 75 | uses: microsoft/powerplatform-actions/export-solution@v0 76 | with: 77 | environment-url: ${{env.BUILD_ENVIRONMENT_URL}} 78 | app-id: ${{env.CLIENT_ID}} 79 | client-secret: ${{ secrets.PowerPlatformSPN }} 80 | tenant-id: ${{env.TENANT_ID}} 81 | solution-name: ${{ env.solution_name }} 82 | managed: true 83 | solution-output-file: ${{ env.solution_shipping_folder}}/${{ env.solution_name }}.zip 84 | 85 | - name: Upload the ready to ship solution to GH artifact store 86 | uses: actions/upload-artifact@v2 87 | with: 88 | name: managedSolutions 89 | path: ${{ env.solution_shipping_folder}}/${{ env.solution_name }}.zip 90 | 91 | release-to-staging: 92 | needs: [ convert-to-managed ] 93 | runs-on: windows-latest 94 | env: 95 | RUNNER_DEBUG: 1 96 | 97 | steps: 98 | - uses: actions/checkout@v2 99 | with: 100 | lfs: true 101 | 102 | - name: Fetch the ready to ship solution from GH artifact store 103 | uses: actions/download-artifact@v2 104 | with: 105 | name: managedSolutions 106 | path: ${{ env.solution_release_folder}} 107 | - name: Import solution to prod env 108 | uses: microsoft/powerplatform-actions/import-solution@v0 109 | with: 110 | environment-url: ${{env.PRODUCTION_ENVIRONMENT_URL}} 111 | app-id: ${{env.CLIENT_ID}} 112 | client-secret: ${{ secrets.PowerPlatformSPN }} 113 | tenant-id: ${{env.TENANT_ID}} 114 | solution-file: ${{ env.solution_release_folder}}/${{ env.solution_name }}.zip 115 | run-asynchronously: true 116 | force-overwrite: true 117 | publish-changes: true 118 | -------------------------------------------------------------------------------- /sample-workflows/release-solution-with-githubvars.yml: -------------------------------------------------------------------------------- 1 | name: release-solution-to-prod-reusable 2 | # Reusable workflow 3 | # convert solution to managed (using a build PowerPlatform environment for the conversion) 4 | # upload the solution to the GitHub artifacts and deploy to the PROD environment 5 | on: 6 | workflow_call: 7 | inputs: 8 | #Do Not change these values 9 | #Values are set by the caller 10 | #caller sample: release-action-call.ymnl 11 | solution_name: 12 | description: 'The solution name.' 13 | type: string 14 | default: GitHubActionsLab 15 | root_folder: 16 | description: 'name of the folder where the solution is going unpacked' 17 | type: string 18 | default: ${{ github.event.repository.name }} 19 | zip_folder: 20 | description: 'name of the folder where the zip files reside' 21 | type: string 22 | default: ${{ github.event.repository.name }} 23 | BUILD_ENVIRONMENT_URL: 24 | description: 'Build environment url.' 25 | type: string 26 | required: true 27 | PRODUCTION_ENVIRONMENT_URL: 28 | description: 'Production environment url.' 29 | type: string 30 | required: true 31 | CLIENT_ID: 32 | description: 'The client id' 33 | type: string 34 | required: true 35 | TENANT_ID: 36 | description: 'The tenant id' 37 | type: string 38 | required: true 39 | secrets: 40 | envSecret: 41 | description: 'The secret value for authentication using SPN' 42 | required: true 43 | permissions: 44 | contents: write 45 | 46 | jobs: 47 | convert-to-managed: 48 | runs-on: ubuntu-latest 49 | # or you can say runs-on: ubuntu-latest 50 | env: 51 | RUNNER_DEBUG: 1 52 | 53 | steps: 54 | - uses: actions/checkout@v3 55 | with: 56 | lfs: true 57 | 58 | - name: Pack solution 59 | uses: microsoft/powerplatform-actions/pack-solution@v0 60 | with: 61 | solution-folder: ${{ inputs.root_folder}}/${{ inputs.solution_name }} 62 | solution-file: ${{ inputs.zip_folder}}/${{ inputs.solution_name }}.zip 63 | solution-type: Unmanaged 64 | 65 | - name: Import solution as unmanaged to build env 66 | uses: microsoft/powerplatform-actions/import-solution@v0 67 | with: 68 | environment-url: ${{inputs.BUILD_ENVIRONMENT_URL}} 69 | app-id: ${{inputs.CLIENT_ID}} 70 | client-secret: ${{ secrets.envSecret }} 71 | tenant-id: ${{inputs.TENANT_ID}} 72 | solution-file: ${{ inputs.zip_folder}}/${{ inputs.solution_name }}.zip 73 | force-overwrite: true 74 | publish-changes: true 75 | 76 | - name: Export solution as managed 77 | uses: microsoft/powerplatform-actions/export-solution@v0 78 | with: 79 | environment-url: ${{inputs.BUILD_ENVIRONMENT_URL}} 80 | app-id: ${{inputs.CLIENT_ID}} 81 | client-secret: ${{ secrets.envSecret }} 82 | tenant-id: ${{inputs.TENANT_ID}} 83 | solution-name: ${{ inputs.solution_name }} 84 | managed: true 85 | solution-output-file: ${{ inputs.zip_folder}}/${{ inputs.solution_name }}_managed.zip 86 | 87 | - name: Upload the ready to ship solution to GH artifact store 88 | uses: actions/upload-artifact@v2 89 | with: 90 | name: managedSolutions 91 | path: ${{ inputs.zip_folder}}/ 92 | 93 | release-to-staging: 94 | needs: [ convert-to-managed ] 95 | runs-on: windows-latest 96 | env: 97 | RUNNER_DEBUG: 1 98 | 99 | steps: 100 | - uses: actions/checkout@v3 101 | with: 102 | lfs: true 103 | 104 | - name: Fetch the ready to ship solution from GH artifact store 105 | uses: actions/download-artifact@v2 106 | with: 107 | name: managedSolutions 108 | path: ${{ inputs.zip_folder}} 109 | - name: Import solution to prod env 110 | uses: microsoft/powerplatform-actions/import-solution@v0 111 | with: 112 | environment-url: ${{inputs.PRODUCTION_ENVIRONMENT_URL}} 113 | app-id: ${{inputs.CLIENT_ID}} 114 | client-secret: ${{ secrets.envSecret }} 115 | tenant-id: ${{inputs.TENANT_ID}} 116 | solution-file: ${{ inputs.zip_folder}}/${{ inputs.solution_name }}_managed.zip 117 | force-overwrite: true 118 | publish-changes: true 119 | -------------------------------------------------------------------------------- /sample-workflows/release-solution-to-prod-with-spn-auth.yml: -------------------------------------------------------------------------------- 1 | name: release-solution-to-prod 2 | # prepare for releasing to prod: 3 | # convert solution to managed (using a build PowerPlatform environment for the conversion) 4 | # upload the solution to the GitHub artifacts and deploy to the PROD environment 5 | 6 | on: 7 | workflow_dispatch: 8 | inputs: 9 | # Change this value 10 | solution_name: 11 | description: 'name of the solution to worked on from Power Platform' 12 | required: true 13 | default: ALMLab 14 | #Do Not change these values 15 | solution_shipping_folder: 16 | description: 'folder name for staging the exported solution *do not change*' 17 | required: true 18 | default: out/ship/ 19 | solution_outbound_folder: 20 | description: 'staging the unpacked solution folder before check-in *do not change*' 21 | required: true 22 | default: out/solutions/ 23 | solution_source_folder: 24 | description: 'folder name to be created and checked in *do not change*' 25 | required: true 26 | default: solutions/ 27 | solution_release_folder: 28 | description: 'folder where the released binaries are going to be hosted *do not change*' 29 | required: true 30 | default: out/release 31 | release: 32 | types: [created] 33 | 34 | 35 | env: 36 | #edit your values here 37 | BUILD_ENVIRONMENT_URL: '' 38 | PRODUCTION_ENVIRONMENT_URL: '' 39 | CLIENT_ID: '' 40 | TENANT_ID: '' 41 | 42 | permissions: 43 | contents: write 44 | 45 | jobs: 46 | convert-to-managed: 47 | runs-on: windows-latest 48 | # or you can say runs-on: ubuntu-latest 49 | env: 50 | RUNNER_DEBUG: 1 51 | 52 | steps: 53 | - uses: actions/checkout@v2 54 | with: 55 | lfs: true 56 | 57 | - name: Pack solution 58 | uses: microsoft/powerplatform-actions/pack-solution@v0 59 | with: 60 | solution-folder: ${{ github.event.inputs.solution_source_folder}}/${{ github.event.inputs.solution_name }} 61 | solution-file: ${{ github.event.inputs.solution_outbound_folder}}/${{ github.event.inputs.solution_name }}.zip 62 | solution-type: Unmanaged 63 | 64 | - name: Import solution as unmanaged to build env 65 | uses: microsoft/powerplatform-actions/import-solution@v0 66 | with: 67 | environment-url: ${{env.BUILD_ENVIRONMENT_URL}} 68 | app-id: ${{env.CLIENT_ID}} 69 | client-secret: ${{ secrets.PowerPlatformSPN }} 70 | tenant-id: ${{env.TENANT_ID}} 71 | solution-file: ${{ github.event.inputs.solution_outbound_folder}}/${{ github.event.inputs.solution_name }}.zip 72 | force-overwrite: true 73 | publish-changes: true 74 | 75 | - name: Export solution as managed 76 | uses: microsoft/powerplatform-actions/export-solution@v0 77 | with: 78 | environment-url: ${{env.BUILD_ENVIRONMENT_URL}} 79 | app-id: ${{env.CLIENT_ID}} 80 | client-secret: ${{ secrets.PowerPlatformSPN }} 81 | tenant-id: ${{env.TENANT_ID}} 82 | solution-name: ${{ github.event.inputs.solution_name }} 83 | managed: true 84 | solution-output-file: ${{ github.event.inputs.solution_shipping_folder}}/${{ github.event.inputs.solution_name }}.zip 85 | 86 | - name: Upload the ready to ship solution to GH artifact store 87 | uses: actions/upload-artifact@v2 88 | with: 89 | name: managedSolutions 90 | path: ${{ github.event.inputs.solution_shipping_folder}}/${{ github.event.inputs.solution_name }}.zip 91 | 92 | release-to-staging: 93 | needs: [ convert-to-managed ] 94 | runs-on: windows-latest 95 | env: 96 | RUNNER_DEBUG: 1 97 | 98 | steps: 99 | - uses: actions/checkout@v2 100 | with: 101 | lfs: true 102 | 103 | - name: Fetch the ready to ship solution from GH artifact store 104 | uses: actions/download-artifact@v2 105 | with: 106 | name: managedSolutions 107 | path: ${{ github.event.inputs.solution_release_folder}} 108 | - name: Import solution to prod env 109 | uses: microsoft/powerplatform-actions/import-solution@v0 110 | with: 111 | environment-url: ${{env.PRODUCTION_ENVIRONMENT_URL}} 112 | app-id: ${{env.CLIENT_ID}} 113 | client-secret: ${{ secrets.PowerPlatformSPN }} 114 | tenant-id: ${{env.TENANT_ID}} 115 | solution-file: ${{ github.event.inputs.solution_release_folder}}/${{ github.event.inputs.solution_name }}.zip 116 | force-overwrite: true 117 | publish-changes: true 118 | -------------------------------------------------------------------------------- /sample-workflows/release-solution-to-prod-with-inputs.yml: -------------------------------------------------------------------------------- 1 | name: release-solution-to-prod-reusable 2 | # Reusable workflow 3 | # convert solution to managed (using a build PowerPlatform environment for the conversion) 4 | # upload the solution to the GitHub artifacts and deploy to the PROD environment 5 | on: 6 | workflow_call: 7 | inputs: 8 | #Do Not change these values 9 | #Values are set by the caller 10 | #caller sample: release-action-call.ymnl 11 | solution_name: 12 | description: 'The solution name.' 13 | type: string 14 | default: ALMLab 15 | solution_shipping_folder: 16 | description: 'folder name for staging the exported solution *do not change*' 17 | type: string 18 | default: out/ship/ 19 | solution_outbound_folder: 20 | description: 'staging the unpacked solution folder before check-in *do not change*' 21 | type: string 22 | default: out/solutions/ 23 | solution_source_folder: 24 | description: 'folder name to be created and checked in *do not change*' 25 | type: string 26 | default: solutions/ 27 | solution_release_folder: 28 | description: 'folder where the released binaries are going to be hosted *do not change*' 29 | type: string 30 | default: out/release 31 | BUILD_ENVIRONMENT_URL: 32 | description: 'Build environment url.' 33 | type: string 34 | required: true 35 | PRODUCTION_ENVIRONMENT_URL: 36 | description: 'Production environment url.' 37 | type: string 38 | required: true 39 | CLIENT_ID: 40 | description: 'The client id' 41 | type: string 42 | required: true 43 | TENANT_ID: 44 | description: 'The tenant id' 45 | type: string 46 | required: true 47 | secrets: 48 | envSecret: 49 | description: 'The secret value for authentication using SPN' 50 | required: true 51 | 52 | jobs: 53 | convert-to-managed: 54 | runs-on: windows-latest 55 | # or you can say runs-on: ubuntu-latest 56 | env: 57 | RUNNER_DEBUG: 1 58 | 59 | steps: 60 | - uses: actions/checkout@v2 61 | with: 62 | lfs: true 63 | 64 | - name: Pack solution 65 | uses: microsoft/powerplatform-actions/pack-solution@v0 66 | with: 67 | solution-folder: ${{ inputs.solution_source_folder}}/${{ inputs.solution_name }} 68 | solution-file: ${{ inputs.solution_outbound_folder}}/${{ inputs.solution_name }}.zip 69 | solution-type: Unmanaged 70 | 71 | - name: Import solution as unmanaged to build env 72 | uses: microsoft/powerplatform-actions/import-solution@v0 73 | with: 74 | environment-url: ${{inputs.BUILD_ENVIRONMENT_URL}} 75 | app-id: ${{inputs.CLIENT_ID}} 76 | client-secret: ${{ secrets.envSecret }} 77 | tenant-id: ${{inputs.TENANT_ID}} 78 | solution-file: ${{ inputs.solution_outbound_folder}}/${{ inputs.solution_name }}.zip 79 | force-overwrite: true 80 | publish-changes: true 81 | 82 | - name: Export solution as managed 83 | uses: microsoft/powerplatform-actions/export-solution@v0 84 | with: 85 | environment-url: ${{inputs.BUILD_ENVIRONMENT_URL}} 86 | app-id: ${{inputs.CLIENT_ID}} 87 | client-secret: ${{ secrets.envSecret }} 88 | tenant-id: ${{inputs.TENANT_ID}} 89 | solution-name: ${{ inputs.solution_name }} 90 | managed: true 91 | solution-output-file: ${{ inputs.solution_shipping_folder}}/${{ inputs.solution_name }}_managed.zip 92 | 93 | - name: Upload the ready to ship solution to GH artifact store 94 | uses: actions/upload-artifact@v2 95 | with: 96 | name: managedSolutions 97 | path: ${{ inputs.solution_shipping_folder}}/ 98 | 99 | release-to-staging: 100 | needs: [ convert-to-managed ] 101 | runs-on: windows-latest 102 | env: 103 | RUNNER_DEBUG: 1 104 | 105 | steps: 106 | - uses: actions/checkout@v2 107 | with: 108 | lfs: true 109 | 110 | - name: Fetch the ready to ship solution from GH artifact store 111 | uses: actions/download-artifact@v2 112 | with: 113 | name: managedSolutions 114 | path: ${{ inputs.solution_release_folder}} 115 | - name: Import solution to prod env 116 | uses: microsoft/powerplatform-actions/import-solution@v0 117 | with: 118 | environment-url: ${{inputs.PRODUCTION_ENVIRONMENT_URL}} 119 | app-id: ${{inputs.CLIENT_ID}} 120 | client-secret: ${{ secrets.envSecret }} 121 | tenant-id: ${{inputs.TENANT_ID}} 122 | solution-file: ${{ inputs.solution_release_folder}}/${{ inputs.solution_name }}_managed.zip 123 | force-overwrite: true 124 | publish-changes: true 125 | -------------------------------------------------------------------------------- /sample-workflows/exportandunpack.yml: -------------------------------------------------------------------------------- 1 | name: Export unpack and commit the solution 2 | run-name: Getting ${{ github.event.inputs.solution_name }} solution from environment ${{ github.event.inputs.environment_url }} environment and committing 3 | on: 4 | workflow_dispatch: 5 | inputs: 6 | solution_name: 7 | description: "name of the Solution in Dataverse environment" 8 | required: true 9 | default: yoursolutionname 10 | # environment_id: 11 | # description: "GUID of your Dataverse environment" 12 | # required: true 13 | # default: "GUID-OF-YOUR-ENVIRONMENT" 14 | environment_url: 15 | description: "http endpoint of your Dataverse environment" 16 | required: true 17 | default: "https://[your-env].crm.dynamics.com" 18 | source_branch: 19 | description: "source branch" 20 | required: true 21 | default: main 22 | branch_to_create: 23 | description: "branch to create" 24 | required: false 25 | commit_message: 26 | description: "message to provide for the commit" 27 | required: true 28 | allow_empty_commit: 29 | description: "allow an empty commit" 30 | required: true 31 | default: 'false' 32 | permissions: 33 | contents: write 34 | jobs: 35 | export-unpack-commit: 36 | runs-on: ubuntu-latest 37 | 38 | steps: 39 | - uses: actions/checkout@v3 40 | 41 | - if: ${{ false }} # this will never run, but will force powerplatform-actions to download 42 | name: Who Am I 43 | uses: microsoft/powerplatform-actions/who-am-i@latest 44 | with: 45 | app-id: ${{ secrets.CLIENT_ID }} 46 | client-secret: ${{ secrets.POWERPLATFORMSPN }} 47 | tenant-id: ${{ secrets.TENANT_ID }} 48 | environment-url: ${{ github.event.inputs.environment_url}} 49 | 50 | - name: create or checkout git branch 51 | if: github.event.inputs.branch_to_create != '' 52 | run: | 53 | $branchToFind = "${{ github.event.inputs.branch_to_create }}" 54 | $branches = git branch -a 55 | if ([System.String]::Join("",$branches).Contains($branchToFind)) { 56 | echo "checking out $branchToFind" 57 | git checkout $branchToFind 58 | git pull 59 | } 60 | else { 61 | git init 62 | git checkout -b ${{ github.event.inputs.branch_to_create }} ${{ github.event.inputs.source_branch }} 63 | } 64 | # We need to use pac directly. 65 | # So we set the path to pac that ships with the Actions 66 | 67 | 68 | # Runs a set of commands using the runners shell 69 | - name: export-solution action 70 | uses: microsoft/powerplatform-actions/export-solution@v0 71 | with: 72 | environment-url: ${{ github.event.inputs.environment_url}} 73 | app-id: ${{secrets.CLIENT_ID}} 74 | client-secret: ${{ secrets.PowerPlatformSPN }} 75 | tenant-id: ${{secrets.TENANT_ID}} 76 | solution-name: ${{ github.event.inputs.solution_name }} 77 | solution-output-file: ${{ github.event.repository.name }}/${{ github.event.inputs.solution_name }}_unmanaged.zip 78 | overwrite: true 79 | 80 | - name: unpack-solution action 81 | uses: microsoft/powerplatform-actions/unpack-solution@v0 82 | with: 83 | solution-file: ${{ github.event.repository.name }}/${{ github.event.inputs.solution_name }}_unmanaged.zip 84 | solution-folder: ${{ github.event.repository.name }}/${{ github.event.inputs.solution_name }} 85 | solution-type: 'Unmanaged' 86 | process-canvas-apps: true 87 | overwrite-files: true 88 | 89 | - name: export-managed-solution 90 | uses: microsoft/powerplatform-actions/export-solution@v0 91 | with: 92 | environment-url: ${{ github.event.inputs.environment_url}} 93 | app-id: ${{secrets.CLIENT_ID}} 94 | client-secret: ${{ secrets.PowerPlatformSPN }} 95 | tenant-id: ${{secrets.TENANT_ID}} 96 | solution-name: ${{ github.event.inputs.solution_name }} 97 | solution-output-file: ${{ github.event.repository.name }}/${{ github.event.inputs.solution_name }}_managed.zip 98 | overwrite: true 99 | managed: true 100 | 101 | - name: commit changes 102 | shell: pwsh 103 | run: | 104 | rm -rf ${{ github.event.repository.name }}/${{ github.event.inputs.solution_name }}_unmanaged.zip 105 | git config user.name "GitHub Actions Bot" 106 | git config user.email "<>" 107 | git pull 108 | git add --all 109 | $allowEmptyCommit = [System.Convert]::ToBoolean("${{ github.event.inputs.allow_empty_commit }}") 110 | if ($allowEmptyCommit) { 111 | git commit -am "${{ github.event.inputs.commit_message }}" --allow-empty 112 | } 113 | else { 114 | git pull 115 | git commit -am "${{ github.event.inputs.commit_message }}" --allow-empty 116 | } 117 | - name: push to ${{ github.event.inputs.source_branch }} 118 | if: github.event.inputs.branch_to_create == '' 119 | run: | 120 | git push origin main 121 | - name: push to ${{ github.event.inputs.branch_to_create }} 122 | if: github.event.inputs.branch_to_create != '' 123 | run: | 124 | git push --set-upstream origin ${{ github.event.inputs.branch_to_create }} 125 | -------------------------------------------------------------------------------- /solutions/ALMLab/Entities/user9_TimeOffRequest/FormXml/card/{1141388e-3f24-4bc7-9dbf-e1d8fb670dd9}.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | {1141388e-3f24-4bc7-9dbf-e1d8fb670dd9} 5 | 1.0 6 | 1 7 | 1 8 |
9 | 10 | 11 | 12 | 14 | 15 | 16 | 17 |
18 | 19 | 21 |
22 |
23 |
24 | 25 | 26 |
27 | 28 | 30 | 31 | 32 | 33 | 34 | 36 | 37 | 38 | 39 | 40 | 42 | 43 | 44 | 45 | 47 | 48 | 49 | 50 |
51 |
52 | 53 | 55 | 56 | 57 | 58 | 59 | 61 | 62 | 63 | 64 | 65 |
66 |
67 | 68 | 70 | 71 | 72 | 73 | 74 | 76 | 77 | 78 | 79 | 80 | 82 | 83 | 84 | 85 | 86 | 88 | 89 | 90 | 91 | 93 | 94 | 95 | 96 |
97 |
98 |
99 |
100 |
101 |
102 |
103 | 1 104 | 1 105 | 106 | 107 | 108 | 109 | 110 | 111 |
112 |
-------------------------------------------------------------------------------- /solutions/ALMLab/Entities/user9_TimeOffRequest/Entity.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | user9_TimeOffRequest 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | lookup 18 | createdby 19 | createdby 20 | none 21 | ValidForAdvancedFind|ValidForForm|ValidForGrid 22 | auto 23 | 0 24 | 1 25 | 0 26 | 0 27 | 0 28 | 0 29 | 1.0 30 | 1 31 | 1 32 | 1 33 | 1 34 | 1 35 | 0 36 | 0 37 | 0 38 | 1 39 | 1 40 | 0 41 | 42 | 0 43 | 0 44 | 0 45 | 0 46 | single 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | datetime 57 | createdon 58 | createdon 59 | none 60 | ValidForAdvancedFind|ValidForForm|ValidForGrid 61 | inactive 62 | 0 63 | 1 64 | 0 65 | 0 66 | 0 67 | 0 68 | 1.0 69 | 1 70 | 1 71 | 1 72 | 1 73 | 1 74 | 0 75 | 0 76 | 0 77 | 1 78 | 1 79 | 0 80 | 81 | 0 82 | 1 83 | 1 84 | 0 85 | datetime 86 | 0 87 | 1 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | lookup 97 | createdonbehalfby 98 | createdonbehalfby 99 | none 100 | ValidForAdvancedFind|ValidForForm|ValidForGrid 101 | auto 102 | 0 103 | 1 104 | 0 105 | 0 106 | 0 107 | 0 108 | 1.0 109 | 1 110 | 1 111 | 1 112 | 1 113 | 1 114 | 0 115 | 0 116 | 0 117 | 1 118 | 1 119 | 0 120 | 121 | 0 122 | 0 123 | 0 124 | 0 125 | single 126 | 127 | 128 | 129 | 130 | 131 | 132 | 133 | 134 | 135 | int 136 | importsequencenumber 137 | importsequencenumber 138 | none 139 | ValidForAdvancedFind 140 | disabled 141 | 0 142 | 1 143 | 1 144 | 0 145 | 1 146 | 0 147 | 1.0 148 | 1 149 | 1 150 | 1 151 | 1 152 | 1 153 | 0 154 | 0 155 | 0 156 | 1 157 | 1 158 | 0 159 | 160 | 0 161 | 0 162 | 0 163 | 0 164 | 165 | -2147483648 166 | 2147483647 167 | 168 | 169 | 170 | 171 | 172 | 173 | 174 | 175 | lookup 176 | modifiedby 177 | modifiedby 178 | none 179 | ValidForAdvancedFind|ValidForForm|ValidForGrid 180 | auto 181 | 0 182 | 1 183 | 0 184 | 0 185 | 0 186 | 0 187 | 1.0 188 | 1 189 | 1 190 | 1 191 | 1 192 | 1 193 | 0 194 | 0 195 | 0 196 | 1 197 | 1 198 | 0 199 | 200 | 0 201 | 0 202 | 0 203 | 0 204 | single 205 | 206 | 207 | 208 | 209 | 210 | 211 | 212 | 213 | 214 | datetime 215 | modifiedon 216 | modifiedon 217 | none 218 | ValidForAdvancedFind|ValidForForm|ValidForGrid 219 | inactive 220 | 0 221 | 1 222 | 0 223 | 0 224 | 0 225 | 0 226 | 1.0 227 | 1 228 | 1 229 | 1 230 | 1 231 | 1 232 | 0 233 | 0 234 | 0 235 | 1 236 | 1 237 | 0 238 | 239 | 0 240 | 1 241 | 1 242 | 0 243 | datetime 244 | 0 245 | 1 246 | 247 | 248 | 249 | 250 | 251 | 252 | 253 | 254 | lookup 255 | modifiedonbehalfby 256 | modifiedonbehalfby 257 | none 258 | ValidForAdvancedFind|ValidForForm|ValidForGrid 259 | auto 260 | 0 261 | 1 262 | 0 263 | 0 264 | 0 265 | 0 266 | 1.0 267 | 1 268 | 1 269 | 1 270 | 1 271 | 1 272 | 0 273 | 0 274 | 0 275 | 1 276 | 1 277 | 0 278 | 279 | 0 280 | 0 281 | 0 282 | 0 283 | single 284 | 285 | 286 | 287 | 288 | 289 | 290 | 291 | 292 | 293 | datetime 294 | overriddencreatedon 295 | overriddencreatedon 296 | none 297 | ValidForAdvancedFind|ValidForGrid 298 | inactive 299 | 0 300 | 1 301 | 1 302 | 0 303 | 1 304 | 0 305 | 1.0 306 | 1 307 | 1 308 | 1 309 | 1 310 | 1 311 | 0 312 | 0 313 | 0 314 | 1 315 | 1 316 | 0 317 | 318 | 0 319 | 0 320 | 0 321 | 0 322 | date 323 | 0 324 | 1 325 | 326 | 327 | 328 | 329 | 330 | 331 | 332 | 333 | owner 334 | ownerid 335 | ownerid 336 | systemrequired 337 | ValidForAdvancedFind|ValidForForm|ValidForGrid|RequiredForForm 338 | auto 339 | 1 340 | 1 341 | 1 342 | 0 343 | 1 344 | 0 345 | 1.0 346 | 1 347 | 1 348 | 1 349 | 1 350 | 1 351 | 0 352 | 0 353 | 0 354 | 1 355 | 1 356 | 0 357 | 358 | 0 359 | 1 360 | 0 361 | 0 362 | single 363 | 364 | 8 365 | 9 366 | 367 | 368 | 369 | 370 | 371 | 372 | 373 | 374 | 375 | lookup 376 | owningbusinessunit 377 | owningbusinessunit 378 | none 379 | auto 380 | 0 381 | 1 382 | 0 383 | 0 384 | 0 385 | 0 386 | 1.0 387 | 1 388 | 1 389 | 1 390 | 1 391 | 1 392 | 0 393 | 0 394 | 0 395 | 1 396 | 1 397 | 0 398 | 399 | 0 400 | 1 401 | 0 402 | 0 403 | single 404 | 405 | 406 | 407 | 408 | 409 | 410 | 411 | 412 | 413 | lookup 414 | owningteam 415 | owningteam 416 | none 417 | auto 418 | 0 419 | 1 420 | 0 421 | 0 422 | 0 423 | 1 424 | 0 425 | 1.0 426 | 1 427 | 1 428 | 1 429 | 1 430 | 1 431 | 0 432 | 0 433 | 0 434 | 1 435 | 1 436 | 0 437 | 438 | 0 439 | 0 440 | 0 441 | 0 442 | single 443 | 444 | 445 | 446 | 447 | 448 | 449 | 450 | 451 | 452 | lookup 453 | owninguser 454 | owninguser 455 | none 456 | auto 457 | 0 458 | 1 459 | 0 460 | 0 461 | 0 462 | 1 463 | 0 464 | 1.0 465 | 1 466 | 1 467 | 1 468 | 1 469 | 1 470 | 0 471 | 0 472 | 0 473 | 1 474 | 1 475 | 0 476 | 477 | 0 478 | 0 479 | 0 480 | 0 481 | single 482 | 483 | 484 | 485 | 486 | 487 | 488 | 489 | 490 | 491 | state 492 | statecode 493 | statecode 494 | systemrequired 495 | ValidForAdvancedFind|ValidForForm|ValidForGrid 496 | auto 497 | 1 498 | 1 499 | 0 500 | 0 501 | 1 502 | 0 503 | 1.0 504 | 1 505 | 1 506 | 1 507 | 1 508 | 1 509 | 0 510 | 0 511 | 0 512 | 1 513 | 1 514 | 0 515 | 516 | 0 517 | 1 518 | 0 519 | 0 520 | 521 | state 522 | 1.0 523 | 1 524 | 525 | 526 | 527 | 528 | 529 | 530 | 531 | 532 | 533 | 535 | 536 | 537 | 538 | 540 | 541 | 542 | 543 | 544 | 545 | 546 | 547 | 548 | 549 | 550 | 551 | status 552 | statuscode 553 | statuscode 554 | none 555 | ValidForAdvancedFind|ValidForForm|ValidForGrid 556 | auto 557 | 1 558 | 1 559 | 1 560 | 0 561 | 1 562 | 0 563 | 1.0 564 | 1 565 | 1 566 | 1 567 | 1 568 | 1 569 | 0 570 | 0 571 | 0 572 | 1 573 | 1 574 | 0 575 | 576 | 0 577 | 0 578 | 0 579 | 0 580 | 581 | status 582 | 1.0 583 | 1 584 | 585 | 586 | 587 | 588 | 589 | 590 | 591 | 592 | 593 | 595 | 596 | 597 | 598 | 600 | 601 | 602 | 603 | 604 | 605 | 606 | 607 | 608 | 609 | 610 | 611 | int 612 | timezoneruleversionnumber 613 | timezoneruleversionnumber 614 | none 615 | auto 616 | 1 617 | 1 618 | 1 619 | 0 620 | 0 621 | 0 622 | 1.0 623 | 1 624 | 1 625 | 1 626 | 1 627 | 1 628 | 0 629 | 0 630 | 0 631 | 1 632 | 1 633 | 0 634 | 635 | 0 636 | 0 637 | 0 638 | 0 639 | 640 | -1 641 | 2147483647 642 | 643 | 644 | 645 | 646 | 647 | 648 | 649 | 650 | nvarchar 651 | user9_name 652 | user9_name 653 | required 654 | PrimaryName|ValidForAdvancedFind|ValidForForm|ValidForGrid|RequiredForForm 655 | auto 656 | 1 657 | 1 658 | 1 659 | 1 660 | 1 661 | 0 662 | 1.0 663 | 1 664 | 1 665 | 1 666 | 1 667 | 1 668 | 0 669 | 0 670 | 0 671 | 1 672 | 1 673 | 0 674 | 675 | 1 676 | 0 677 | 1 678 | 0 679 | text 680 | 100 681 | 200 682 | 683 | 684 | 685 | 686 | 687 | 688 | 689 | 690 | primarykey 691 | user9_timeoffrequestid 692 | user9_timeoffrequestid 693 | systemrequired 694 | ValidForAdvancedFind|RequiredForGrid 695 | auto 696 | 0 697 | 1 698 | 1 699 | 0 700 | 0 701 | 0 702 | 1.0 703 | 1 704 | 1 705 | 1 706 | 0 707 | 1 708 | 0 709 | 0 710 | 0 711 | 1 712 | 1 713 | 0 714 | 715 | 0 716 | 1 717 | 1 718 | 0 719 | 720 | 721 | 722 | 723 | 724 | 725 | 726 | 727 | int 728 | utcconversiontimezonecode 729 | utcconversiontimezonecode 730 | none 731 | auto 732 | 1 733 | 1 734 | 1 735 | 0 736 | 0 737 | 0 738 | 1.0 739 | 1 740 | 1 741 | 1 742 | 1 743 | 1 744 | 0 745 | 0 746 | 0 747 | 1 748 | 1 749 | 0 750 | 751 | 0 752 | 0 753 | 0 754 | 0 755 | 756 | -1 757 | 2147483647 758 | 759 | 760 | 761 | 762 | 763 | 764 | 765 | 766 | user9_timeoffrequests 767 | 1 768 | 0 769 | 0 770 | 0 771 | 0 772 | 0 773 | 0 774 | 0 775 | 0 776 | 0 777 | 0 778 | 0 779 | 0 780 | 0 781 | UserOwned 782 | 0 783 | 0 784 | 0 785 | 0 786 | CommunicationActivity 787 | 0 788 | 0 789 | 0 790 | 1 791 | 0 792 | 0 793 | 0 794 | 0 795 | 0 796 | 797 | 1 798 | 1 799 | 0 800 | 0 801 | 1.0 802 | 1 803 | 1 804 | 1 805 | 1 806 | 1 807 | 1 808 | 1 809 | 1 810 | 1 811 | 1 812 | 1 813 | 1 814 | 1 815 | 1 816 | 1 817 | 1 818 | 1 819 | 1 820 | 0 821 | 1 822 | 0 823 | 0 824 | 1 825 | 0 826 | 0 827 | 828 | 829 | 830 | 831 | 832 | --------------------------------------------------------------------------------