Build CARTA AppImage #2
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Build CARTA AppImage | |
| on: | |
| workflow_dispatch: | |
| jobs: | |
| build-appimage: | |
| runs-on: [self-hosted, cd] | |
| defaults: | |
| run: | |
| working-directory: CARTA-AppImage-creator | |
| steps: | |
| # ── 1. Checkout carta-package ───────────────────────────────────────── | |
| - name: Checkout carta-package | |
| uses: actions/checkout@v4 | |
| with: | |
| ref: posh/v6-beta | |
| # ── 2. Generate default appimage_config ─────────────────────────────── | |
| - name: Generate default appimage_config | |
| run: sh generate_default_appimage_config.sh | |
| # ── 3. Set PACKAGING_PATH in appimage_config ────────────────────────── | |
| - name: Set PACKAGING_PATH in appimage_config | |
| run: | | |
| PACKAGING_PATH="$(pwd)" | |
| if [[ "$RUNNER_OS" == "macOS" ]]; then | |
| sed -i '' "s|^PACKAGING_PATH=.*|PACKAGING_PATH=${PACKAGING_PATH}|" appimage_config | |
| else | |
| sed -i "s|^PACKAGING_PATH=.*|PACKAGING_PATH=${PACKAGING_PATH}|" appimage_config | |
| fi | |
| echo "=== Final appimage_config ===" | |
| cat appimage_config | |
| # ── 4a. Build Docker image (AlmaLinux 8.10) ──────────────────────────── | |
| - name: Build Docker image | |
| run: sh build_docker_image.sh | |
| # ── 4b. Run Docker packaging ───────────────────────────────────────── | |
| - name: Run docker package | |
| run: | | |
| # When RELEASE=TRUE, run_pack.sh prompts twice for version / date | |
| # confirmation. Pipe "y" responses through docker exec -i. | |
| if [ "${RELEASE}" = "TRUE" ]; then | |
| printf 'y\ny\n' | sh run_docker_package.sh | |
| else | |
| sh run_docker_package.sh | |
| fi | |
| # ── 5. Verify packaged backend version ──────────────────────────────── | |
| - name: Check packaged backend version | |
| run: | | |
| . ./appimage_config | |
| ARCH=$(arch) | |
| if [ "${ARCH}" = "arm64" ]; then | |
| ARCH="aarch64" | |
| fi | |
| VERSION="$RELEASE_VERSION" | |
| if [ "$RELEASE" != "TRUE" ]; then | |
| VERSION="${FRONTEND_VERSION}-${BACKEND_VERSION}" | |
| fi | |
| APPIMAGE_FILE="carta-${VERSION}-${ARCH}.AppImage" | |
| echo "Expected AppImage: ${APPIMAGE_FILE}" | |
| if [ ! -f "${APPIMAGE_FILE}" ]; then | |
| echo "ERROR: AppImage not found — ${APPIMAGE_FILE}" | |
| echo "Available AppImage files:" | |
| ls -lh carta-*.AppImage 2>/dev/null || echo "(none)" | |
| exit 1 | |
| fi | |
| echo "AppImage found: ${APPIMAGE_FILE}" | |
| echo "File size: $(du -sh "${APPIMAGE_FILE}" | cut -f1)" | |
| # Run the AppImage to print the backend version | |
| chmod +x "${APPIMAGE_FILE}" | |
| echo "--- Backend version output ---" | |
| APPIMAGE_EXTRACT_AND_RUN=1 ./'${APPIMAGE_FILE}' --version 2>&1 || true |