Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update workflows #51

Merged
merged 30 commits into from
Jan 5, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
48 changes: 48 additions & 0 deletions .github/workflows/arch-latest.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
name: Arch Build

# Controls when the workflow will run
on:
# Triggers the workflow on push or pull request events but only for the master branch
push:
branches: [ master ]
pull_request:
branches: [ master ]
# Allows you to run this workflow manually from the Actions tab
# workflow_dispatch:

# env:
# # Customize the CMake build type here (Release, Debug, RelWithDebInfo, etc.)
# BUILD_TYPE: Release


# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:

build:
runs-on: ubuntu-latest
container:
image: archlinux:latest
options: --privileged
steps:
- uses: actions/checkout@v4

- name: "Install dependencies"
run: "pacman -Syu --noconfirm base-devel qt6-base qt6-svg qt6-multimedia cmake"

- name: "Create build directory and run CMake"
run: "mkdir build && cd build && \
cmake -DCMAKE_BUILD_TYPE=RelWithDebInfo -DCMAKE_INSTALL_PREFIX=/usr .."

- name: "Build"
run: "cd build && make"

- name: Prepare build artifacts
run: |
cd build && make DESTDIR=install ./install
cp ../LICENSE ../README.md ./install/usr/share/libremines

- name: Upload build artifacts
uses: actions/upload-artifact@v4
with:
name: libremines-build-archlinux-latest
path: build/install
83 changes: 0 additions & 83 deletions .github/workflows/build.yml

This file was deleted.

61 changes: 61 additions & 0 deletions .github/workflows/ubuntu.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
name: Ubuntu Build

# Controls when the workflow will run
on:
# Triggers the workflow on push or pull request events but only for the master branch
push:
branches: [ master ]
pull_request:
branches: [ master ]
# Allows you to run this workflow manually from the Actions tab
# workflow_dispatch:

# env:
# # Customize the CMake build type here (Release, Debug, RelWithDebInfo, etc.)
# BUILD_TYPE: Release


# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
build:
strategy:
matrix:
os: [ ubuntu-20.04, ubuntu-22.04 ]

runs-on: ${{ matrix.os }}

steps:
- uses: actions/checkout@v4

- name: "Apt update"
run: "sudo apt-get update"

- name: "Install dependencies Ubuntu 20.04"
if: matrix.os == 'ubuntu-20.04'
run: "sudo apt-get install build-essential qt5-default cmake libqt5svg5-dev qtmultimedia5-dev"
- name: "Install dependencies Ubuntu 22.04"
if: matrix.os == 'ubuntu-22.04'
run: "sudo apt-get install build-essential qt6-base-dev cmake libqt6svg6-dev qt6-multimedia-dev libgl1-mesa-dev"

- name: "Create build directory and run CMake Ubuntu 20.04"
if: matrix.os == 'ubuntu-20.04'
run: "mkdir build && cd build && \
cmake -DCMAKE_BUILD_TYPE=RelWithDebInfo -DCMAKE_INSTALL_PREFIX=/usr -DUSE_QT6='NO' .."
- name: "Create build directory and run CMake Ubuntu 22.04"
if: matrix.os == 'ubuntu-22.04'
run: "mkdir build && cd build && \
cmake -DCMAKE_BUILD_TYPE=RelWithDebInfo -DCMAKE_INSTALL_PREFIX=/usr .."

- name: "Build"
run: "cd build && make"

- name: Prepare build artifacts
run: |
cd build && make DESTDIR=install ./install
cp ../LICENSE ../README.md ./install/usr/share/libremines

- name: Upload build artifacts
uses: actions/upload-artifact@v4
with:
name: libremines-build-${{ matrix.os }}
path: build/install
77 changes: 77 additions & 0 deletions .github/workflows/windows-latest.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
name: Windows Build

# Controls when the workflow will run
on:
# Triggers the workflow on push or pull request events but only for the master branch
push:
branches: [ master ]
pull_request:
branches: [ master ]
# Allows you to run this workflow manually from the Actions tab
# workflow_dispatch:

# env:
# # Customize the CMake build type here (Release, Debug, RelWithDebInfo, etc.)
# BUILD_TYPE: Release


# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
build:
runs-on: windows-2022

strategy:
matrix:
qt-version: [ '5.15.2', '6.5.3' ]

steps:
- uses: actions/checkout@v4

- name: "Install Qt 5.15.2"
if: matrix.qt-version == '5.15.2'
uses: jurplel/install-qt-action@v3
with:
version: '5.15.2'
host: 'windows'
dir: '${{ github.workspace }}'
# modules: 'qtsvg'
arch: 'win64_msvc2019_64'
set-env: 'true'
setup-python: 'true'

- name: "Install Qt 6.5.3"
if: matrix.qt-version == '6.5.3'
uses: jurplel/install-qt-action@v3
with:
version: '6.5.3'
host: 'windows'
dir: '${{ github.workspace }}'
modules: 'qtmultimedia'
arch: 'win64_msvc2019_64'
set-env: 'true'
setup-python: 'true'

- name: "Create build directory and run CMake Qt 6.5.3"
if: matrix.qt-version == '6.5.3'
run: "mkdir build && cd build && cmake -DCMAKE_BUILD_TYPE=RelWithDebInfo .."

