Expose version string in embedded SwiftPM and AAR (#3144)

* Expose version string in embedded SwiftPM and AAR

Implements https://github.com/element-hq/element-call/issues/3143

* Fix filename

* Fix location of `Version.kt`

* Use the right path for the sed replacement in the publishing workflow for Android

---------

Co-authored-by: Jorge Martín <jorgem@element.io>
This commit is contained in:
Hugh Nimmo-Smith
2025-03-31 14:55:20 +01:00
committed by GitHub
parent d12d616e28
commit e4c222a4e8
3 changed files with 26 additions and 3 deletions

View File

@@ -124,6 +124,9 @@ jobs:
- name: Get artifact version
run: echo "ARTIFACT_VERSION=${VERSION:1}" >> "$GITHUB_ENV"
- name: Set version string
run: sed -i "s/0.0.0/${{ env.ARTIFACT_VERSION }}/g" embedded/android/lib/src/main/kotlin/io/element/android/call/embedded/Version.kt
- name: Publish AAR
working-directory: embedded/android
env:
@@ -165,13 +168,16 @@ jobs:
- name: Copy files
run: rsync -a --delete --exclude .git element-call/embedded/ios/ element-call-swift
- name: Get artifact version
run: echo "ARTIFACT_VERSION=${VERSION:1}" >> "$GITHUB_ENV"
- name: Set version string
run: sed -i "s/0.0.0/${{ env.ARTIFACT_VERSION }}/g" element-call-swift/Sources/EmbeddedElementCall/EmbeddedElementCall.swift
- name: Test build
working-directory: element-call-swift
run: swift build
- name: Get artifact version
run: echo "ARTIFACT_VERSION=${VERSION:1}" >> "$GITHUB_ENV"
- name: Commit and tag
working-directory: element-call-swift
run: |

View File

@@ -0,0 +1,8 @@
/*
* Copyright 2025 New Vector Ltd.
*
* SPDX-License-Identifier: AGPL-3.0-only OR LicenseRef-Element-Commercial
* Please see LICENSE files in the repository root for full details.
*/
const val VERSION = "0.0.0"

View File

@@ -1,5 +1,14 @@
//
// Copyright 2025 New Vector Ltd.
//
// SPDX-License-Identifier: AGPL-3.0-only OR LicenseRef-Element-Commercial
// Please see LICENSE files in the repository root for full details.
//
import Foundation
public let appURL = Bundle.module.url(forResource: "index", withExtension: "html", subdirectory: "dist")
public let bundle = Bundle.module
public let version = "0.0.0"