Skip to content

Release v0.4.3

Release v0.4.3 #263

Workflow file for this run

name: CMake CI (Test oshot)
on:
push:
pull_request:
jobs:
get-version:
name: Get Version
runs-on: ubuntu-latest
outputs:
version: ${{ steps.get-version.outputs.version }}
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Get version from git tag or commit
id: get-version
run: |
if [ -n "$(git tag --points-at HEAD)" ]; then
version=$(git describe --tags --abbrev=0)
echo "version=$version" >> $GITHUB_OUTPUT
else
version=$(git rev-parse --short HEAD)
echo "version=commit-$version" >> $GITHUB_OUTPUT
fi
echo "Version: $version"
build:
name: Build (${{ matrix.artifact-name }})
runs-on: ${{ matrix.os }}
permissions:
contents: read
strategy:
fail-fast: false
matrix:
include:
- os: ubuntu-latest
artifact-name: linux
package-file: package/oshot-linux.zip
- os: ubuntu-22.04
artifact-name: linux-appimage
package-file: package/oshot-appimage.zip
- os: macos-latest
artifact-name: macos-arm64
package-file: package/oshot-macos-arm64.zip
- os: macos-15-intel
artifact-name: macos-x86_64
package-file: package/oshot-macos-x86_64.zip
- os: windows-latest
artifact-name: windows
package-file: package/oshot-windows.zip
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
submodules: recursive
fetch-depth: 0
# Dependencies
- name: Install dependencies (Linux)
if: runner.os == 'Linux'
run: |
sudo apt-get update && sudo apt-get purge firefox -y
sudo apt-get install -y \
build-essential \
pkg-config \
make \
cmake \
git \
zip \
fuse \
libx11-dev \
libxcb1-dev \
libglfw3-dev \
libtesseract-dev \
libcurl4-openssl-dev \
libpng-dev \
libjpeg-dev \
libgif-dev \
libtiff-dev \
libwebp-dev \
libzbar-dev \
libappindicator3-dev
- name: Install dependencies (macOS)
if: runner.os == 'macOS'
run: |
brew update && brew upgrade || true
brew install cmake glfw tesseract leptonica zbar curl dylibbundler
- name: Install dependencies (Windows)
if: runner.os == 'Windows'
uses: msys2/setup-msys2@v2
with:
update: true
install: >-
zip
git
libcurl-devel
mingw-w64-x86_64-7zip
mingw-w64-x86_64-directx-headers
mingw-w64-x86_64-ninja
mingw-w64-x86_64-toolchain
mingw-w64-x86_64-minizip
mingw-w64-x86_64-cmake
mingw-w64-x86_64-zbar
mingw-w64-x86_64-make
mingw-w64-x86_64-tesseract-ocr
mingw-w64-x86_64-glfw
mingw-w64-x86_64-libpng
mingw-w64-x86_64-libjpeg-turbo
mingw-w64-x86_64-openjpeg2
mingw-w64-x86_64-libwebp
mingw-w64-x86_64-libtiff
mingw-w64-x86_64-curl
# Build
- name: Build project (Linux)
if: runner.os == 'Linux'
run: |
./scripts/generateVersion.sh
mkdir -p build
cmake -S . -B build -DCMAKE_BUILD_TYPE=Debug
make -C build
./build/oshot --version
- name: Build project (macOS)
if: runner.os == 'macOS'
run: |
./scripts/generateVersion.sh
BREW=$(brew --prefix)
mkdir -p build
cmake -S . -B build \
-DCMAKE_BUILD_TYPE=Debug \
-DCMAKE_PREFIX_PATH="$BREW" \
-DPKG_CONFIG_PATH="$BREW/lib/pkgconfig:$BREW/share/pkgconfig"
make -C build
- name: Build project (Windows)
if: runner.os == 'Windows'
shell: msys2 {0}
run: |
./scripts/generateVersion.sh
mkdir -p build
cmake -S . -B build -G Ninja -DCMAKE_BUILD_TYPE=Debug -DWINDOWS_CMD=ON
ninja -C build
# Package
- name: Package Linux binary
if: matrix.artifact-name == 'linux'
run: |
mkdir -p package/oshot/models
cp ./build/oshot package/oshot/
printf '#!/bin/bash\ncp oshot /usr/local/bin/oshot\n' > package/oshot/install.sh
chmod +x package/oshot/install.sh package/oshot/oshot
wget https://github.com/tesseract-ocr/tessdata/raw/main/eng.traineddata -O package/oshot/models/eng.traineddata
wget https://github.com/matomo-org/travis-scripts/raw/refs/heads/master/fonts/Arial.ttf -O package/oshot/Arial.ttf
cd package && zip -r oshot-linux.zip oshot/
- name: Package Linux AppImage
if: matrix.artifact-name == 'linux-appimage'
run: |
mkdir -p package/oshot/models
./scripts/create_appimage.sh ./build/oshot oshot-x86_64.AppImage
chmod +x oshot-x86_64.AppImage
mv oshot-x86_64.AppImage package/oshot/
wget https://github.com/tesseract-ocr/tessdata/raw/main/eng.traineddata -O package/oshot/models/eng.traineddata
wget https://github.com/matomo-org/travis-scripts/raw/refs/heads/master/fonts/Arial.ttf -O package/oshot/Arial.ttf
cd package && zip -r oshot-appimage.zip oshot/
- name: Package macOS bundle
if: runner.os == 'macOS'
run: |
mkdir -p package/oshot/models
ARCH=$(uname -m)
./scripts/create_app_bundle.sh ./build/oshot oshot-macos-${ARCH}.dmg
mv oshot-macos-${ARCH}.dmg package/oshot/
curl -L https://github.com/tesseract-ocr/tessdata/raw/main/eng.traineddata -o package/oshot/models/eng.traineddata
curl -L https://github.com/matomo-org/travis-scripts/raw/refs/heads/master/fonts/Arial.ttf -o package/oshot/Arial.ttf
cd package && zip -r oshot-macos-${ARCH}.zip oshot/
- name: Package Windows binary
if: runner.os == 'Windows'
shell: msys2 {0}
run: |
mkdir -p package/oshot/models
cp ./build/oshot.exe ./oshot.ico package/oshot/
ldd ./build/oshot.exe | grep -i mingw | awk '{print $3}' | xargs -I {} cp {} package/oshot/ || true
curl -L https://github.com/tesseract-ocr/tessdata/raw/main/eng.traineddata -o package/oshot/models/eng.traineddata
cd package && zip -r oshot-windows.zip oshot/
# Upload artifact
- name: Upload build artifact
uses: actions/upload-artifact@v4
with:
name: ${{ matrix.artifact-name }}-package
path: ${{ matrix.package-file }}
if-no-files-found: error