|
| 1 | +name: Linux Build |
| 2 | +# Controls when the action will run. |
| 3 | +on: |
| 4 | + # Triggers the workflow on push or pull request events but only for the development branch |
| 5 | + push: |
| 6 | + branches: [ master, development ] |
| 7 | + release: |
| 8 | + workflow_dispatch: |
| 9 | + |
| 10 | + |
| 11 | +# A workflow run is made up of one or more jobs that can run sequentially or in parallel |
| 12 | +jobs: |
| 13 | + # This workflow contains a single job called "build" |
| 14 | + build-release-linux: |
| 15 | + # The type of runner that the job will run on |
| 16 | + runs-on: ubuntu-20.04 |
| 17 | + |
| 18 | + |
| 19 | + # Steps represent a sequence of tasks that will be executed as part of the job |
| 20 | + steps: |
| 21 | + # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it |
| 22 | + - uses: actions/checkout@v2 |
| 23 | + - uses: actions/setup-python@v2 |
| 24 | + |
| 25 | + - name: Install Dependencies |
| 26 | + run: | |
| 27 | + sudo apt-get update -yq |
| 28 | + sudo apt-get install --no-install-recommends wget liballegro4-dev libloadpng4-dev libflac++-dev luajit-5.1-dev liblua5.2-dev libminizip-dev liblz4-dev libpng++-dev libx11-dev libboost-dev |
| 29 | +
|
| 30 | + - name: Install Clang |
| 31 | + # You may pin to the exact commit or the version. |
| 32 | + # uses: egor-tensin/setup-clang@d16e36d5f8a7eb00aa6627c1a536d94dfc4a913d |
| 33 | + uses: egor-tensin/setup-clang@v1 |
| 34 | + with: |
| 35 | + # Set up cc/c++ executables |
| 36 | + cc: 1 # optional, default is 1 |
| 37 | + |
| 38 | + - name: Setup ccache |
| 39 | + uses: hendrikmuhs/ccache-action@v1 |
| 40 | + with: |
| 41 | + key: build-release-${{runner.os}} |
| 42 | + max-size: 5G |
| 43 | + |
| 44 | + - name: Build |
| 45 | + # You may pin to the exact commit or the version. |
| 46 | + # uses: BSFishy/meson-build@6f1930d878fd3eed3853c1c91285ec604c37f3a5 |
| 47 | + uses: BSFishy/meson-build@v1.0.3 |
| 48 | + env: |
| 49 | + CC: "clang" |
| 50 | + CXX: "clang++" |
| 51 | + CCACHE_SLOPPINESS: pch_defines,time_macros,include_file_mtime,include_file_ctime |
| 52 | + with: |
| 53 | + # The action to run |
| 54 | + setup-options: --buildtype=release -Dinstall_data=false -Dinstall_runner=false -Dfmod_dir=/usr/lib/ --prefix=/usr/ |
| 55 | + meson-version: 0.55.3 |
| 56 | + ninja-version: 1.10.0 |
| 57 | + action: build |
| 58 | + |
| 59 | + - name: Create AppDir |
| 60 | + run: | |
| 61 | + echo "Setting output prefix" |
| 62 | + DESTDIR=${GITHUB_WORKSPACE}/build/AppDir meson install -C $GITHUB_WORKSPACE"/build" |
| 63 | +
|
| 64 | + - name: Download linuxdeploy |
| 65 | + working-directory: ${{env.GITHUB_WORKSPACE}} |
| 66 | + run: | |
| 67 | + wget https://github.com/linuxdeploy/linuxdeploy/releases/download/continuous/linuxdeploy-x86_64.AppImage -O lindeploy |
| 68 | + chmod +x lindeploy |
| 69 | +
|
| 70 | + - name: Create AppImage |
| 71 | + working-directory: ${{env.GITHUB_WORKSPACE}} |
| 72 | + env: |
| 73 | + LD_LIBRARY_PATH: ./external/lib/linux/x86_64/ |
| 74 | + OUTPUT: CortexCommand.AppImage |
| 75 | + run: | |
| 76 | + echo ${LD_LIBRARY_PATH} |
| 77 | + ./lindeploy --appdir=build/AppDir --output appimage |
| 78 | +
|
| 79 | + - name: Upload Appimage |
| 80 | + uses: actions/upload-artifact@v2 |
| 81 | + with: |
| 82 | + name: CortexCommand.AppImage |
| 83 | + path: CortexCommand.AppImage |
| 84 | + |
| 85 | + |
| 86 | + build-debug-linux: |
| 87 | + # The type of runner that the job will run on |
| 88 | + runs-on: ubuntu-20.04 |
| 89 | + |
| 90 | + |
| 91 | + # Steps represent a sequence of tasks that will be executed as part of the job |
| 92 | + steps: |
| 93 | + # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it |
| 94 | + - uses: actions/checkout@v2 |
| 95 | + - uses: actions/setup-python@v2 |
| 96 | + |
| 97 | + - name: Install Dependencies |
| 98 | + run: | |
| 99 | + sudo apt-get update -yq |
| 100 | + sudo apt-get install --no-install-recommends wget liballegro4-dev libloadpng4-dev libflac++-dev luajit-5.1-dev libminizip-dev liblz4-dev libpng++-dev libx11-dev libboost-dev |
| 101 | +
|
| 102 | + - name: Install Clang |
| 103 | + # You may pin to the exact commit or the version. |
| 104 | + # uses: egor-tensin/setup-clang@d16e36d5f8a7eb00aa6627c1a536d94dfc4a913d |
| 105 | + uses: egor-tensin/setup-clang@v1 |
| 106 | + with: |
| 107 | + # Set up cc/c++ executables |
| 108 | + cc: 1 # optional, default is 1 |
| 109 | + |
| 110 | + - name: Setup ccache |
| 111 | + uses: hendrikmuhs/ccache-action@v1 |
| 112 | + with: |
| 113 | + key: build-release-${{runner.os}} |
| 114 | + max-size: 5G |
| 115 | + |
| 116 | + - name: Build |
| 117 | + # You may pin to the exact commit or the version. |
| 118 | + # uses: BSFishy/meson-build@6f1930d878fd3eed3853c1c91285ec604c37f3a5 |
| 119 | + uses: BSFishy/meson-build@v1.0.3 |
| 120 | + env: |
| 121 | + CC: "clang" |
| 122 | + CXX: "clang++" |
| 123 | + CCACHE_SLOPPINESS: pch_defines,time_macros,include_file_mtime,include_file_ctime |
| 124 | + with: |
| 125 | + # The action to run |
| 126 | + setup-options: -Ddebug=true --optimization=g -Dinstall_data=false -Dinstall_runner=false -Dfmod_dir=/usr/lib/ --prefix=/usr/ -Ddebug_type=release |
| 127 | + meson-version: 0.55.3 |
| 128 | + ninja-version: 1.10.0 |
| 129 | + action: build |
| 130 | + |
| 131 | + - name: Create AppDir |
| 132 | + run: | |
| 133 | + echo "Setting output prefix" |
| 134 | + DESTDIR=${GITHUB_WORKSPACE}/build/AppDir meson install -C $GITHUB_WORKSPACE"/build" |
| 135 | +
|
| 136 | + - name: Download linuxdeploy |
| 137 | + working-directory: ${{env.GITHUB_WORKSPACE}} |
| 138 | + run: | |
| 139 | + wget https://github.com/linuxdeploy/linuxdeploy/releases/download/continuous/linuxdeploy-x86_64.AppImage -O lindeploy |
| 140 | + chmod +x lindeploy |
| 141 | +
|
| 142 | + - name: Create AppImage |
| 143 | + working-directory: ${{env.GITHUB_WORKSPACE}} |
| 144 | + env: |
| 145 | + LD_LIBRARY_PATH: ./external/lib/linux/x86_64/ |
| 146 | + OUTPUT: CortexCommand-debug.AppImage |
| 147 | + run: | |
| 148 | + echo ${LD_LIBRARY_PATH} |
| 149 | + ./lindeploy --appdir=build/AppDir --output appimage |
| 150 | +
|
| 151 | + - name: Upload Appimage |
| 152 | + uses: actions/upload-artifact@v2 |
| 153 | + with: |
| 154 | + name: CortexCommand-debug.AppImage |
| 155 | + path: CortexCommand-debug.AppImage |
0 commit comments