Skip to content

Update dependency Microsoft.Identity.Client to 4.67.1 (#34) #167

Update dependency Microsoft.Identity.Client to 4.67.1 (#34)

Update dependency Microsoft.Identity.Client to 4.67.1 (#34) #167

Workflow file for this run

name: Build / publish
on:
push:
pull_request:
types: [opened, reopened]
release:
types: [published]
jobs:
main:
strategy:
matrix:
include:
- os: ubuntu-latest
powershell: false
publish: false
- os: windows-latest
powershell: true
publish: true
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
- name: Build
shell: pwsh
run: |
if ($env:GITHUB_REF -like "refs/tags/*") {
$versionnumber = $env:GITHUB_REF -replace "refs/tags/", ""
$manifestpath = "Rnwood.Dataverse.Data.PowerShell//Rnwood.Dataverse.Data.PowerShell.psd1"
(get-content -raw -encoding UTF8 $manifestpath ) -replace "ModuleVersion ?=.*", "ModuleVersion = `"$versionnumber`"" | set-content -encoding UTF8 $manifestpath
}
dotnet build -c Release ./Rnwood.Dataverse.Data.PowerShell/Rnwood.Dataverse.Data.PowerShell.csproj
if (test-path out/Rnwood.Dataverse.Data.PowerShell) {
remove-item -force -recurse out/Rnwood.Dataverse.Data.PowerShell
}
copy-item -recurse Rnwood.Dataverse.Data.PowerShell\bin\Release\netstandard2.0 out/Rnwood.Dataverse.Data.PowerShell
- name: Test - pwsh
shell: pwsh
run: |
$env:TESTMODULEPATH=(resolve-path "out/Rnwood.Dataverse.Data.PowerShell")
Install-Module -force Pester
Invoke-Pester -output detailed -path tests
if ($LASTEXITCODE -ne 0) {
throw "Tests failed"
}
- if: ${{ matrix.powershell }}
name: Test - powershell
shell: powershell
run: |
$env:TESTMODULEPATH=(resolve-path "out/Rnwood.Dataverse.Data.PowerShell")
Install-Module -force Pester
Invoke-Pester -output detailed -path tests
if ($LASTEXITCODE -ne 0) {
throw "Tests failed"
}
- name: E2E Test - pwsh
shell: pwsh
env:
E2ETESTS_URL: ${{ vars.E2ETESTS_URL }}
E2ETESTS_CLIENTID: ${{ vars.E2ETESTS_CLIENTID }}
E2ETESTS_CLIENTSECRET: ${{ secrets.E2ETESTS_CLIENTSECRET }}
run: |
$env:TESTMODULEPATH=(resolve-path "out/Rnwood.Dataverse.Data.PowerShell")
Install-Module -force Pester
Invoke-Pester -output detailed -path e2e-tests
if ($LASTEXITCODE -ne 0) {
throw "Tests failed"
}
- if: ${{matrix.powershell}}
name: E2E Test - powershell
shell: powershell
env:
E2ETESTS_URL: ${{ vars.E2ETESTS_URL }}
E2ETESTS_CLIENTID: ${{ vars.E2ETESTS_CLIENTID }}
E2ETESTS_CLIENTSECRET: ${{ secrets.E2ETESTS_CLIENTSECRET }}
run: |
$env:TESTMODULEPATH=(resolve-path "out/Rnwood.Dataverse.Data.PowerShell")
Install-Module -force Pester
Invoke-Pester -output detailed -path e2e-tests
if ($LASTEXITCODE -ne 0) {
throw "Tests failed"
}
- if: ${{ matrix.publish && github.event_name == 'release' && github.event.action == 'published' }}
name: Publish
env:
NUGET_KEY: ${{ secrets.NUGET_KEY }}
shell: pwsh
run: |
Publish-Module -Path out/Rnwood.Dataverse.Data.PowerShell -NuGetApiKey $env:NUGET_KEY -Verbose