|
16 | 16 | # * SPDX-License-Identifier: Apache-2.0 |
17 | 17 | # ***********************************************************************/ |
18 | 18 |
|
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." |
21 | 21 |
|
22 | 22 | inputs: |
23 | 23 | ubuntu-version: |
24 | 24 | description: "The Ubuntu version codename for the Kubic repository." |
25 | 25 | required: false |
26 | 26 | 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" |
27 | 31 |
|
28 | 32 | runs: |
29 | 33 | using: "composite" |
30 | 34 | steps: |
31 | | - - name: Update podman to 5.x |
| 35 | + - name: Update podman to 5.x on Linux |
32 | 36 | if: runner.os == 'Linux' |
33 | 37 | shell: bash |
34 | 38 | run: | |
@@ -60,15 +64,29 @@ runs: |
60 | 64 | echo "INFO: Podman installation complete." |
61 | 65 | podman version |
62 | 66 |
|
| 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 | + |
63 | 75 | - name: Install Podman on Windows |
64 | 76 | if: runner.os == 'Windows' |
65 | 77 | shell: pwsh |
66 | 78 | 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 |
72 | 90 | Get-Content podman-logs.txt |
73 | 91 |
|
74 | 92 | - name: Initialize Podman Machine on Windows |
|
0 commit comments