1
name: Update Podman version on Podman.io
9
description: 'Release version to build and upload (e.g. "v9.8.7")'
21
if [[ -z "${{ inputs.version }}" ]]
23
VERSION=${{ github.event.release.tag_name }}
25
VERSION=${{ inputs.version }}
29
if [[ $VERSION == v* ]]; then
30
VERSION="${VERSION:1}"
32
echo "Bump to ${VERSION}"
34
if [[ $VERSION != *-rc* ]] && [[ $VERSION != *-dev ]]; then
35
echo "notRC=true" >> "$GITHUB_OUTPUT"
37
echo "SKIPPING: Version is a RC or a dev, no need to update."
39
echo "version=$VERSION" >> "$GITHUB_OUTPUT"
41
- name: Check open PRs
42
if: steps.getversion.outputs.notRC == 'true'
46
--repo containers/podman.io \
47
--head bump-podmanv${{ steps.getversion.outputs.version }} \
52
echo "SKIPPING: PR already exists to update to v${{ steps.getversion.outputs.version }}."
54
echo "prexists=false" >> "$GITHUB_OUTPUT"
57
GH_TOKEN: ${{ secrets.PODMANBOT_TOKEN }}
59
- uses: actions/checkout@v4
61
steps.getversion.outputs.notRC == 'true' &&
62
steps.checkpr.outputs.prexists == 'false'
64
repository: containers/podman.io
66
token: ${{ secrets.PODMANBOT_TOKEN }}
70
steps.getversion.outputs.notRC == 'true' &&
71
steps.checkpr.outputs.prexists == 'false'
74
# Check if version is actually higher than one on podman.io
75
prevversion=`grep -P "(?<=export const LATEST_VERSION = ')(\d.\d.\d)" -o static/data/global.ts`
76
echo "Version currently on site: ${prevversion}"
77
echo "Version to update to: ${{ steps.getversion.outputs.version }}"
78
# sort -V -C returns 0 if args are ascending version order
79
if echo "${prevversion},${{ steps.getversion.outputs.version }}" | tr ',' '\n' | sort -V -C && [[ ${prevversion} != ${{ steps.getversion.outputs.version }} ]]
81
echo "needsUpdate=true" >> $GITHUB_OUTPUT
82
echo "This release is a higher version, so we need to update podman.io"
84
echo "SKIPPING: This release is not a higher version, no need to update."
89
steps.getversion.outputs.notRC == 'true' &&
90
steps.checkversion.outputs.needsUpdate == 'true' &&
91
steps.checkpr.outputs.prexists == 'false'
93
# Replace the version in static/data/global.ts file
94
sed -i "s/export const LATEST_VERSION = '.*';/export const LATEST_VERSION = '${{ steps.getversion.outputs.version }}';/g" static/data/global.ts
96
cat static/data/global.ts
100
steps.getversion.outputs.notRC == 'true' &&
101
steps.checkversion.outputs.needsUpdate == 'true' &&
102
steps.checkpr.outputs.prexists == 'false'
104
# Make commiter the user who triggered the action, either through cutting a release or manual trigger
105
# GitHub gives everyone a noreply email associated with their account, use that email for the sign-off
106
git config --local user.name ${{ github.actor }}
107
git config --local user.email "${{ github.actor_id }}+${{ github.actor }}@users.noreply.github.com"
108
bumpbranch="bump-podmanv${{ steps.getversion.outputs.version }}"
109
git checkout -b $bumpbranch
110
git add static/data/global.ts
111
git commit --signoff -m "Bump Podman to v${{ steps.getversion.outputs.version }}"
113
git remote add podmanbot https://github.com/podmanbot/podman.io
114
git push podmanbot "+$bumpbranch"
116
--title "Bump Podman to v${{ steps.getversion.outputs.version }}" \
117
--body "Bump Podman to v${{ steps.getversion.outputs.version }}" \
118
--head "podmanbot:$bumpbranch" \
119
--base "main" -R "containers/podman.io"
121
GH_TOKEN: ${{ secrets.PODMANBOT_TOKEN }}