From 1be2e67984d72b62e41442cca5d0b23dc217a312 Mon Sep 17 00:00:00 2001 From: Noemi <45180344+unflxw@users.noreply.github.com> Date: Fri, 22 Nov 2024 18:09:28 +0100 Subject: [PATCH] Fix version number in release builds This fixes an issue where the version number reported by `--version` would be the one for the previous release. --- .github/workflows/publish_release.yaml | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/.github/workflows/publish_release.yaml b/.github/workflows/publish_release.yaml index 1b2f32b..7d1786d 100644 --- a/.github/workflows/publish_release.yaml +++ b/.github/workflows/publish_release.yaml @@ -30,6 +30,14 @@ jobs: steps: - name: "Checkout the project" uses: actions/checkout@v4 + with: + path: "main" + + - name: "Checkout Mono" + uses: actions/checkout@v4 + with: + repository: "appsignal/mono" + path: "mono" - name: "Install Cross" run: | @@ -50,7 +58,15 @@ jobs: run: | rustup target add "${{matrix.target}}" + # The version number needs to be written to the project's `Cargo.toml` + # file before building the release. + - name: "Write new version number" + working-directory: "./main" + run: | + ../mono/bin/mono publish --no-git --no-package-push --yes + - name: "Build artifact" + working-directory: "./main" run: | script/build_artifact "${{matrix.target}}" @@ -60,7 +76,7 @@ jobs: uses: actions/upload-artifact@v4 with: name: "${{matrix.target}}" - path: "release/${{matrix.target}}.tar.gz" + path: "main/release/${{matrix.target}}.tar.gz" retention-days: 1 if-no-files-found: error