Minor: Fix indentation in GHA release workflow

Simply indent list items two spaces to the right WRT their parent.

Signed-off-by: Chris Evich <cevich@redhat.com>
This commit is contained in:
Chris Evich
2024-06-13 09:28:46 -04:00
parent 82973c38e4
commit 19989380b8

View File

@ -25,189 +25,190 @@ jobs:
build: build:
runs-on: ubuntu-22.04 runs-on: ubuntu-22.04
steps: steps:
# If the job fails, these details are all but impossible to observe.yy # If the job fails, these details are all but impossible to observe.yy
- name: Provide github event JSON for examination - name: Provide github event JSON for examination
run: | run: |
echo "::group::Event JSON" echo "::group::Event JSON"
jq --color-output "." ${{ github.event_path }}"" jq --color-output "." ${{ github.event_path }}"
echo "::endgroup::" echo "::endgroup::"
- name: Determine Version - name: Determine Version
id: getversion id: getversion
run: | run: |
if [[ -z "${{ inputs.version }}" ]] if [[ -z "${{ inputs.version }}" ]]
then then
VERSION=${{ github.event.release.tag_name }} VERSION=${{ github.event.release.tag_name }}
else
VERSION=${{ inputs.version }}
fi
if ! grep -Eq 'v[0-9]+(\.[0-9]+(\.[0-9]+(-.+)?)?)?$' <<<"$VERSION"
then
echo "Unable to parse release version '$VERSION' from github event JSON, or workflow 'version' input."
exit 1
fi
if grep -Eq '.+-dev$' <<<"$VERSION"
then
echo "Refusing to process a "-dev" version '$VERSION'"
exit 1
fi
echo
echo "version=$VERSION" >> $GITHUB_OUTPUT
- name: Consolidate dryrun setting to always be true or false
id: actual_dryrun
run: |
# The 'release' trigger will not have a 'dryrun' input set. Handle
# this case in a readable/maintainable way.
if [[ -z "${{ inputs.dryrun }}" ]]
then
echo "dryrun=false" >> $GITHUB_OUTPUT
else
echo "dryrun=${{ inputs.dryrun }}" >> $GITHUB_OUTPUT
fi
- name: Dry Run Status
run: |
echo "::notice::This workflow execution will be a dry-run: ${{ steps.actual_dryrun.outputs.dryrun }}"
- name: Check uploads
id: check
run: |
URI="https://github.com/containers/podman/releases/download/${{steps.getversion.outputs.version}}"
for artifact in "podman-remote-release-darwin_amd64.zip darwin_amd" \
'podman-remote-release-darwin_arm64.zip darwin_arm' \
'podman-remote-release-windows_amd64.zip windows_amd' \
'podman-remote-static-linux_amd64.tar.gz linux_amd' \
'podman-remote-static-linux_arm64.tar.gz linux_arm'
do
set -- $artifact # Convert the "tuple" into the param args $1 $2...
status=$(curl -s -o /dev/null -w "%{http_code}" "${URI}/${1:?}")
if [[ "$status" == "404" ]] ; then
echo "${1:?} will be built"
needsbuild=true
echo "${2:?}=true" >> $GITHUB_OUTPUT
else
echo "::warning::${1:?} already exists, skipping"
fi
done
if [ "$needsbuild" = true ]; then
echo "buildartifacts=true" >> $GITHUB_OUTPUT
else else
echo "No new artifacts need to be built." VERSION=${{ inputs.version }}
fi fi
- name: Checkout Version if ! grep -Eq 'v[0-9]+(\.[0-9]+(\.[0-9]+(-.+)?)?)?$' <<<"$VERSION"
if: >- then
steps.check.outputs.buildartifacts == 'true' || echo "Unable to parse release version '$VERSION' from github event JSON, or workflow 'version' input."
steps.actual_dryrun.outputs.dryrun == 'true' exit 1
uses: actions/checkout@v4 fi
with:
ref: ${{steps.getversion.outputs.version}}
- name: Set up Go if grep -Eq '.+-dev$' <<<"$VERSION"
if: >- then
steps.check.outputs.buildartifacts == 'true' || echo "Refusing to process a "-dev" version '$VERSION'"
steps.actual_dryrun.outputs.dryrun == 'true' exit 1
uses: actions/setup-go@v5 fi
with:
go-version: stable
- name: Setup artifact directory echo
if: >- echo "version=$VERSION" >> $GITHUB_OUTPUT
steps.check.outputs.buildartifacts == 'true' ||
steps.actual_dryrun.outputs.dryrun == 'true'
run: mkdir -p release/
- name: Build Darwin AMD - name: Consolidate dryrun setting to always be true or false
if: >- id: actual_dryrun
steps.check.outputs.darwin_amd == 'true' || run: |
steps.actual_dryrun.outputs.dryrun == 'true' # The 'release' trigger will not have a 'dryrun' input set. Handle
run: | # this case in a readable/maintainable way.
make podman-remote-release-darwin_amd64.zip if [[ -z "${{ inputs.dryrun }}" ]]
mv podman-remote-release-darwin_amd64.zip release/ then
echo "dryrun=false" >> $GITHUB_OUTPUT
else
echo "dryrun=${{ inputs.dryrun }}" >> $GITHUB_OUTPUT
fi
- name: Build Darwin ARM - name: Dry Run Status
if: >- run: |
steps.check.outputs.darwin_arm == 'true' || echo "::notice::This workflow execution will be a dry-run: ${{ steps.actual_dryrun.outputs.dryrun }}"
steps.actual_dryrun.outputs.dryrun == 'true'
run: |
make podman-remote-release-darwin_arm64.zip
mv podman-remote-release-darwin_arm64.zip release/
- name: Build Linux AMD - name: Check uploads
if: >- id: check
steps.check.outputs.linux_amd == 'true' || run: |
steps.actual_dryrun.outputs.dryrun == 'true' URI="https://github.com/containers/podman/releases/download/${{steps.getversion.outputs.version}}"
run: | for artifact in "podman-remote-release-darwin_amd64.zip darwin_amd" \
make podman-remote-static-linux_amd64 'podman-remote-release-darwin_arm64.zip darwin_arm' \
tar -cvzf podman-remote-static-linux_amd64.tar.gz bin/podman-remote-static-linux_amd64 'podman-remote-release-windows_amd64.zip windows_amd' \
mv podman-remote-static-linux_amd64.tar.gz release/ 'podman-remote-static-linux_amd64.tar.gz linux_amd' \
'podman-remote-static-linux_arm64.tar.gz linux_arm'
do
set -- $artifact # Convert the "tuple" into the param args $1 $2...
status=$(curl -s -o /dev/null -w "%{http_code}" "${URI}/${1:?}")
if [[ "$status" == "404" ]] ; then
echo "${1:?} will be built"
needsbuild=true
echo "${2:?}=true" >> $GITHUB_OUTPUT
else
echo "::warning::${1:?} already exists, skipping"
fi
done
- name: Build Linux ARM if [ "$needsbuild" = true ]; then
if: >- echo "buildartifacts=true" >> $GITHUB_OUTPUT
steps.check.outputs.linux_arm == 'true' || else
steps.actual_dryrun.outputs.dryrun == 'true' echo "No new artifacts need to be built."
run: | fi
make podman-remote-static-linux_arm64
tar -cvzf podman-remote-static-linux_arm64.tar.gz bin/podman-remote-static-linux_arm64
mv podman-remote-static-linux_arm64.tar.gz release/
- name: Build Windows AMD - name: Checkout Version
if: >- if: >-
steps.check.outputs.windows_amd == 'true' || steps.check.outputs.buildartifacts == 'true' ||
steps.actual_dryrun.outputs.dryrun == 'true' steps.actual_dryrun.outputs.dryrun == 'true'
run: | uses: actions/checkout@v4
sudo apt-get install -y pandoc with:
make podman-remote-release-windows_amd64.zip ref: ${{steps.getversion.outputs.version}}
mv podman-remote-release-windows_amd64.zip release/
- name: shasums - name: Set up Go
if: >- if: >-
steps.check.outputs.buildartifacts == 'true' || steps.check.outputs.buildartifacts == 'true' ||
steps.actual_dryrun.outputs.dryrun == 'true' steps.actual_dryrun.outputs.dryrun == 'true'
run: | uses: actions/setup-go@v5
pushd release with:
sha256sum *.zip *.tar.gz > shasums go-version: stable
popd
- name: Upload to Actions as artifact - name: Setup artifact directory
if: >- if: >-
steps.check.outputs.buildartifacts == 'true' || steps.check.outputs.buildartifacts == 'true' ||
steps.actual_dryrun.outputs.dryrun == 'true' steps.actual_dryrun.outputs.dryrun == 'true'
uses: actions/upload-artifact@v4 run: mkdir -p release/
with:
name: artifacts
path: |
release/*
- name: Upload to Release - name: Build Darwin AMD
id: upload if: >-
if: >- steps.check.outputs.darwin_amd == 'true' ||
steps.check.outputs.buildartifacts == 'true' && steps.actual_dryrun.outputs.dryrun == 'true'
steps.actual_dryrun.outputs.dryrun == 'false' run: |
env: make podman-remote-release-darwin_amd64.zip
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} mv podman-remote-release-darwin_amd64.zip release/
run: |
(gh release download ${{steps.getversion.outputs.version}} -p "shasums" || exit 0)
cat release/shasums >> shasums
gh release upload ${{steps.getversion.outputs.version}} release/*.zip release/*.tar.gz
gh release upload ${{steps.getversion.outputs.version}} --clobber shasums
# WARNING: This should only be set when 'notification' job should be triggered - name: Build Darwin ARM
echo "complete=true" >> $GITHUB_OUTPUT if: >-
steps.check.outputs.darwin_arm == 'true' ||
steps.actual_dryrun.outputs.dryrun == 'true'
run: |
make podman-remote-release-darwin_arm64.zip
mv podman-remote-release-darwin_arm64.zip release/
- name: Trigger Windows Installer - name: Build Linux AMD
if: >- if: >-
steps.check.outputs.linux_amd == 'true' ||
steps.actual_dryrun.outputs.dryrun == 'true'
run: |
make podman-remote-static-linux_amd64
tar -cvzf podman-remote-static-linux_amd64.tar.gz bin/podman-remote-static-linux_amd64
mv podman-remote-static-linux_amd64.tar.gz release/
- name: Build Linux ARM
if: >-
steps.check.outputs.linux_arm == 'true' ||
steps.actual_dryrun.outputs.dryrun == 'true'
run: |
make podman-remote-static-linux_arm64
tar -cvzf podman-remote-static-linux_arm64.tar.gz bin/podman-remote-static-linux_arm64
mv podman-remote-static-linux_arm64.tar.gz release/
- name: Build Windows AMD
if: >-
steps.check.outputs.windows_amd == 'true' || steps.check.outputs.windows_amd == 'true' ||
steps.actual_dryrun.outputs.dryrun == 'true'
run: |
sudo apt-get install -y pandoc
make podman-remote-release-windows_amd64.zip
mv podman-remote-release-windows_amd64.zip release/
- name: shasums
if: >-
steps.check.outputs.buildartifacts == 'true' ||
steps.actual_dryrun.outputs.dryrun == 'true'
run: |
pushd release
sha256sum *.zip *.tar.gz > shasums
popd
- name: Upload to Actions as artifact
if: >-
steps.check.outputs.buildartifacts == 'true' ||
steps.actual_dryrun.outputs.dryrun == 'true'
uses: actions/upload-artifact@v4
with:
name: artifacts
path: |
release/*
- name: Upload to Release
id: upload
if: >-
steps.check.outputs.buildartifacts == 'true' &&
steps.actual_dryrun.outputs.dryrun == 'false' steps.actual_dryrun.outputs.dryrun == 'false'
env: env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: | run: |
gh workflow run upload-win-installer.yml -f version=${{steps.getversion.outputs.version}} -f dryrun=false (gh release download ${{steps.getversion.outputs.version}} -p "shasums" || exit 0)
cat release/shasums >> shasums
gh release upload ${{steps.getversion.outputs.version}} release/*.zip release/*.tar.gz
gh release upload ${{steps.getversion.outputs.version}} --clobber shasums
# WARNING: This should only be set when 'notification' job should be triggered
echo "complete=true" >> $GITHUB_OUTPUT
- name: Trigger Windows Installer
if: >-
steps.check.outputs.windows_amd == 'true' ||
steps.actual_dryrun.outputs.dryrun == 'false'
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
gh workflow run upload-win-installer.yml -f version=${{steps.getversion.outputs.version}} -f dryrun=false
outputs: outputs:
uploaded: ${{ steps.upload.outputs.complete }} uploaded: ${{ steps.upload.outputs.complete }}
version: ${{ steps.getversion.outputs.version }} version: ${{ steps.getversion.outputs.version }}