From a171463a06d90612b753e0b6648c7e8a42248b00 Mon Sep 17 00:00:00 2001 From: Damien Goutte-Gattat Date: Fri, 2 Jan 2026 21:48:29 +0000 Subject: [PATCH] Do not hardcode the version number in the build workflow. To run the build workflow, we need to know the current version number (since the name of the source distribution archive includes it). Instead of hardcoding, try getting it from the configure.ac script, and pass it to the jobs/steps that need it. --- .github/workflows/build.yml | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 3c43fc1..b1269b3 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -11,9 +11,14 @@ 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 @@ -24,7 +29,7 @@ jobs: uses: actions/upload-artifact@v4 with: name: source_dist - path: odkrun-0.4.1.tar.gz + path: odkrun-${{ steps.find_version.outputs.odkrun_version }}.tar.gz build_macos: name: Build for macOS @@ -37,8 +42,8 @@ jobs: name: source_dist - name: Build run: | - tar xf odkrun-0.4.1.tar.gz - cd odkrun-0.4.1 + tar xf odkrun-${{ needs.build_linux.outputs.odkrun_version }}.tar.gz + cd odkrun-${{ needs.build_linux.outputs.odkrun_version }} ./configure make @@ -57,7 +62,7 @@ jobs: name: source_dist - name: Build run: | - tar xf odkrun-0.4.1.tar.gz - cd odkrun-0.4.1 + 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