Skip to content

Commit

Permalink
Merge Actions
Browse files Browse the repository at this point in the history
  • Loading branch information
ChrisMcKee1 committed May 4, 2022
1 parent 5536197 commit 8ffe000
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 181 deletions.
86 changes: 31 additions & 55 deletions .github/workflows/release-solution-to-prod-manual.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,55 +4,8 @@ name: release-solution-to-prod-manual
# upload the solution to the GitHub artifacts and deploy to the PROD environment
# Useful trigger types [workflow_call, workflow_dispatch]
on:
workflow_call:
inputs:
# Change this value
solution_name:
required: false
type: string
#Do Not change these values
solution_shipping_folder:
required: false
type: string
solution_outbound_folder:
required: false
type: string
solution_source_folder:
required: false
type: string
solution_release_folder:
required: false
type: string

workflow_dispatch:
inputs:
# Change this value
solution_name:
description: 'name of the solution to worked on from Power Platform'
required: false
default: FedExDemo
type: string
#Do Not change these values
solution_shipping_folder:
description: 'folder name for staging the exported solution *do not change*'
required: false
default: out/ship/
type: string
solution_outbound_folder:
description: 'staging the unpacked solution folder before check-in *do not change*'
required: false
default: out/solutions/
type: string
solution_source_folder:
description: 'folder name to be created and checked in *do not change*'
required: false
default: solutions/
type: string
solution_release_folder:
description: 'folder where the released binaries are going to be hosted *do not change*'
required: false
default: out/release
type: string
release:
types: [created]

env:
#edit your values here
Expand All @@ -61,6 +14,11 @@ env:
CLIENT_ID: ${{ secrets.APPLICATION_ID }}
TENANT_ID: ${{ secrets.TENANT_ID }}
CLIENT_SECRET: ${{ secrets.CLIENT_SECRET }}
SOLUTION_NAME: Demo
SOLUTION_SHIPPING_FOLDER: out/ship/
SOLUTION_OUTBOUND_FOLDER: out/solutions/
SOLUTION_SOURCE_FOLDER: solutions/
SOLUTION_RELEASE_FOLDER: out/release

jobs:
convert-to-managed:
Expand All @@ -72,7 +30,7 @@ jobs:
- uses: actions/checkout@v2
with:
lfs: true

- name: who-am-i action
uses: microsoft/powerplatform-actions/[email protected]
with:
Expand All @@ -81,22 +39,40 @@ jobs:
client-secret: ${{ env.CLIENT_SECRET }}
tenant-id: ${{ env.TENANT_ID }}

- name: Pack solution
uses: microsoft/powerplatform-actions/[email protected]
with:
solution-folder: ${{ env.SOLUTION_SOURCE_FOLDER}}/${{ env.SOLUTION_NAME }}
solution-file: ${{ env.SOLUTION_OUTBOUND_FOLDER}}/${{ env.SOLUTION_NAME }}.zip
solution-type: Unmanaged

- name: Import solution as unmanaged to build env
uses: microsoft/powerplatform-actions/[email protected]
with:
environment-url: ${{env.BUILD_ENVIRONMENT_URL}}
app-id: ${{env.CLIENT_ID}}
client-secret: ${{ env.CLIENT_SECRET}}
tenant-id: ${{env.TENANT_ID}}
solution-file: ${{ env.SOLUTION_OUTBOUND_FOLDER}}/${{ env.SOLUTION_NAME }}.zip
force-overwrite: true
publish-changes: true

- name: Export solution as unmanaged
uses: microsoft/powerplatform-actions/[email protected]
with:
environment-url: ${{env.BUILD_ENVIRONMENT_URL}}
app-id: ${{env.CLIENT_ID}}
client-secret: ${{ env.CLIENT_SECRET}}
tenant-id: ${{env.TENANT_ID}}
solution-name: ${{ github.event.inputs.solution_name}}
solution-name: ${{ env.SOLUTION_NAME}}
managed: true
solution-output-file: ${{ github.event.inputs.solution_shipping_folder}}/${{ github.event.inputs.solution_name }}.zip
solution-output-file: ${{ env.SOLUTION_SHIPPING_FOLDER}}/${{ env.SOLUTION_NAME }}.zip

- name: Upload the ready to ship solution to GH artifact store
uses: actions/upload-artifact@v2
with:
name: managedSolutions
path: ${{ github.event.inputs.solution_shipping_folder}}/${{ github.event.inputs.solution_name }}.zip
path: ${{ env.SOLUTION_SHIPPING_FOLDER}}/${{ env.SOLUTION_NAME }}.zip

release-to-staging:
needs: [ convert-to-managed ]
Expand All @@ -113,14 +89,14 @@ jobs:
uses: actions/download-artifact@v2
with:
name: managedSolutions
path: ${{ github.event.inputs.solution_release_folder}}
path: ${{ env.SOLUTION_RELEASE_FOLDER}}
- name: Import solution to prod env
uses: microsoft/powerplatform-actions/[email protected]
with:
environment-url: ${{env.PRODUCTION_ENVIRONMENT_URL}}
app-id: ${{env.CLIENT_ID}}
client-secret: ${{ env.CLIENT_SECRET }}
tenant-id: ${{env.TENANT_ID}}
solution-file: ${{ github.event.inputs.solution_release_folder}}/${{ github.event.inputs.solution_name }}.zip
solution-file: ${{ env.SOLUTION_RELEASE_FOLDER}}/${{ env.SOLUTION_NAME }}.zip
force-overwrite: true
publish-changes: true
126 changes: 0 additions & 126 deletions .github/workflows/release-solution-to-prod.yml

This file was deleted.

0 comments on commit 8ffe000

Please sign in to comment.