Skip to content

add sample workflows as running workflows #5

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Sep 22, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
52 changes: 52 additions & 0 deletions .github/workflows/export-and-branch-solution.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
name: export-and-branch-solution
# Export solution from DEV environment
# unpack it and prepare, commit and push a git branch with the changes

on:
push:
branches: [ main ]
pull_request:
branches: [ main ]

jobs:
export-from-dev:
runs-on: windows-latest
env:
RUNNER_DEBUG: 1

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

- name: who-am-i action
uses: microsoft/powerplatform-actions/[email protected]
with:
environment-url: 'https://user9-dev.crm.dynamics.com/'
user-name: '[email protected]'
password-secret: ${{ secrets.password }}

- name: export-solution action
uses: microsoft/powerplatform-actions/[email protected]
with:
environment-url: 'https://user9-dev.crm.dynamics.com/'
user-name: '[email protected]'
password-secret: ${{ secrets.password }}
solution-name: ALMLab
solution-output-file: out/exported/ALMLab.zip

- name: unpack-solution action
uses: microsoft/powerplatform-actions/[email protected]
with:
solution-file: out/exported/ALMLab.zip
solution-folder: out/solutions/ALMLab
solution-type: 'Unmanaged'
overwrite-files: true

- name: branch-solution, prepare it for a PullRequest
uses: microsoft/powerplatform-actions/[email protected]
with:
solution-folder: out/solutions/ALMLab
solution-target-folder: solutions/ALMLab
repo-token: ${{ secrets.GITHUB_TOKEN }}
allow-empty-commit: true
81 changes: 81 additions & 0 deletions .github/workflows/release-solution-to-prod.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
name: release-solution-to-prod
# prepare for releasing to prod:
# convert solution to managed (using a build PowerPlatform environment for the conversion)
# upload the solution to the GitHub artifacts and deploy to the PROD environment

on:
release:
types: [created]

jobs:
convert-to-managed:
runs-on: windows-latest
env:
RUNNER_DEBUG: 1

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

- name: Pack solution
uses: microsoft/powerplatform-actions/[email protected]
with:
solution-folder: solutions/ALMLab
solution-file: out/solutions/ALMLab.zip
solution-type: Unmanaged

- name: Import solution as unmanaged to build env
uses: microsoft/powerplatform-actions/[email protected]
with:
environment-url: 'https://user9-build.crm.dynamics.com/'
user-name: '[email protected]'
password-secret: ${{ secrets.password }}
solution-file: out/solutions/ALMLab.zip
force-overwrite: true
publish-changes: true

- name: Export solution as managed
uses: microsoft/powerplatform-actions/[email protected]
with:
environment-url: 'https://user9-build.crm.dynamics.com/'
user-name: '[email protected]'
password-secret: ${{ secrets.password }}
solution-name: ALMLab
managed: true
solution-output-file: out/ship/ALMLab.zip

- name: Upload the ready to ship solution to GH artifact store
uses: actions/upload-artifact@v2
with:
name: managedSolutions
path: out/ship/ALMLab.zip

release-to-staging:
needs: [ convert-to-managed ]
runs-on: windows-latest
env:
RUNNER_DEBUG: 1

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

- name: Fetch the ready to ship solution from GH artifact store
uses: actions/download-artifact@v2
with:
name: managedSolutions
path: out/release/

- run: get-childitem .\out\release\

- name: Import solution to prod env
uses: microsoft/powerplatform-actions/[email protected]
with:
environment-url: 'https://user9-prod.crm.dynamics.com/'
user-name: '[email protected]'
password-secret: ${{ secrets.password }}
solution-file: out/release/ALMLab.zip
force-overwrite: true
publish-changes: true
Binary file removed ALMLab_1_0_0_1.zip
Binary file not shown.
102 changes: 51 additions & 51 deletions buildmanaged.yml → sample-workflows/buildmanaged.yml
Original file line number Diff line number Diff line change
@@ -1,52 +1,52 @@
# GitHub workflow to generate managed solution (build artifact)
name: convert-to-managed
on:
pull_request:
branches: [ main ]
release:
types: [created]
jobs:
build:
runs-on: windows-latest
env:
RUNNER_DEBUG: 1
steps:
- uses: actions/checkout@v2
with:
lfs: true
- name: Pack solution
uses: microsoft/powerplatform-actions/pack-solution@v0
with:
solution-folder: 'solutions/ALMLab-staged'
solution-file: out/CI/solutions/ALMLab.zip
solution-type: Unmanaged
- name: Import solution as unmanaged to build env
uses: microsoft/powerplatform-actions/import-solution@v0
with:
environment-url: '<BUILDENVIRONMENT'
user-name: '<USERNAME>'
password-secret: ${{ secrets.password }}
solution-file: 'out/CI/solutions/ALMLab.zip'
force-overwrite: true
publish-changes: true
- name: Export solution as managed
uses: microsoft/powerplatform-actions/export-solution@v0
with:
environment-url: '<BUILDENVIRONMENT>'
user-name: '<USERNAME>'
password-secret: ${{ secrets.password }}
solution-name: ALMLab
managed: true
solution-output-file: out/ship/ALMLab.zip
- name: Upload the ready to ship solution to GH artifact store
uses: actions/upload-artifact@v2
with:
name: managedSolutions
# GitHub workflow to generate managed solution (build artifact)
name: convert-to-managed

