Skip to content

Commit a10f701

Browse files
committed
Switch to onedir for instant startup, distribute as tar.gz
1 parent e1e90d7 commit a10f701

2 files changed

Lines changed: 20 additions & 16 deletions

File tree

.github/workflows/build-binaries.yml

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ jobs:
3232
- name: Build binary
3333
run: |
3434
echo "from ebcli.core.ebcore import main; main()" > eb_entry.py
35-
pyinstaller --onefile --name eb-${{ matrix.name }} \
35+
pyinstaller --onedir --name eb \
3636
--hidden-import ebcli.core.ebcore \
3737
--hidden-import ebcli.controllers \
3838
--hidden-import cement.ext.ext_dummy \
@@ -46,26 +46,27 @@ jobs:
4646
--copy-metadata botocore \
4747
--copy-metadata setuptools \
4848
eb_entry.py
49+
tar czf dist/eb-${{ matrix.name }}.tar.gz -C dist eb
4950
shell: bash
5051

5152
- name: Smoke test (Unix)
5253
if: runner.os != 'Windows'
5354
run: |
54-
./dist/eb-${{ matrix.name }} --version
55-
./dist/eb-${{ matrix.name }} --help
55+
./dist/eb/eb --version
56+
./dist/eb/eb --help
5657
shell: bash
5758

5859
- name: Smoke test (Windows)
5960
if: runner.os == 'Windows'
6061
run: |
61-
./dist/eb-${{ matrix.name }}.exe --version
62-
./dist/eb-${{ matrix.name }}.exe --help
62+
./dist/eb/eb.exe --version
63+
./dist/eb/eb.exe --help
6364
shell: bash
6465

6566
- uses: actions/upload-artifact@v4
6667
with:
6768
name: eb-${{ matrix.name }}
68-
path: dist/eb-${{ matrix.name }}*
69+
path: dist/eb-${{ matrix.name }}.tar.gz
6970

7071
release:
7172
needs: build

install.sh

Lines changed: 13 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,8 @@
22
set -e
33

44
REPO="scheenk/aws-elastic-beanstalk-cli"
5-
INSTALL_DIR="/usr/local/bin"
5+
INSTALL_DIR="/usr/local/lib/eb-cli"
6+
BIN_DIR="/usr/local/bin"
67

78
OS=$(uname -s | tr '[:upper:]' '[:lower:]')
89
ARCH=$(uname -m)
@@ -12,11 +13,11 @@ case "$ARCH" in aarch64|arm64) ARCH="arm64" ;; x86_64) ARCH="x86_64" ;; esac
1213
case "$OS" in darwin) OS="macos" ;; esac
1314

1415
VERSION=${1:-$(curl -sSf "https://api.github.com/repos/${REPO}/releases/latest" | grep '"tag_name"' | cut -d'"' -f4)}
15-
BINARY="eb-${OS}-${ARCH}"
16+
BINARY="eb-${OS}-${ARCH}.tar.gz"
1617
BASE_URL="https://github.com/${REPO}/releases/download/${VERSION}"
1718

1819
echo "Installing EB CLI ${VERSION} for ${OS}/${ARCH}..."
19-
curl -sSfL -o /tmp/eb "$BASE_URL/$BINARY"
20+
curl -sSfL -o /tmp/eb-cli.tar.gz "$BASE_URL/$BINARY"
2021
curl -sSfL -o /tmp/checksums.txt "$BASE_URL/checksums.txt"
2122

2223
# Verify checksum
@@ -25,21 +26,23 @@ if [ -z "$EXPECTED" ]; then
2526
echo "Warning: no checksum found for $BINARY, skipping verification"
2627
else
2728
if command -v sha256sum &>/dev/null; then
28-
ACTUAL=$(sha256sum /tmp/eb | awk '{print $1}')
29+
ACTUAL=$(sha256sum /tmp/eb-cli.tar.gz | awk '{print $1}')
2930
else
30-
ACTUAL=$(shasum -a 256 /tmp/eb | awk '{print $1}')
31+
ACTUAL=$(shasum -a 256 /tmp/eb-cli.tar.gz | awk '{print $1}')
3132
fi
3233
if [ "$EXPECTED" != "$ACTUAL" ]; then
3334
echo "Checksum verification failed!"
3435
echo " Expected: $EXPECTED"
3536
echo " Actual: $ACTUAL"
36-
rm -f /tmp/eb /tmp/checksums.txt
37+
rm -f /tmp/eb-cli.tar.gz /tmp/checksums.txt
3738
exit 1
3839
fi
3940
echo "Checksum verified."
4041
fi
4142

42-
rm -f /tmp/checksums.txt
43-
chmod +x /tmp/eb
44-
sudo mv /tmp/eb "${INSTALL_DIR}/eb"
45-
echo "EB CLI ${VERSION} installed to ${INSTALL_DIR}/eb"
43+
sudo rm -rf "$INSTALL_DIR"
44+
sudo mkdir -p "$INSTALL_DIR"
45+
sudo tar xzf /tmp/eb-cli.tar.gz -C "$INSTALL_DIR"
46+
sudo ln -sf "$INSTALL_DIR/eb/eb" "$BIN_DIR/eb"
47+
rm -f /tmp/eb-cli.tar.gz /tmp/checksums.txt
48+
echo "EB CLI ${VERSION} installed to ${BIN_DIR}/eb"

0 commit comments

Comments
 (0)