Skip to content

Commit

Permalink
feat: Add publish script SQUASH
Browse files Browse the repository at this point in the history
  • Loading branch information
joshuacurtiss committed Feb 26, 2025
1 parent e368293 commit ddbd8ab
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions shared/bin/publish.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ red=$(tput setaf 1)
yellow=$(tput setaf 3)
norm=$(tput sgr0)

arches_default=linux/arm64,linux/amd64
arches_default=linux/aarch64,linux/amd64
org_default=uicpharm
reg_default=ghcr.io

Expand Down Expand Up @@ -102,8 +102,11 @@ done
# Detect podman
[[ $(docker --version) == podman* ]] && is_podman=true || is_podman=false

# Check arch when running as podman, which will only support native arch
native_arch=linux/$(uname -m | sed -e 's/aarch/arm/' -e 's/x86_/amd/')
# Check arch... when running as podman, only support native arch.
# Get arch info from docker/podman itself. Sadly, they report that info differently.
docker_info=$(docker info -f json)
native_arch=$(jq -r '.OSType' <<< "$docker_info")/$(jq -r '.Architecture' <<< "$docker_info")
$is_podman && native_arch=$(jq -r '.host.os' <<< "$docker_info")/$(jq -r '.host.arch' <<< "$docker_info")
if $is_podman && [[ $arches != "$native_arch" ]]; then
arches=$native_arch
echo "${yellow}When running podman, you can only run your native architecture. Changing target arch to $ul$arches$rmul.$norm"
Expand Down

0 comments on commit ddbd8ab

Please sign in to comment.