Build #40
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: "Build" | |
on: | |
workflow_dispatch: | |
workflow_call: | |
jobs: | |
build: | |
name: Building | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Load dependencies versions | |
uses: cardinalby/export-env-action@v2 | |
with: | |
envFile: '.github/workflows/deps/version.env' | |
- name: Install build dependencies | |
run: | | |
sudo apt-get install -y python3-setuptools python3-wheel ninja-build g++ pkg-config libgtk-3-dev cmake | |
python -m pip install meson | |
- name: Cache lib dependencies | |
id: deps-cache | |
uses: actions/cache@v4 | |
with: | |
path: .github/workflows/deps/install_dir | |
key: ${{ env.OPENCV_GIT_TAG }}-${{ env.YAML_GIT_TAG }}-${{ env.ARGPARSE_GIT_TAG }} | |
- name: Build lib dependencis | |
if: ${{ steps.deps-cache.outputs.cache-hit != 'true' }} | |
run: | | |
cd .github/workflows/deps | |
cmake . -B build -GNinja \ | |
-DOPENCV_GIT_TAG=${{ env.OPENCV_GIT_TAG }} -DYAML_GIT_TAG=${{ env.YAML_GIT_TAG }} -DARGPARSE_GIT_TAG=${{ env.ARGPARSE_GIT_TAG }} | |
ninja -C build | |
cd - | |
- name: Setup build | |
run: | | |
meson setup build --libdir=lib --prefer-static --pkg-config-path=$(find .github -name "pkgconfig") | |
- name: Compile | |
run: | | |
meson compile -C build | |
- name: Retrieve version | |
run: | | |
VERSION=$(meson introspect --projectinfo build | jq -r '.version') | |
echo "VERSION=$VERSION" >> "$GITHUB_ENV" | |
- name: Create tarball | |
run: | | |
DESTDIR=install_dir meson install -C build | |
tar -czvf build/linux-enable-ir-emitter-${VERSION}.systemd.x86-64.tar.gz -C build/install_dir . | |
- name: Upload tarball | |
uses: actions/upload-artifact@v4 | |
with: | |
name: linux-enable-ir-emitter-${{ env.VERSION }}.systemd.x86-64.tar.gz | |
path: build/linux-enable-ir-emitter-${{ env.VERSION }}.systemd.x86-64.tar.gz |