Skip to content

Do not hardcode the version number in the build workflow. #3

Do not hardcode the version number in the build workflow.

Do not hardcode the version number in the build workflow. #3

Workflow file for this run

name: Test building the runner
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
workflow_dispatch:
jobs:
build_linux:
name: Build the source distribution
runs-on: ubuntu-latest
outputs:
odkrun_version: ${{ steps.find_version.outputs.odkrun_version }}
steps:
- name: Check out the repository
uses: actions/checkout@v4
- id: find_version
name: Determine current version
run: sed -E -e 's/^AC_INIT\(\[ODK Runner\], \[(.*)\],/odkrun_version=\1/;q' configure.ac >> "$GITHUB_OUTPUT"
- name: Generate the build system
run: autoreconf --install
- name: Configure the distribution
run: ./configure
- name: Build
run: make distcheck
- name: Upload source distribution
uses: actions/upload-artifact@v4
with:
name: source_dist
path: odkrun-${{ steps.find_version.outputs.odkrun_version }}.tar.gz
build_macos:
name: Build for macOS
needs: build_linux
runs-on: macos-15
steps:
- name: Download source distribution
uses: actions/download-artifact@v5
with:
name: source_dist
- name: Build
run: |
tar xf odkrun-${{ needs.build_linux.outputs.odkrun_version }}.tar.gz
cd odkrun-${{ needs.build_linux.outputs.odkrun_version }}
./configure
make
build_windows:
name: Build for Windows
needs: build_linux
runs-on: ubuntu-latest
steps:
- name: Set up MinGW
uses: egor-tensin/setup-mingw@v3
with:
platform: x64
- name: Download source distribution
uses: actions/download-artifact@v5
with:
name: source_dist
- name: Build
run: |
tar xf odkrun-${{ needs.build_linux.outputs.odkrun_version }}.tar.gz
cd odkrun-${{ needs.build_linux.outputs.odkrun_version }}
./configure --host=x86_64-w64-mingw32
make