From 1bf85a1f3715202eff9c8229bd33c88ebc428611 Mon Sep 17 00:00:00 2001 From: Trihedraf Date: Sun, 2 May 2021 03:46:01 -0700 Subject: [PATCH] add Linux_x86, Linux_x86_64, Linux_SDL1 to GH Actions --- .github/workflows/Linux_x86.yml | 46 +++++++++++++++++++++ .github/workflows/Linux_x86_64.yml | 46 +++++++++++++++++++++ .github/workflows/Linux_x86_64_SDL1.yml | 40 ++++++++++++++++++ .github/workflows/{cmake.yml => MacOSX.yml} | 12 +++--- 4 files changed, 138 insertions(+), 6 deletions(-) create mode 100644 .github/workflows/Linux_x86.yml create mode 100644 .github/workflows/Linux_x86_64.yml create mode 100644 .github/workflows/Linux_x86_64_SDL1.yml rename .github/workflows/{cmake.yml => MacOSX.yml} (93%) diff --git a/.github/workflows/Linux_x86.yml b/.github/workflows/Linux_x86.yml new file mode 100644 index 000000000..7616bdb5e --- /dev/null +++ b/.github/workflows/Linux_x86.yml @@ -0,0 +1,46 @@ +name: Linux_x86 + +on: [push, pull_request] + +jobs: + build: + runs-on: ubuntu-20.04 + steps: + - name: Checkout + uses: actions/checkout@v2 + with: + fetch-depth: 0 + + - name: Create Build Environment + run: sudo dpkg --add-architecture i386 && sudo apt-get update -y && sudo apt-get install -y cmake file g++-multilib git libfmt-dev:i386 libsdl2-dev:i386 libsdl2-ttf-dev:i386 libsodium-dev:i386 rpm wget + + - name: Configure CMake + shell: bash + working-directory: ${{github.workspace}} + run: cmake -S. -Bbuild -DNIGHTLY_BUILD=ON -DCMAKE_INSTALL_PREFIX=/usr -DCMAKE_TOOLCHAIN_FILE=../CMake/32bit.cmake + + - name: Build + working-directory: ${{github.workspace}} + shell: bash + run: cmake --build build -j $(nproc) --target package + + - name: Upload-Executable + uses: actions/upload-artifact@v2 + with: + name: devilutionx_linux_x86 + path: build/devilutionx + + - name: Package + run: Packaging/nix/LinuxReleasePackaging.sh && Packaging/nix/AppImage.sh + + - name: Upload-Package + uses: actions/upload-artifact@v2 + with: + name: devilutionx_linux_x86.tar.xz + path: devilutionx.tar.xz + + - name: Upload-AppImage + uses: actions/upload-artifact@v2 + with: + name: devilutionx_linux_x86.appimage + path: devilutionx.appimage diff --git a/.github/workflows/Linux_x86_64.yml b/.github/workflows/Linux_x86_64.yml new file mode 100644 index 000000000..f88af84aa --- /dev/null +++ b/.github/workflows/Linux_x86_64.yml @@ -0,0 +1,46 @@ +name: Linux_x86_64 + +on: [push, pull_request] + +jobs: + build: + runs-on: ubuntu-20.04 + steps: + - name: Checkout + uses: actions/checkout@v2 + with: + fetch-depth: 0 + + - name: Create Build Environment + run: sudo apt-get install -y cmake file g++ git libfmt-dev libsdl2-dev libsdl2-ttf-dev libsodium-dev rpm wget + + - name: Configure CMake + shell: bash + working-directory: ${{github.workspace}} + run: cmake -S. -Bbuild .. -DNIGHTLY_BUILD=ON -DCMAKE_INSTALL_PREFIX=/usr + + - name: Build + working-directory: ${{github.workspace}} + shell: bash + run: cmake --build build -j $(nproc) --target package + + - name: Upload-Executable + uses: actions/upload-artifact@v2 + with: + name: devilutionx_linux_x86_64 + path: build/devilutionx + + - name: Package + run: Packaging/nix/LinuxReleasePackaging.sh && Packaging/nix/AppImage.sh + + - name: Upload-Package + uses: actions/upload-artifact@v2 + with: + name: devilutionx_linux_x86_64.tar.xz + path: devilutionx.tar.xz + + - name: Upload-AppImage + uses: actions/upload-artifact@v2 + with: + name: devilutionx_linux_x86_64.appimage + path: devilutionx.appimage diff --git a/.github/workflows/Linux_x86_64_SDL1.yml b/.github/workflows/Linux_x86_64_SDL1.yml new file mode 100644 index 000000000..7ff3b020b --- /dev/null +++ b/.github/workflows/Linux_x86_64_SDL1.yml @@ -0,0 +1,40 @@ +name: Linux_x86_64_SDL1 + +on: [push, pull_request] + +jobs: + build: + runs-on: ubuntu-20.04 + steps: + - name: Checkout + uses: actions/checkout@v2 + with: + fetch-depth: 0 + + - name: Create Build Environment + run: sudo apt-get install -y cmake file g++ git libfmt-dev libsdl-dev libsdl-ttf2.0-dev libsodium-dev rpm + + - name: Configure CMake + shell: bash + working-directory: ${{github.workspace}} + run: cmake -S. -Bbuild .. -DNIGHTLY_BUILD=ON -DUSE_SDL1=ON + + - name: Build + working-directory: ${{github.workspace}} + shell: bash + run: cmake --build build -j $(nproc) --target package + + - name: Upload-Executable + uses: actions/upload-artifact@v2 + with: + name: devilutionx_linux_x86_64_SDL1 + path: build/devilutionx + + - name: Package + run: Packaging/nix/LinuxReleasePackaging.sh + + - name: Upload-Package + uses: actions/upload-artifact@v2 + with: + name: devilutionx_linux_x86_64_SDL1.tar.xz + path: devilutionx.tar.xz diff --git a/.github/workflows/cmake.yml b/.github/workflows/MacOSX.yml similarity index 93% rename from .github/workflows/cmake.yml rename to .github/workflows/MacOSX.yml index 971cad6a3..9e7786f04 100644 --- a/.github/workflows/cmake.yml +++ b/.github/workflows/MacOSX.yml @@ -1,4 +1,4 @@ -name: CMake +name: MacOSX # When creating a new workflow in GitHub’s action builder the default trigger is the push event. We want to extend this to push and pull request events. on: [push, pull_request] @@ -19,7 +19,7 @@ jobs: - uses: actions/checkout@v2 with: fetch-depth: 0 - + - name: Create Build Environment run: brew bundle install @@ -28,8 +28,8 @@ jobs: # access regardless of the host operating system shell: bash working-directory: ${{github.workspace}}/build - # Note the current convention is to use the -S and -B options here to specify source - # and build directories, but this is only available with CMake 3.13 and higher. + # Note the current convention is to use the -S and -B options here to specify source + # and build directories, but this is only available with CMake 3.13 and higher. # The CMake binaries on the Github Actions machines are (as of this writing) 3.12 run: cmake .. @@ -37,8 +37,8 @@ jobs: working-directory: ${{github.workspace}}/build shell: bash # Execute the build. You can specify a specific target with "--target " - run: cmake --build . -j 2 --target package - + run: cmake --build . -j $(nproc) --target package + - name: Release uses: softprops/action-gh-release@v1 if: startsWith(github.ref, 'refs/tags/')