1
name: Upload Release Artifacts
9
description: 'Release version to build and upload (e.g. "v9.8.7")'
12
description: 'Perform all the steps except uploading to the release page'
14
default: "true" # 'choice' type requires string value
17
- "true" # Must be quoted string, boolean value not supported.
27
- name: Determine Version
30
if [[ -z "${{ inputs.version }}" ]]
32
VERSION=${{ github.event.release.tag_name }}
34
VERSION=${{ inputs.version }}
37
echo "version=$VERSION" >> $GITHUB_OUTPUT
39
- name: Consolidate dryrun setting to always be true or false
42
# The 'release' trigger will not have a 'dryrun' input set. Handle
43
# this case in a readable/maintainable way.
44
if [[ -z "${{ inputs.dryrun }}" ]]
46
echo "dryrun=false" >> $GITHUB_OUTPUT
48
echo "dryrun=${{ inputs.dryrun }}" >> $GITHUB_OUTPUT
54
URI="https://github.com/containers/podman/releases/download/${{steps.getversion.outputs.version}}"
55
for artifact in "podman-remote-release-darwin_amd64.zip darwin_amd" \
56
'podman-remote-release-darwin_arm64.zip darwin_arm' \
57
'podman-remote-release-windows_amd64.zip windows_amd' \
58
'podman-remote-static-linux_amd64.tar.gz linux_amd' \
59
'podman-remote-static-linux_arm64.tar.gz linux_arm'
61
set -- $artifact # Convert the "tuple" into the param args $1 $2...
62
status=$(curl -s -o /dev/null -w "%{http_code}" "${URI}/${1:?}")
63
if [[ "$status" == "404" ]] ; then
67
echo "::warning::${artifact} already exists, skipping"
71
if [ "$needsbuild" = true ]; then
72
echo "buildartifacts=true" >> $GITHUB_OUTPUT
74
echo "No new artifacts need to be built."
77
- name: Checkout Version
79
steps.check.outputs.buildartifacts == 'true' ||
80
steps.actual_dryrun.outputs.dryrun == 'true'
81
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4
83
repository: containers/podman
84
ref: ${{steps.getversion.outputs.version}}
88
steps.check.outputs.buildartifacts == 'true' ||
89
steps.actual_dryrun.outputs.dryrun == 'true'
90
uses: actions/setup-go@v5
94
- name: Setup artifact directory
96
steps.check.outputs.buildartifacts == 'true' ||
97
steps.actual_dryrun.outputs.dryrun == 'true'
98
run: mkdir -p release/
100
- name: Build Darwin AMD
102
steps.check.outputs.darwin_amd == 'true' ||
103
steps.actual_dryrun.outputs.dryrun == 'true'
105
make podman-remote-release-darwin_amd64.zip
106
mv podman-remote-release-darwin_amd64.zip release/
108
- name: Build Darwin ARM
110
steps.check.outputs.darwin_arm == 'true' ||
111
steps.actual_dryrun.outputs.dryrun == 'true'
113
make podman-remote-release-darwin_arm64.zip
114
mv podman-remote-release-darwin_arm64.zip release/
116
- name: Build Linux AMD
118
steps.check.outputs.linux_amd == 'true' ||
119
steps.actual_dryrun.outputs.dryrun == 'true'
121
make podman-remote-static-linux_amd64
122
tar -cvzf podman-remote-static-linux_amd64.tar.gz bin/podman-remote-static-linux_amd64
123
mv podman-remote-static-linux_amd64.tar.gz release/
125
- name: Build Linux ARM
127
steps.check.outputs.linux_arm == 'true' ||
128
steps.actual_dryrun.outputs.dryrun == 'true'
130
make podman-remote-static-linux_arm64
131
tar -cvzf podman-remote-static-linux_arm64.tar.gz bin/podman-remote-static-linux_arm64
132
mv podman-remote-static-linux_arm64.tar.gz release/
134
- name: Build Windows AMD
136
steps.check.outputs.windows_amd == 'true' ||
137
steps.actual_dryrun.outputs.dryrun == 'true'
139
sudo apt-get install -y pandoc
140
make podman-remote-release-windows_amd64.zip
141
mv podman-remote-release-windows_amd64.zip release/
145
steps.check.outputs.buildartifacts == 'true' ||
146
steps.actual_dryrun.outputs.dryrun == 'true'
149
sha256sum *.zip *.tar.gz > shasums
152
- name: Upload to Actions as artifact
154
steps.check.outputs.buildartifacts == 'true' ||
155
steps.actual_dryrun.outputs.dryrun == 'true'
156
uses: actions/upload-artifact@v4
162
- name: Upload to Release
164
steps.check.outputs.buildartifacts == 'true' &&
165
steps.actual_dryrun.outputs.dryrun == 'false'
167
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
169
(gh release download ${{steps.getversion.outputs.version}} -p "shasums" || exit 0)
170
cat release/shasums >> shasums
171
gh release upload ${{steps.getversion.outputs.version}} release/*.zip release/*.tar.gz
172
gh release upload ${{steps.getversion.outputs.version}} --clobber shasums
174
- name: Trigger Windows Installer
176
steps.check.outputs.windows_amd == 'true' ||
177
steps.actual_dryrun.outputs.dryrun == 'false'
179
gh workflow run upload-win-installer.yml -f ${{steps.getversion.outputs.version}} -f dryrun=false