File tree Expand file tree Collapse file tree 2 files changed +50
-0
lines changed
.github/actions/install-pog Expand file tree Collapse file tree 2 files changed +50
-0
lines changed Original file line number Diff line number Diff line change
1
+ name : ' Install Pog'
2
+ description : ' Install the Pog package manager (https://github.com/MatejKafka/Pog).'
3
+ inputs :
4
+ path :
5
+ description : ' Path to the directory where Pog is installed.'
6
+ required : false
7
+ default : D:\Pog
8
+ version :
9
+ description : ' Pog version to install. Defaults to the latest available version.'
10
+ required : false
11
+ runs :
12
+ using : " composite"
13
+ steps :
14
+ - name : Install Pog
15
+ shell : pwsh
16
+ run : |
17
+ & $env:GITHUB_ACTION_PATH\install-pog.ps1 $env:POG_PATH
18
+ env :
19
+ POG_PATH : ${{ inputs.path }}
20
+ POG_VERSION : ${{ inputs.version }}
Original file line number Diff line number Diff line change
1
+ param (
2
+ [Parameter (Mandatory )]
3
+ [string ]
4
+ $PogPath ,
5
+ [version ]
6
+ $Version
7
+ )
8
+
9
+ Set-StrictMode - Version 3
10
+ $ErrorActionPreference = " Stop"
11
+ $PSNativeCommandUseErrorActionPreference = $true
12
+
13
+ $ArchivePath = " ${PogPath} .zip"
14
+
15
+ $Endpoint = if ($Version ) {" tags/v$Version " } else {" latest" }
16
+ $ReleaseUrl = (Invoke-RestMethod " https://api.github.com/repos/MatejKafka/Pog/releases/$Endpoint " ).assets.browser_download_url
17
+
18
+ Write-Host " Installing Pog from '$ReleaseUrl '..."
19
+ iwr $ReleaseUrl - OutFile $ArchivePath
20
+
21
+ # unpack Pog, tar is much faster than Expand-Archive
22
+ $null = mkdir $PogPath
23
+ tar - xf $ArchivePath -- directory $PogPath
24
+
25
+ # setup Pog
26
+ & $PogPath \Pog\setup.ps1 - Enable None
27
+
28
+ # propagate PATH and PSModulePath for the following steps
29
+ Add-Content $env: GITHUB_PATH (Resolve-Path $PogPath \Pog\data \package_bin)
30
+ Add-Content $env: GITHUB_ENV " PSModulePath=$env: PSModulePath "
You can’t perform that action at this time.
0 commit comments