|
| 1 | +name: CI AppImage |
| 2 | + |
| 3 | +on: |
| 4 | + pull_request: |
| 5 | + paths-ignore: |
| 6 | + - 'doc/**' |
| 7 | + - '**.md' |
| 8 | + - '**.rst' |
| 9 | + - '**.txt' |
| 10 | + release: |
| 11 | + types: [published] |
| 12 | + workflow_dispatch: |
| 13 | + |
| 14 | +jobs: |
| 15 | + |
| 16 | + build: |
| 17 | + name: AppImage preparation for Linux |
| 18 | + |
| 19 | + # Oldest supported by Alire+GitHub to increase AppImage back-compatibility |
| 20 | + # Unfortunately we depend on the static elaboration model of recent GNATs |
| 21 | + runs-on: ubuntu-22.04 |
| 22 | + |
| 23 | + steps: |
| 24 | + - name: Check out repository |
| 25 | + uses: actions/checkout@v2 |
| 26 | + with: |
| 27 | + submodules: true |
| 28 | + |
| 29 | + - name: Install FSF toolchain |
| 30 | + run: sudo apt-get install -y gnat gprbuild |
| 31 | + |
| 32 | + - name: Install Python 3.x (required for the testsuite) |
| 33 | + uses: actions/setup-python@v2 |
| 34 | + with: |
| 35 | + python-version: '3.x' |
| 36 | + |
| 37 | + - name: Run test script |
| 38 | + run: scripts/ci-github.sh |
| 39 | + shell: bash |
| 40 | + env: |
| 41 | + BRANCH: ${{ github.base_ref }} |
| 42 | + INDEX: "" |
| 43 | + |
| 44 | + - name: Upload logs (if failed) |
| 45 | + if: failure() |
| 46 | + uses: actions/upload-artifact@master |
| 47 | + with: |
| 48 | + name: e3-log-linux.zip |
| 49 | + path: testsuite/out |
| 50 | + |
| 51 | + - name: Retrieve upload URL for the release |
| 52 | + if: (github.event_name == 'release') |
| 53 | + id: get_release |
| 54 | + uses: bruceadams/get-release@v1.3.2 |
| 55 | + env: |
| 56 | + GITHUB_TOKEN: ${{ github.token }} |
| 57 | + |
| 58 | + - name: Get release version |
| 59 | + if: (github.event_name == 'release') |
| 60 | + id: get_version |
| 61 | + uses: battila7/get-version-action@v2 |
| 62 | + |
| 63 | + - name: Get ref version |
| 64 | + if: (github.event_name != 'release') |
| 65 | + id: get_ref |
| 66 | + run: echo "::set-output name=short_sha::$(echo ${{ github.sha }} | cut -c1-8)" |
| 67 | + |
| 68 | + ############ |
| 69 | + # AppImage # |
| 70 | + ############ |
| 71 | + |
| 72 | + - name: Install AppImage dependencies (libfuse2) |
| 73 | + shell: bash |
| 74 | + run: | |
| 75 | + sudo add-apt-repository universe |
| 76 | + sudo apt-get install -y libfuse2 |
| 77 | +
|
| 78 | + - name: Install AppImage's linuxdeploy |
| 79 | + uses: miurahr/install-linuxdeploy-action@v1 |
| 80 | + with: |
| 81 | + plugins: appimage |
| 82 | + |
| 83 | + - name: Copy license into AppImage |
| 84 | + run: | |
| 85 | + mkdir -p AppDir |
| 86 | + cp LICENSE.txt AppDir/ |
| 87 | +
|
| 88 | + - name: Create AppImage |
| 89 | + run: > |
| 90 | + linuxdeploy-x86_64.AppImage --appdir AppDir -e bin/alr |
| 91 | + -d resources/alr.desktop -i resources/alr.png --output appimage |
| 92 | +
|
| 93 | + - name: Rename AppImage |
| 94 | + run: mv alr*AppImage alr.AppImage |
| 95 | + |
| 96 | + - name: Upload AppImage asset |
| 97 | + if: (github.event_name == 'release') |
| 98 | + uses: actions/upload-release-asset@v1 |
| 99 | + env: |
| 100 | + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
| 101 | + with: |
| 102 | + upload_url: ${{ steps.get_release.outputs.upload_url }} |
| 103 | + asset_path: alr.AppImage |
| 104 | + asset_name: alr-${{ steps.get_version.outputs.version-without-v }}-x86_64.AppImage |
| 105 | + asset_content_type: application/x-elf |
| 106 | + |
| 107 | + # When not a release we upload as a plain artifact, just to make sure that |
| 108 | + # this works as expected. Also this way the AppImage is available for |
| 109 | + # regular PRs for easy testing. |
| 110 | + - name: Upload as artifact (when not a release) |
| 111 | + if: (github.event_name != 'release') |
| 112 | + uses: actions/upload-artifact@v2 |
| 113 | + with: |
| 114 | + name: alr-${{ steps.get_ref.outputs.short_sha }}-x86_64.AppImage.zip |
| 115 | + path: alr.AppImage |
0 commit comments