From 3bf603a947e603b73712a3046f86c8447fc3115d Mon Sep 17 00:00:00 2001 From: Thomas Eizinger Date: Sat, 2 Nov 2024 02:49:53 +1100 Subject: [PATCH] ci: checkout tags for release builds (#7202) In the Rust code, we use `git describe` to determine the current version of the code. This only works if tags are actually checked out. To save time, the `actions/checkout` action by default only does a shallow-clone of depth 1 without any tags. Due to that, all events in Sentry just show up as a commit hash. --- .github/workflows/_kotlin.yml | 2 ++ .github/workflows/_swift.yml | 2 ++ .github/workflows/_tauri.yml | 2 ++ 3 files changed, 6 insertions(+) diff --git a/.github/workflows/_kotlin.yml b/.github/workflows/_kotlin.yml index 6c3bee128..d5e4d9ace 100644 --- a/.github/workflows/_kotlin.yml +++ b/.github/workflows/_kotlin.yml @@ -27,6 +27,8 @@ jobs: name: build-release steps: - uses: actions/checkout@v4 + with: + fetch-tags: true # Otherwise we cannot embed the correct version into the build. - uses: ./.github/actions/setup-android - name: Bundle and sign release env: diff --git a/.github/workflows/_swift.yml b/.github/workflows/_swift.yml index 657cd0dd5..fba6200e3 100644 --- a/.github/workflows/_swift.yml +++ b/.github/workflows/_swift.yml @@ -29,6 +29,8 @@ jobs: working-directory: ./swift/apple steps: - uses: actions/checkout@v4 + with: + fetch-tags: true # Otherwise we cannot embed the correct version into the build. - uses: ./.github/actions/setup-rust with: targets: aarch64-apple-darwin aarch64-apple-ios x86_64-apple-darwin diff --git a/.github/workflows/_tauri.yml b/.github/workflows/_tauri.yml index 07179b466..a05216cc1 100644 --- a/.github/workflows/_tauri.yml +++ b/.github/workflows/_tauri.yml @@ -64,6 +64,8 @@ jobs: UPLOAD_SCRIPT: ../../scripts/build/tauri-upload-${{ matrix.os }}.sh steps: - uses: actions/checkout@v4 + with: + fetch-tags: true # Otherwise we cannot embed the correct version into the build. - uses: ./.github/actions/setup-node - uses: ./.github/actions/setup-rust - uses: ./.github/actions/setup-tauri-v2