Skip to content

Commit e4c222a

Browse files
hughnsjmartinesp
andauthored
Expose version string in embedded SwiftPM and AAR (#3144)
* Expose version string in embedded SwiftPM and AAR Implements #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 <[email protected]>
1 parent d12d616 commit e4c222a

File tree

3 files changed

+26
-3
lines changed

3 files changed

+26
-3
lines changed

.github/workflows/publish-embedded-packages.yaml

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -124,6 +124,9 @@ jobs:
124124
- name: Get artifact version
125125
run: echo "ARTIFACT_VERSION=${VERSION:1}" >> "$GITHUB_ENV"
126126

127+
- name: Set version string
128+
run: sed -i "s/0.0.0/${{ env.ARTIFACT_VERSION }}/g" embedded/android/lib/src/main/kotlin/io/element/android/call/embedded/Version.kt
129+
127130
- name: Publish AAR
128131
working-directory: embedded/android
129132
env:
@@ -165,13 +168,16 @@ jobs:
165168
- name: Copy files
166169
run: rsync -a --delete --exclude .git element-call/embedded/ios/ element-call-swift
167170

171+
- name: Get artifact version
172+
run: echo "ARTIFACT_VERSION=${VERSION:1}" >> "$GITHUB_ENV"
173+
174+
- name: Set version string
175+
run: sed -i "s/0.0.0/${{ env.ARTIFACT_VERSION }}/g" element-call-swift/Sources/EmbeddedElementCall/EmbeddedElementCall.swift
176+
168177
- name: Test build
169178
working-directory: element-call-swift
170179
run: swift build
171180

172-
- name: Get artifact version
173-
run: echo "ARTIFACT_VERSION=${VERSION:1}" >> "$GITHUB_ENV"
174-
175181
- name: Commit and tag
176182
working-directory: element-call-swift
177183
run: |
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
/*
2+
* Copyright 2025 New Vector Ltd.
3+
*
4+
* SPDX-License-Identifier: AGPL-3.0-only OR LicenseRef-Element-Commercial
5+
* Please see LICENSE files in the repository root for full details.
6+
*/
7+
8+
const val VERSION = "0.0.0"
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,14 @@
1+
//
2+
// Copyright 2025 New Vector Ltd.
3+
//
4+
// SPDX-License-Identifier: AGPL-3.0-only OR LicenseRef-Element-Commercial
5+
// Please see LICENSE files in the repository root for full details.
6+
//
7+
18
import Foundation
29

310
public let appURL = Bundle.module.url(forResource: "index", withExtension: "html", subdirectory: "dist")
411

512
public let bundle = Bundle.module
13+
14+
public let version = "0.0.0"

0 commit comments

Comments
 (0)