Skip to content

Commit 7d6e2b6

Browse files
authored
Merge pull request #4 from redhat-actions/install_latest_podman_on_windows
chore(test): install latest podman version or custom
2 parents cb6729d + 7d00a0e commit 7d6e2b6

1 file changed

Lines changed: 26 additions & 8 deletions

File tree

action.yml

Lines changed: 26 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -16,19 +16,23 @@
1616
# * SPDX-License-Identifier: Apache-2.0
1717
# ***********************************************************************/
1818

19-
name: "Install Podman 5.x"
20-
description: "Installs/updates Podman to v5 from the Kubic repository on Ubuntu."
19+
name: "Install Podman"
20+
description: "Installs Podman on Linux, or a specific/latest version on Windows."
2121

2222
inputs:
2323
ubuntu-version:
2424
description: "The Ubuntu version codename for the Kubic repository."
2525
required: false
2626
default: "23.10"
27+
podman-version-input:
28+
description: "Podman version for Windows. Use 'latest' or a specific version (e.g. '5.6.2')."
29+
required: false
30+
default: "latest"
2731

2832
runs:
2933
using: "composite"
3034
steps:
31-
- name: Update podman to 5.x
35+
- name: Update podman to 5.x on Linux
3236
if: runner.os == 'Linux'
3337
shell: bash
3438
run: |
@@ -60,15 +64,29 @@ runs:
6064
echo "INFO: Podman installation complete."
6165
podman version
6266
67+
- name: Fetch Podman Download URL for Windows
68+
if: runner.os == 'Windows'
69+
id: fetch-podman-url
70+
uses: redhat-actions/podman-install/.github/actions/fetch-latest-podman-version-windows@e4b1fa48c45110617d0ae3a995b81428f4234d96
71+
with:
72+
version_input: ${{ inputs.podman-version-input }}
73+
file_type: 'setup.exe'
74+
6375
- name: Install Podman on Windows
6476
if: runner.os == 'Windows'
6577
shell: pwsh
6678
run: |
67-
echo "Installing Podman..."
68-
curl --output podman-setup.exe -L https://github.com/containers/podman/releases/download/v5.3.2/podman-5.3.2-setup.exe
69-
# Start the installer and wait for it to complete
70-
Start-Process -FilePath .\podman-setup.exe -ArgumentList "/install", "/passive", "/norestart", "/log podman-logs.txt" -Wait
71-
# Check the logs for debugging purposes
79+
$downloadUrl = "${{ steps.fetch-podman-url.outputs.download_url }}"
80+
$podmanVersion = "${{ steps.fetch-podman-url.outputs.version }}"
81+
82+
$versionNumber = $podmanVersion -replace '^v'
83+
$fileName = "podman-$versionNumber-setup.exe"
84+
85+
echo "Installing Podman version $podmanVersion..."
86+
echo "Downloading from $downloadUrl file $fileName"
87+
curl --output $fileName -L $downloadUrl
88+
89+
Start-Process -FilePath ".\$fileName" -ArgumentList "/install", "/passive", "/norestart", "/log podman-logs.txt" -Wait
7290
Get-Content podman-logs.txt
7391
7492
- name: Initialize Podman Machine on Windows

0 commit comments

Comments
 (0)