Add AppStream CLI 1.0 AppImage builds with full dependency bundling #27
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 AppStream CLI AppImages | |
| on: | |
| push: | |
| branches: | |
| - 'master' | |
| - 'main' | |
| pull_request: | |
| workflow_dispatch: | |
| # This ensures that jobs get canceled when force-pushing | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.ref }} | |
| cancel-in-progress: true | |
| # Permissions needed for creating releases and uploading assets | |
| permissions: | |
| contents: write | |
| env: | |
| APPSTREAM_VERSION: "1.0.0" | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| # The default Debian shell (dash) is faster than bash at running scripts | |
| defaults: | |
| run: | |
| shell: bash | |
| jobs: | |
| build: | |
| runs-on: ubuntu-22.04 | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| include: | |
| - { arch: x86, docker_platform: linux/386, debian_arch: i386 } | |
| - { arch: x86_64, docker_platform: linux/amd64, debian_arch: amd64 } | |
| - { arch: armhf, docker_platform: linux/arm/v7, debian_arch: armhf } | |
| - { arch: aarch64, docker_platform: linux/arm64, debian_arch: arm64 } | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Set up QEMU | |
| uses: docker/setup-qemu-action@v3 | |
| with: | |
| platforms: all | |
| - name: Build AppStream CLI AppImage for ${{ matrix.arch }} | |
| run: | | |
| docker run --rm --platform ${{ matrix.docker_platform }} \ | |
| -v "$PWD:/work" \ | |
| -w /work/appstreamcli-appimage \ | |
| -e ARCH=${{ matrix.arch }} \ | |
| -e APPSTREAM_VERSION=${{ env.APPSTREAM_VERSION }} \ | |
| debian:bookworm \ | |
| bash -c " | |
| apt-get update && \ | |
| apt-get install -y wget file && \ | |
| bash build-appstreamcli-appimage.sh | |
| " | |
| - name: List built AppImages | |
| run: | | |
| ls -lah appstreamcli-appimage/appstreamcli-*.AppImage || true | |
| file appstreamcli-appimage/appstreamcli-*.AppImage || true | |
| - name: Test AppImage | |
| run: | | |
| chmod +x appstreamcli-appimage/appstreamcli-${{ env.APPSTREAM_VERSION }}-${{ matrix.arch }}.AppImage | |
| # Only test on native architecture (x86_64), skip cross-compiled ones | |
| if [ "${{ matrix.arch }}" = "x86_64" ]; then | |
| ./appstreamcli-appimage/appstreamcli-${{ env.APPSTREAM_VERSION }}-${{ matrix.arch }}.AppImage --version || echo "Test failed but continuing" | |
| else | |
| echo "Skipping test for cross-compiled ${{ matrix.arch }} AppImage" | |
| fi | |
| - name: Upload artifact | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: appstreamcli-${{ matrix.arch }} | |
| path: appstreamcli-appimage/appstreamcli-${{ env.APPSTREAM_VERSION }}-${{ matrix.arch }}.AppImage | |
| - name: Upload to continuous release | |
| if: github.event_name != 'pull_request' && (github.ref_name == 'master' || github.ref_name == 'main') | |
| uses: softprops/action-gh-release@v2 | |
| with: | |
| files: appstreamcli-appimage/appstreamcli-${{ env.APPSTREAM_VERSION }}-${{ matrix.arch }}.AppImage | |
| tag_name: continuous | |
| prerelease: true | |
| name: Continuous Build | |
| body: | | |
| Automated continuous build of appstreamcli AppImages for AppStream ${{ env.APPSTREAM_VERSION }} | |
| These AppImages are fully self-contained and bundle all dependencies including glibc. | |
| ## Available Architectures: | |
| - x86 (32-bit Intel) | |
| - x86_64 (64-bit Intel) | |
| - armhf (32-bit ARM) | |
| - aarch64 (64-bit ARM) | |
| ## Usage: | |
| ```bash | |
| chmod +x appstreamcli-*.AppImage | |
| ./appstreamcli-*.AppImage --help | |
| ``` |