on:
pull_request:
branches: [ main ]
release:
types: [created]

jobs:
build:
runs-on: windows-latest
env:
RUNNER_DEBUG: 1

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

- name: Pack solution
uses: microsoft/powerplatform-actions/pack-solution@v0
with:
solution-folder: 'solutions/ALMLab-staged'
solution-file: out/CI/solutions/ALMLab.zip
solution-type: Unmanaged

- name: Import solution as unmanaged to build env
uses: microsoft/powerplatform-actions/import-solution@v0
with:
environment-url: '<BUILDENVIRONMENT'
user-name: '<USERNAME>'
password-secret: ${{ secrets.password }}
solution-file: 'out/CI/solutions/ALMLab.zip'
force-overwrite: true
publish-changes: true

- name: Export solution as managed
uses: microsoft/powerplatform-actions/export-solution@v0
with:
environment-url: '<BUILDENVIRONMENT>'
user-name: '<USERNAME>'
password-secret: ${{ secrets.password }}
solution-name: ALMLab
managed: true
solution-output-file: out/ship/ALMLab.zip

- name: Upload the ready to ship solution to GH artifact store
uses: actions/upload-artifact@v2
with:
name: managedSolutions
path: out/ship/ALMLab.zip
102 changes: 51 additions & 51 deletions export.yml → sample-workflows/export.yml
Original file line number Diff line number Diff line change
@@ -1,51 +1,51 @@
# GitHub workflow to generate export a solution from an environment and unpack it to a new branch
name: export
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
jobs:
build:
runs-on: windows-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
uses: ./microsoft/powerplatform-actions/who-am-i
with:
environment-url: '<ENVIRONMENTURL>'
user-name: '<USERNAME>'
password-secret: ${{ secrets.password }}
- name: export-solution action
# uses: microsoft/powerplatform-actions/export-solution@v0
uses: ./microsoft/powerplatform-actions/export-solution
with:
environment-url: '<ENVIRONMENTURL>'
user-name: '<USERNAME>'
password-secret: ${{ secrets.password }}
solution-name: ALMLab
solution-output-file: 'ALMLab.zip'
working-directory: 'out/CI'
- name: unpack-solution action
# uses: microsoft/powerplatform-actions/unpack-solution@v0
uses: ./microsoft/powerplatform-actions/unpack-solution
with:
solution-file: 'out/CI/ALMLab.zip'
solution-folder: 'out/CI/solutions/ALMLab'
solution-type: 'Unmanaged'
overwrite-files: true
- name: branch-solution for Covid19Screening
# uses: microsoft/powerplatform-actions/branch-solution@v0
uses: ./microsoft/powerplatform-actions/branch-solution
with:
solution-folder: 'out/CI/solutions/Covid19Screening'
solution-target-folder: 'solutions/Covid19Screening'
repo-token: ${{ secrets.GITHUB_TOKEN }}
- name: List Covid19Screening solution
run: |
cmd /c "dir /s /b out\CI\solutions\ALMLAB"
# GitHub workflow to generate export a solution from an environment and unpack it to a new branch
name: export
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
jobs:
build:
runs-on: windows-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
uses: ./microsoft/powerplatform-actions/who-am-i
with:
environment-url: '<ENVIRONMENTURL>'
user-name: '<USERNAME>'
password-secret: ${{ secrets.password }}
- name: export-solution action
# uses: microsoft/powerplatform-actions/export-solution@v0
uses: ./microsoft/powerplatform-actions/export-solution
with:
environment-url: '<ENVIRONMENTURL>'
user-name: '<USERNAME>'
password-secret: ${{ secrets.password }}
solution-name: ALMLab
solution-output-file: 'ALMLab.zip'
working-directory: 'out/CI'
- name: unpack-solution action
# uses: microsoft/powerplatform-actions/unpack-solution@v0
uses: ./microsoft/powerplatform-actions/unpack-solution
with:
solution-file: 'out/CI/ALMLab.zip'
solution-folder: 'out/CI/solutions/ALMLab'
solution-type: 'Unmanaged'
overwrite-files: true
- name: branch-solution for Covid19Screening
# uses: microsoft/powerplatform-actions/branch-solution@v0
uses: ./microsoft/powerplatform-actions/branch-solution
with:
solution-folder: 'out/CI/solutions/Covid19Screening'
solution-target-folder: 'solutions/Covid19Screening'
repo-token: ${{ secrets.GITHUB_TOKEN }}
- name: List Covid19Screening solution
run: |
cmd /c "dir /s /b out\CI\solutions\ALMLAB"
3 changes: 3 additions & 0 deletions solutions/ALMLab_1_0_0_1.zip
Git LFS file not shown