- name: "Create build directory and run CMake Qt 5.15.2"
if: matrix.qt-version == '5.15.2'
run: "mkdir build && cd build && cmake -DCMAKE_BUILD_TYPE=RelWithDebInfo -DUSE_QT6='NO' .."

- name: "Build"
run: "cd build && cmake --build . --config Release"

- name: Prepare build artifacts
run: |
Set-Location ./build
${{ github.workspace }}/Qt/${{ matrix.qt-version}}/msvc2019_64/bin/windeployqt.exe --no-translations ./Release
Copy-Item ../README.md ./Release
Copy-Item ../LICENSE ./Release


- name: Upload build artifacts
uses: actions/upload-artifact@v4
with:
name: libremines-build-qt-${{ matrix.qt-version }}
path: build/Release
4 changes: 2 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,13 @@
message(STATUS "Using CMake version ${CMAKE_VERSION}")
cmake_minimum_required(VERSION 3.1.0)
project(libremines
VERSION "1.10.0"
VERSION "2.0.0"
DESCRIPTION " A Free/Libre and Open Source Software Qt based Minesweeper game available for GNU/Linux, FreeBSD and Windows systems. "
HOMEPAGE_URL "https://github.com/Bollos00/LibreMines"
LANGUAGES "CXX"
)

option(USE_QT6 "Wheter to use Qt5 or Qt6 libraries" FALSE)
option(USE_QT6 "Wheter to use Qt5 or Qt6 libraries" TRUE)
option(UPDATE_TRANSLATIONS "Generate de QM translation files" FALSE)
option(INSTALL_EXTRA_MINEFIELD_THEMES "Install extra thmes for the minefield" TRUE)

Expand Down
14 changes: 7 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -57,28 +57,28 @@ The following dependencies are required for building and running LibreMines:
* [Qt5 Multimedia](https://doc.qt.io/qt-5/qtmultimedia-index.html) >= 5.12
* [CMake](https://cmake.org/) >= 3.1

Note: Qt6 is also supported
Note: Qt6 is also supported.

On Arch Linux and derivatives systems, the dependencies can be installed with `pacman`:
```sh
sudo pacman -S base-devel qt5-base qt5-svg qt5-multimedia cmake
sudo pacman -S base-devel qt6-base qt6-svg qt6-multimedia cmake
```

For Ubuntu, you can install the dependencies with the following command:
```sh
sudo apt-get install build-essential qt5-default cmake libqt5svg5-dev qtmultimedia5-dev git
sudo apt-get install build-essential qt6-base-dev cmake libqt6svg6-dev qt6-multimedia-dev libgl1-mesa-dev
```

On Fedora, install the dependencies with:
```sh
sudo dnf install qt5-qtbase-devel qt5-qtsvg-devel cmake qt5-qtmultimedia-devel git
sudo dnf install qt6-qtbase-devel qt6-qtsvg-devel cmake qt6-qtmultimedia-devel git
```

On FreeBSD systems, install the packages [qt5-core](https://www.freshports.org/devel/qt5-core), [qt5-widgets](https://www.freshports.org/x11-toolkits/qt5-widgets/), [qt5-svg](https://www.freshports.org/graphics/qt5-svg/), [qt5-buildtools](https://www.freshports.org/devel/qt5-buildtools/), [qt5-qmake](https://www.freshports.org/devel/qt5-qmake/), [qt5-multimedia](https://www.freshports.org/multimedia/qt5-multimedia/), [git](https://www.freshports.org/devel/git/) and [cmake](https://www.freshports.org/devel/cmake/).
On FreeBSD systems, install the packages [qt6-core](https://www.freshports.org/devel/qt5-core), [qt6-widgets](https://www.freshports.org/x11-toolkits/qt5-widgets/), [qt6-svg](https://www.freshports.org/graphics/qt5-svg/), [qt6-buildtools](https://www.freshports.org/devel/qt5-buildtools/), [qt6-qmake](https://www.freshports.org/devel/qt5-qmake/), [qt6-multimedia](https://www.freshports.org/multimedia/qt5-multimedia/), [git](https://www.freshports.org/devel/git/) and [cmake](https://www.freshports.org/devel/cmake/).

```sh
su -
pkg install qt5-core qt5-widgets qt5-svg git cmake qt5-buildtools qt5-qmake
pkg install qt6-core qt6-widgets qt6-svg git cmake qt6-buildtools qt6-qmake
```

For others systems, check the [qt online installers](https://download.qt.io/official_releases/online_installers/) or your preferred package manager.
Expand All @@ -96,7 +96,7 @@ make

You can also get a stable release from [here](https://github.com/Bollos00/LibreMines/releases).

Note that the option `CMAKE_INSTALL_PREFIX` determines the target directory of the installation. If you want to install LibreMines using Qt6 libraries, additionally pass the argument `-DUSE_QT6="YES"` on the fourth step (the `cmake` part). Also, in order to install _alternative\_dark_ and _alternative\_light_ [minefield_themes](https://github.com/Bollos00/LibreMines/blob/master/share/minefield_themes/README.md), pass the argument `-DINSTALL_EXTRA_MINEFIELD_THEMES="YES"`.
Note that the option `CMAKE_INSTALL_PREFIX` determines the target directory of the installation. If you want to install LibreMines using Qt5 libraries, additionally pass the argument `-DUSE_QT6="NO"` on the fourth step (the `cmake` part).

The executable `libremines` will be generated in the build directory, now it is possible to run it with:
```sh
Expand Down
Loading