Skip to content

Commit 34e0c9f

Browse files
committed
Use GITHUB RUN NUMBER as a preview build suffix.
1 parent 6a1cebd commit 34e0c9f

File tree

3 files changed

+18
-6
lines changed

3 files changed

+18
-6
lines changed

.github/workflows/publish.yml

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: Publish to OSSRH
1+
name: Build and Publish to GitHub Packages
22

33
on:
44
push:
@@ -33,23 +33,25 @@ jobs:
3333
working-directory: ./src/AndroidClient
3434
run: ./gradlew client:build
3535

36-
- name: Build and Publish
36+
- name: Build and Publish Client
3737
env:
3838
USERNAME_GITHUB: ${{ github.actor }}
3939
TOKEN_GITHUB: ${{ secrets.GITHUB_TOKEN }}
40+
VERSION_SUFFIX: ${{ github.run_number }}
4041
working-directory: ./src/AndroidClient
41-
run: ./gradlew client:publishAllPublicationsToGitHubPackagesRepository
42+
run: ./gradlew client:publishAllPublicationsToGitHubPackagesRepository -PversionSuffix=$VERSION_SUFFIX
4243

4344
- name: Build android
4445
working-directory: ./src/AndroidClient
4546
run: ./gradlew android:build
4647

47-
- name: Build and Publish
48-
working-directory: ./src/AndroidClient
48+
- name: Build and Publish Android
4949
env:
5050
USERNAME_GITHUB: ${{ github.actor }}
5151
TOKEN_GITHUB: ${{ secrets.GITHUB_TOKEN }}
52-
run: ./gradlew android:publishAllPublicationsToGitHubPackagesRepository
52+
VERSION_SUFFIX: ${{ github.run_number }}
53+
working-directory: ./src/AndroidClient
54+
run: ./gradlew android:publishAllPublicationsToGitHubPackagesRepository -PversionSuffix=$VERSION_SUFFIX
5355

5456
# env:
5557
# OSSRH_USERNAME: ${{ secrets.OSSRH_USERNAME }}

src/AndroidClient/android/build.gradle

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,11 @@ apply plugin: 'maven-publish'
55
// Define the version and group for the Maven package
66
version = "1.0.50"
77
group = "net.servicestack"
8+
9+
if (project.hasProperty('versionSuffix')) {
10+
version = "${version}-${versionSuffix}"
11+
}
12+
813
// Specify dependencies
914
dependencies {
1015
implementation 'com.google.code.gson:gson:2.8.9'

src/AndroidClient/client/build.gradle

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,11 @@ apply plugin: 'maven-publish'
66
version = "1.0.50"
77
group = "net.servicestack"
88

9+
if (project.hasProperty('versionSuffix')) {
10+
version = "${version}-${versionSuffix}"
11+
}
12+
13+
914
// Specify dependencies
1015
dependencies {
1116
implementation 'com.google.code.gson:gson:2.8.9'

0 commit comments

Comments
 (0)