Skip to content

Commit

Permalink
Infrastructure (#1)
Browse files Browse the repository at this point in the history
  • Loading branch information
jfevia authored Jul 2, 2024
1 parent b393f11 commit 9ab4b4a
Show file tree
Hide file tree
Showing 11 changed files with 210 additions and 2 deletions.
49 changes: 49 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
name: PowerAutomate.Desktop.Modules-CI

on:
push:
branches:
- main

env:
CONFIGURATION: "Release"
ENVIRONMENT: "Production"

jobs:
build:
runs-on: windows-latest

steps:
- name: Checkout
if: ${{ success() }}
uses: actions/checkout@v3
with:
fetch-depth: 0

- name: Install Power Automate for desktop
if: ${{ success() }}
run: |
Invoke-WebRequest -Uri https://go.microsoft.com/fwlink/?linkid=2164365 -OutFile PADSetup.exe
.\PADSetup.exe -Install -AcceptEULA -Silent
Start-Sleep -Seconds 10
$processName = "PADSetup"
do {
Write-Host "Waiting for process to exit..."
Start-Sleep -Seconds 10
} while (Get-Process -Name $processName -ErrorAction SilentlyContinue)
- name: Setup MSBuild
if: ${{ success() }}
uses: microsoft/setup-msbuild@v1.3.1

- name: Restore solution
if: ${{ success() }}
run: msbuild src\PowerAutomate.Desktop.Modules.sln -target:restore -property:Configuration=${{ env.CONFIGURATION }} -property:Environment=${{ env.ENVIRONMENT }}

- name: Build solution filter
if: ${{ success() }}
run: msbuild src\build.slnf -target:rebuild -property:Configuration=${{ env.CONFIGURATION }} -property:Environment=${{ env.ENVIRONMENT }}

- name: Run unit tests
if: ${{ success() }}
run: dotnet test src\build.slnf
49 changes: 49 additions & 0 deletions .github/workflows/nightly.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
name: PowerAutomate.Desktop.Modules-Nightly

on:
schedule:
- cron: '0 0 * * *'

env:
REPOSITORY_URL: "jfevia/PowerAutomate.Desktop.Modules"
CONFIGURATION: "Release"
ENVIRONMENT: "Production"

jobs:
build:
runs-on: windows-latest

steps:
- name: Checkout
if: ${{ success() }}
uses: actions/checkout@v3
with:
fetch-depth: 0

- name: Install Power Automate for desktop
if: ${{ success() }}
run: |
Invoke-WebRequest -Uri https://go.microsoft.com/fwlink/?linkid=2164365 -OutFile PADSetup.exe
.\PADSetup.exe -Install -AcceptEULA -Silent
Start-Sleep -Seconds 10
$processName = "PADSetup"
do {
Write-Host "Waiting for process to exit..."
Start-Sleep -Seconds 10
} while (Get-Process -Name $processName -ErrorAction SilentlyContinue)
- name: Setup MSBuild
if: ${{ success() }}
uses: microsoft/setup-msbuild@v1.3.1

- name: Restore solution
if: ${{ success() }}
run: msbuild src\PowerAutomate.Desktop.Modules.sln -target:restore -property:Configuration=${{ env.CONFIGURATION }} -property:Environment=${{ env.ENVIRONMENT }}

- name: Build solution filter
if: ${{ success() }}
run: msbuild src\build.slnf -target:rebuild -property:Configuration=${{ env.CONFIGURATION }} -property:Environment=${{ env.ENVIRONMENT }}

- name: Run unit tests
if: ${{ success() }}
run: dotnet test src\build.slnf
49 changes: 49 additions & 0 deletions .github/workflows/pr.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
name: PowerAutomate.Desktop.Modules-PR

on:
pull_request:
branches:
- main

env:
CONFIGURATION: "Release"
ENVIRONMENT: "Production"

jobs:
build:
runs-on: windows-latest

steps:
- name: Checkout
if: ${{ success() }}
uses: actions/checkout@v3
with:
fetch-depth: 0

- name: Install Power Automate for desktop
if: ${{ success() }}
run: |
Invoke-WebRequest -Uri https://go.microsoft.com/fwlink/?linkid=2164365 -OutFile PADSetup.exe
.\PADSetup.exe -Install -AcceptEULA -Silent
Start-Sleep -Seconds 10
$processName = "PADSetup"
do {
Write-Host "Waiting for process to exit..."
Start-Sleep -Seconds 10
} while (Get-Process -Name $processName -ErrorAction SilentlyContinue)
- name: Setup MSBuild
if: ${{ success() }}
uses: microsoft/setup-msbuild@v1.3.1

- name: Restore solution
if: ${{ success() }}
run: msbuild src\PowerAutomate.Desktop.Modules.sln -target:restore -property:Configuration=${{ env.CONFIGURATION }} -property:Environment=${{ env.ENVIRONMENT }}

- name: Build solution filter
if: ${{ success() }}
run: msbuild src\build.slnf -target:rebuild -property:Configuration=${{ env.CONFIGURATION }} -property:Environment=${{ env.ENVIRONMENT }}

- name: Run unit tests
if: ${{ success() }}
run: dotnet test src\build.slnf
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -395,4 +395,5 @@ FodyWeavers.xsd
*.msp

# JetBrains Rider
*.sln.iml
.idea/
*.sln.iml
15 changes: 15 additions & 0 deletions Directory.Build.props
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
<Project>

<PropertyGroup>
<ProductName>PowerAutomate.Desktop.Modules</ProductName>
<RootNamespace>$(ProductName).$(MSBuildProjectName)</RootNamespace>
<AssemblyName>$(ProductName).$(MSBuildProjectName)</AssemblyName>
<AppendTargetFrameworkToOutputPath>false</AppendTargetFrameworkToOutputPath>
<Environment Condition=" '$(Environment)' == '' ">Development</Environment>
</PropertyGroup>

<PropertyGroup Condition=" '$(Environment)' != '' ">
<DefineConstants>$(DefineConstants);ENVIRONMENT_$(Environment.ToUpper())</DefineConstants>
</PropertyGroup>

</Project>
9 changes: 9 additions & 0 deletions Directory.Packages.props
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<Project>
<PropertyGroup>
<ManagePackageVersionsCentrally>true</ManagePackageVersionsCentrally>
<CentralPackageTransitivePinningEnabled>false</CentralPackageTransitivePinningEnabled>
</PropertyGroup>
<ItemGroup>
<PackageVersion Include="Microsoft.PowerPlatform.PowerAutomate.Desktop.Actions.SDK" Version="1.4.233.23144-rc" />
</ItemGroup>
</Project>
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1 +1 @@
# power-automate-desktop-custom-modules
# PowerAutomate.Desktop.Modules
12 changes: 12 additions & 0 deletions nuget.config
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<packageSources>
<clear />
<add key="nuget.org" value="https://api.nuget.org/v3/index.json" protocolVersion="3" />
</packageSources>
<packageSourceMapping>
<packageSource key="nuget.org">
<package pattern="*" />
</packageSource>
</packageSourceMapping>
</configuration>
8 changes: 8 additions & 0 deletions src/PowerAutomate.Desktop.Modules.sln
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@

Microsoft Visual Studio Solution File, Format Version 12.00
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU
EndGlobalSection
EndGlobal
6 changes: 6 additions & 0 deletions src/build.slnf
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"solution": {
"path": "PowerAutomate.Desktop.Modules.sln",
"projects": []
}
}
10 changes: 10 additions & 0 deletions tests/Directory.Build.props
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<Project>

<Import Project="$([MSBuild]::GetPathOfFileAbove('Directory.Build.props', '$(MSBuildThisFileDirectory)..\'))" />

<PropertyGroup>
<AppendTargetFrameworkToOutputPath>false</AppendTargetFrameworkToOutputPath>
<OutputPath>bin\$(Configuration)</OutputPath>
</PropertyGroup>

</Project>

0 comments on commit 9ab4b4a

Please sign in to comment.