summaryrefslogtreecommitdiff
path: root/.github/actions/meshmc/setup-dependencies/linux/action.yml
blob: 46cb40e8a59de3c957645b9914c6b1b00aa91a4a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
name: Setup Linux dependencies
description: Install and setup dependencies for building MeshMC

inputs:
  github-token:
    description: GitHub token for authentication
    required: true

runs:
  using: composite

  steps:
    - name: Install host dependencies
      shell: bash
      run: |
        sudo apt-get -y update
        sudo apt-get -y install \
          dpkg-dev \
          ninja-build extra-cmake-modules pkg-config scdoc \
          cmark gamemode-dev libarchive-dev libcmark-dev libqrencode-dev zlib1g-dev \
          libxcb-cursor-dev libtomlplusplus-dev libvulkan-dev

    - name: Setup AppImage tooling
      shell: bash
      env:
        GH_TOKEN: ${{ inputs.github-token }}
      run: |
        # Determinate AppImage architecture to use
        dpkg_arch="$(dpkg-architecture -q DEB_HOST_ARCH_CPU)"
        case "$dpkg_arch" in
          "amd64")
            APPIMAGE_ARCH="x86_64"
            ;;
          "arm64")
            APPIMAGE_ARCH="aarch64"
            ;;
          *)
            echo "# 🚨 The Debian architecture \"$deb_arch\" is not recognized!" >> "$GITHUB_STEP_SUMMARY"
            exit 1
            ;;
        esac

        gh release download \
          --repo VHSgunzo/sharun \
          --pattern "sharun-$APPIMAGE_ARCH-aio" \
          --output ~/bin/sharun

        # FIXME!: revert this to probonopd/go-appimage once https://github.com/probonopd/go-appimage/pull/377 is merged!
        gh release download continuous \
          --repo DioEgizio/go-appimage \
          --pattern "mkappimage-*-$APPIMAGE_ARCH.AppImage" \
          --output ~/bin/mkappimage

        gh release download \
          --repo AppImageCommunity/AppImageUpdate \
          --pattern "AppImageUpdate-$APPIMAGE_ARCH.AppImage" \
          --output ~/bin/AppImageUpdate.AppImage
        chmod +x ~/bin/*
        echo "$HOME/bin" >> "$GITHUB_PATH"