Skip to content

Commit

Permalink
Multiple bug fixes for github workflow (#434)
Browse files Browse the repository at this point in the history
- fixed regex which resulted in false module path and preventing integration tests
- welcome message of dotnet cli is hidden from output
- fixed variable for using the temporary runner path when downloading packages
  • Loading branch information
SebastianSchuetze authored Jan 11, 2022
1 parent f307939 commit 544f2b2
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 8 deletions.
11 changes: 5 additions & 6 deletions .github/workflows/actions-pipeline.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ on:
push:
branches:
- trunk
- feature/*
- hotfix/*
pull_request:
branches:
- trunk
Expand Down Expand Up @@ -126,11 +128,8 @@ jobs:
package-stage:
name: Package Management
needs: build-stage
# run from here only if it's not a a forked repo
# head.repo.full_name would be the forked repo name and 'github.repository' is equal to our repository
if: |
github.event.pull_request.head.repo.full_name == github.repository ||
github.ref == 'refs/heads/trunk'
# run from here only if it's not a pull request
if: github.event_name != 'pull_request'
runs-on: ubuntu-latest
steps:
- name: Download module
Expand Down Expand Up @@ -201,7 +200,7 @@ jobs:
- name: Module test installation
shell: pwsh
run: |
./Test-InstallFromLocalFeed.ps1 -GitHubToken $env:GITHUB_TOKEN -RunnerTempPath $RUNNER_TEMP
./Test-InstallFromLocalFeed.ps1 -GitHubToken $env:GITHUB_TOKEN -RunnerTempPath '${{ runner.temp }}'
env:
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
working-directory: './tools/scripts'
Expand Down
7 changes: 5 additions & 2 deletions tools/scripts/Test-InstallFromLocalFeed.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -21,17 +21,20 @@ param (
$LocalPSGallery = "LocalPSGallery"
$moduleName = "VSTeam"

# turn of first time experience which shows verbose uneeded text in every job
$env:DOTNET_NOLOGO = $true
$env:DOTNET_SKIP_FIRST_TIME_EXPERIENCE = $true

Write-Host "`n##### Download module and all it's dependencies"
dotnet nuget add source --username USERNAME --password $GitHubToken --store-password-in-clear-text --name GitHub-VSTeam "https://nuget.pkg.github.com/MethodsAndPractices/index.json"
nuget install $moduleName -Source GitHub-VSTeam -OutputDirectory "$RunnerTempPath/install"


# rename folders by removing version tag from the folder name
$moduleFolders = Get-ChildItem "$RunnerTempPath/install" -Directory
$modulesToPublish = @()
New-Item -Path "$RunnerTempPath/repo" -Type Directory | Out-Null
foreach ($folder in $moduleFolders) {
$shortName = $folder.Name -replace '(.*)(\.\d+){3,4}', '$1'
$shortName = $folder.Name -replace '((\.\d+){3,4})', ''
Move-Item -Path "$RunnerTempPath/install/$($folder.Name)" -Destination "$RunnerTempPath/install/$($shortName)"
$modulesToPublish += $shortName
}
Expand Down

0 comments on commit 544f2b2

Please sign in to comment.