1#
2# Build and upload AppImage packages
3#
4name: "AppImage (ARM)"
5
6on: [push]
7
8jobs:
9  # AppImage ARM
10  appimage-arm:
11    strategy:
12      matrix:
13        include:
14          - arch: aarch64
15            qarch: aarch64
16            march: aarch64
17          - arch: armv7
18            qarch: arm
19            march: armhf
20    name: "${{ matrix.arch }}"
21    runs-on: ubuntu-18.04
22    if: "contains(github.event.head_commit.message, '[publish]') || contains(github.ref, 'heads/release')"
23
24    steps:
25    - name: Checkout repository
26      uses: actions/checkout@v2
27
28    - name: Download static QEMU (${{ matrix.qarch }})
29      run: |
30        wget https://github.com/multiarch/qemu-user-static/releases/download/v6.1.0-5/qemu-${{ matrix.qarch }}-static -O ${{ runner.temp }}/qemu-static
31        chmod +x ${{ runner.temp }}/qemu-static
32
33    - name: Build AppImage
34      uses: uraimo/run-on-arch-action@v2.1.1
35      id: appimage
36      with:
37        arch: ${{ matrix.arch }}
38        distro: ubuntu18.04
39
40        # Not required, but speeds up builds by storing container images in
41        # a GitHub package registry.
42        githubToken: ${{ github.GITHUB_TOKEN }}
43
44        # Create an artifacts directory
45        setup: |
46          mkdir -p "${PWD}/artifact"
47
48        # Mount the artifacts directory as /artifact in the container
49        dockerRunArgs: |
50          --volume "${PWD}/artifact:/artifact"
51          --volume "${{ runner.temp }}/qemu-static:/usr/bin/qemu-static"
52
53        # The shell to run commands with in the container
54        shell: /bin/bash
55
56        # Install some dependencies in the container. This speeds up builds if
57        # you are also using githubToken. Any dependencies installed here will
58        # be part of the container image that gets cached, so subsequent
59        # builds don't have to re-install them. The image layer is cached
60        # publicly in your project's package repository, so it is vital that
61        # no secrets are present in the container state or logs.
62        install: |
63          # Update installed packages
64          apt-get update -y
65          ACCEPT_EULA=Y apt-get upgrade -y
66          # Installing dependencies
67          apt-get install -y qtbase5-dev qtscript5-dev libqt5svg5-dev qttools5-dev-tools qttools5-dev libqt5opengl5-dev qtmultimedia5-dev libqt5multimedia5-plugins libqt5serialport5 libqt5serialport5-dev qtpositioning5-dev libgps-dev libqt5positioning5 libqt5positioning5-plugins qtwebengine5-dev zlib1g-dev libgl1-mesa-dev libdrm-dev cmake wget python3-pip python3-setuptools patchelf desktop-file-utils libgdk-pixbuf2.0-dev fakeroot
68          pip3 install appimage-builder
69
70        # Produce a binary artifact and place it in the mounted volume
71        run: |
72          wget https://github.com/AppImage/AppImageKit/releases/download/continuous/appimagetool-${{ matrix.march }}.AppImage -O /opt/appimagetool
73          chmod +x /opt/appimagetool
74          cd /opt
75          qemu-static /opt/appimagetool --appimage-extract
76          mv /opt/squashfs-root /opt/appimagetool.AppDir
77          ln -s /opt/appimagetool.AppDir/AppRun /usr/local/bin/appimagetool
78          mkdir -p ${{ github.workspace }}/builds/appimage
79          cd ${{ github.workspace }}/builds/appimage
80          export APP_VERSION="edge"
81          appimage-builder --recipe ${{ github.workspace }}/util/appimage/stellarium-appimage-${{ matrix.march }}.yml --skip-test
82          cp ${{ github.workspace }}/builds/appimage/*.AppImage /artifact
83
84    - name: Upload AppImage
85      uses: actions/upload-artifact@v2
86      if: success()
87      with:
88        name: 'Stellarium-edge-${{ matrix.arch }}'
89        path: ${{ github.workspace }}/artifact/*.AppImage
90
91