Skip to content

Commit c4da27c

Browse files
committed
ci(canary): use install.sh for CLI setup and add gh to CI image
1 parent 58b916c commit c4da27c

File tree

2 files changed

+12
-30
lines changed

2 files changed

+12
-30
lines changed

.github/workflows/release-canary.yml

Lines changed: 2 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -72,38 +72,10 @@ jobs:
7272
fi
7373
7474
- name: Install CLI from GitHub Release
75-
run: |
76-
set -euo pipefail
77-
TAG="${{ steps.release.outputs.tag }}"
78-
ASSET_NAME="openshell-${{ matrix.target }}.tar.gz"
79-
API="https://api.github.com/repos/${{ github.repository }}"
80-
81-
echo "Downloading ${ASSET_NAME} from release ${TAG}..."
82-
83-
# Look up the asset download URL via the releases API
84-
ASSET_URL=$(curl -fsSL \
85-
-H "Authorization: token ${GH_TOKEN}" \
86-
"${API}/releases/tags/${TAG}" \
87-
| jq -r --arg name "${ASSET_NAME}" \
88-
'.assets[] | select(.name == $name) | .url')
89-
90-
if [ -z "$ASSET_URL" ] || [ "$ASSET_URL" = "null" ]; then
91-
echo "::error::Asset ${ASSET_NAME} not found in release ${TAG}"
92-
exit 1
93-
fi
94-
95-
# Download the asset binary
96-
curl -fsSL \
97-
-H "Authorization: token ${GH_TOKEN}" \
98-
-H "Accept: application/octet-stream" \
99-
-o "/tmp/${ASSET_NAME}" \
100-
"${ASSET_URL}"
101-
102-
tar -xzf "/tmp/${ASSET_NAME}" -C /tmp
103-
install -m 755 /tmp/openshell /usr/local/bin/openshell
104-
rm -f "/tmp/${ASSET_NAME}" /tmp/openshell
75+
run: ./install.sh
10576
env:
10677
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
78+
OPENSHELL_VERSION: ${{ steps.release.outputs.tag }}
10779

10880
- name: Verify CLI installation
10981
run: openshell --version

deploy/docker/Dockerfile.ci

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,16 @@ RUN case "$TARGETARCH" in \
4949
-o /usr/local/lib/docker/cli-plugins/docker-buildx \
5050
&& chmod +x /usr/local/lib/docker/cli-plugins/docker-buildx
5151

52+
# Install GitHub CLI used by install.sh and CI jobs
53+
ARG GH_VERSION=2.74.1
54+
RUN case "$TARGETARCH" in \
55+
amd64) gh_arch=amd64 ;; \
56+
arm64) gh_arch=arm64 ;; \
57+
*) echo "Unsupported TARGETARCH: $TARGETARCH"; exit 1 ;; \
58+
esac \
59+
&& curl -fsSL "https://github.com/cli/cli/releases/download/v${GH_VERSION}/gh_${GH_VERSION}_linux_${gh_arch}.tar.gz" \
60+
| tar xz --strip-components=2 -C /usr/local/bin "gh_${GH_VERSION}_linux_${gh_arch}/bin/gh"
61+
5262
# Install AWS CLI v2 used for ECR publishing
5363
RUN case "$TARGETARCH" in \
5464
amd64) aws_arch=x86_64 ;; \

0 commit comments

Comments
 (0)