Update ci.yml #110
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: CI | |
on: | |
push: | |
branches: [ "master", "dev" ] | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} | |
cancel-in-progress: true | |
jobs: | |
Release: | |
if: startsWith(github.ref, 'refs/tags/') | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout recursive | |
uses: actions/checkout@v3 | |
with: | |
submodules: 'recursive' | |
path: albert | |
- name: Create archives | |
run: | | |
tar --exclude=".*" -czvf ${{ github.ref_name }}.tar.gz albert | |
zip -r ${{ github.ref_name }}.zip albert -x "*/.*" | |
- name: Release | |
uses: softprops/action-gh-release@v1 | |
with: | |
generate_release_notes: true | |
files: | | |
${{ github.ref_name }}.tar.gz | |
${{ github.ref_name }}.zip | |
MacOS: | |
strategy: | |
fail-fast: false | |
matrix: | |
os: [macos-11] | |
build_type: [Release] | |
qt_version: [6.5.2] # 6.2.4 | |
runs-on: ${{ matrix.os }} | |
steps: | |
- name: Checkout source code | |
uses: actions/checkout@v3 | |
with: | |
submodules: recursive | |
- name: Get latest CMake and ninja | |
uses: lukka/get-cmake@latest | |
- name: Install Qt dependencies | |
uses: jurplel/install-qt-action@v3 | |
with: | |
version: ${{ matrix.qt_version }} | |
cache: true | |
modules: 'qtscxml qt5compat qtshadertools' | |
- name: Install pybind using homebrew | |
run: brew install pybind | |
- name: Try using macports cache | |
uses: actions/cache@v3 | |
id: cache-macports # ref'ed below | |
with: | |
path: | | |
/opt/local/lib | |
/opt/local/include | |
key: ${{ runner.os }}-macports-r0 | |
- name: Install macports (for universal binaries of libqalculate and libarchive) | |
if: steps.cache-macports.outputs.cache-hit != 'true' | |
run: | | |
case ${{ matrix.os }} in | |
macos-11) | |
wget "https://github.com/macports/macports-base/releases/download/v2.8.1/MacPorts-2.8.1-11-BigSur.pkg" | |
sudo installer -pkg ./MacPorts-2.8.1-11-BigSur.pkg -target / | |
;; | |
macos-12) | |
wget "https://github.com/macports/macports-base/releases/download/v2.8.1/MacPorts-2.8.1-12-Monterey.pkg" | |
sudo installer -pkg ./MacPorts-2.8.1-12-Monterey.pkg -target / | |
;; | |
macos-13) | |
wget "https://github.com/macports/macports-base/releases/download/v2.8.1/MacPorts-2.8.1-13-Ventura.pkg" | |
sudo installer -pkg ./MacPorts-2.8.1-13-Ventura.pkg -target / | |
;; | |
esac | |
sudo sh -c 'echo "\n+universal" >> /opt/local/etc/macports/variants.conf' | |
- name: Install dependencies using macports | |
if: steps.cache-macports.outputs.cache-hit != 'true' | |
run : sudo /opt/local/bin/port install libqalculate libarchive | |
- name: Build | |
run: | | |
cmake -S . -B build \ | |
-DCMAKE_OSX_ARCHITECTURES="arm64;x86_64" | |
cmake --build build | |
- name: Package | |
run: cd build && cpack -V | |
# - name: Upload | |
# uses: softprops/action-gh-release@v1 | |
# with: | |
# tag_name: v0.22.4 | |
# files: | | |
# build/Albert-0.22.4-Darwin.dmg | |
# build/Albert-0.22.4-Darwin.dmg.sha256 | |
# # Albert-{{ github.ref_name }}-Darwin.dmg | |
# # Albert-{{ github.ref_name }}-Darwin.sha256 | |
# #if: startsWith(github.ref, 'refs/tags/') | |
Linux: | |
runs-on: ubuntu-latest | |
strategy: | |
fail-fast: false | |
matrix: | |
dockerfile: [arch.Dockerfile, fedora.latest.Dockerfile, ubuntu.2204.Dockerfile] | |
steps: | |
- name: Checkout source code | |
uses: actions/checkout@v3 | |
with: | |
submodules: recursive | |
- name: Build docker test image | |
run: docker build . --file .docker/${{ matrix.dockerfile }} |