Build #46
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: | |
inputs: | |
buildtype: | |
type: string | |
default: release | |
workflow_call: | |
inputs: | |
buildtype: | |
type: string | |
default: release | |
jobs: | |
build: | |
name: Building | |
runs-on: ubuntu-24.04 | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Install build dependencies | |
run: | | |
sudo apt-get update | |
sudo apt-get install -y meson gcc pkg-config libgtk-3-dev cmake | |
- name: Cache lib dependencies | |
id: deps-cache | |
uses: actions/cache@v4 | |
with: | |
path: .github/workflows/deps/install_dir | |
key: ${{ hashFiles('.github/workflows/deps/CMakeLists.txt') }} | |
- name: Build lib dependencis | |
if: ${{ steps.deps-cache.outputs.cache-hit != 'true' }} | |
run: | | |
cd .github/workflows/deps | |
cmake . -B build -GNinja | |
ninja -C build | |
- name: Setup build | |
run: | | |
meson setup build --sysconfdir /etc --prefer-static --pkg-config-path $(find .github -name "pkgconfig") | |
case "${{ inputs.buildtype }}" in | |
"release") | |
meson configure build --optimization=s --strip | |
;; | |
"debug") | |
meson configure build --buildtype=debug | |
;; | |
*) | |
echo "Build type ${{ inputs.buildtype }} not supported" | |
exit 1 | |
;; | |
esac | |
- name: Compile | |
run: | | |
meson compile -C build | |
- name: Create tarball | |
run: | | |
DESTDIR=install_dir meson install -C build | |
tar -czvf build/linux-enable-ir-emitter.systemd.x86-64.tar.gz -C build/install_dir . | |
- name: Retrieve version | |
run: | | |
VERSION=$(meson introspect --projectinfo build | jq -r '.version') | |
echo "VERSION=$VERSION" >> "$GITHUB_ENV" | |
- name: Upload tarball | |
uses: actions/upload-artifact@v4 | |
with: | |
name: linux-enable-ir-emitter-${{ inputs.buildtype }}-${{ env.VERSION }}.systemd.x86-64.tar.gz | |
path: build/linux-enable-ir-emitter.systemd.x86-64.tar.gz |