Skip to content

Commit 9d4b5eb

Browse files
author
Dennis Sheirer
committed
#1709 Adds build timestamp info to nightly releases.
1 parent 9dbed72 commit 9d4b5eb

File tree

3 files changed

+30
-14
lines changed

3 files changed

+30
-14
lines changed

.github/workflows/gradle.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ jobs:
2121
runs-on: ${{ matrix.os }}
2222

2323
steps:
24-
- uses: actions/checkout@v2
24+
- uses: actions/checkout@v4
2525
- name: Set up JDK 20
2626
uses: actions/setup-java@v3
2727
with:

.github/workflows/nightly.yml

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,15 @@ name: Nightly Release
44
on:
55
push:
66
branches: [ master ]
7+
pull_request: # Uncomment to test github action in the PR review
8+
branches: [ master ]
79

810
jobs:
911
nightly:
1012
runs-on: ubuntu-latest
1113

1214
steps:
13-
- uses: actions/checkout@v2
15+
- uses: actions/checkout@v4
1416

1517
- name: Set up JDK 20
1618
uses: actions/setup-java@v3
@@ -29,10 +31,16 @@ jobs:
2931
with:
3032
arguments: runtimeZipWindows -PprojectVersion=nightly
3133

34+
- name: Create Build Info file
35+
run: |
36+
echo -e "ref: $GITHUB_REF \ncommit: $GITHUB_SHA\nbuild: $(date +"%Y-%m-%dT%H:%M:%SZ")" > build/image/build_info.txt
37+
3238
- name: Add build artifacts to nightly release
3339
uses: pyTooling/Actions/releaser@main
3440
with:
3541
tag: nightly
3642
rm: false
3743
token: ${{ secrets.GITHUB_TOKEN }}
38-
files: build/image/*.zip
44+
files: |
45+
build/image/*.zip
46+
build/image/build_info.txt

src/main/java/io/github/dsheirer/properties/SystemProperties.java

Lines changed: 19 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
/*******************************************************************************
2-
* sdrtrunk
3-
* Copyright (C) 2014-2017 Dennis Sheirer
1+
/*
2+
* *****************************************************************************
3+
* Copyright (C) 2014-2023 Dennis Sheirer
44
*
55
* This program is free software: you can redistribute it and/or modify
66
* it under the terms of the GNU General Public License as published by
@@ -14,16 +14,13 @@
1414
*
1515
* You should have received a copy of the GNU General Public License
1616
* along with this program. If not, see <http://www.gnu.org/licenses/>
17-
*
18-
******************************************************************************/
17+
* ****************************************************************************
18+
*/
1919
package io.github.dsheirer.properties;
2020

2121
import io.github.dsheirer.gui.SDRTrunk;
2222
import io.github.dsheirer.util.ThreadPool;
23-
import org.slf4j.Logger;
24-
import org.slf4j.LoggerFactory;
25-
26-
import java.awt.*;
23+
import java.awt.Color;
2724
import java.io.FileInputStream;
2825
import java.io.FileOutputStream;
2926
import java.io.IOException;
@@ -37,6 +34,8 @@
3734
import java.util.concurrent.TimeUnit;
3835
import java.util.concurrent.atomic.AtomicBoolean;
3936
import java.util.jar.Manifest;
37+
import org.slf4j.Logger;
38+
import org.slf4j.LoggerFactory;
4039

4140
/**
4241
* SystemProperties - provides an isolated instance of properties for the application
@@ -48,6 +47,7 @@ public class SystemProperties
4847
private static String DEFAULT_APP_ROOT = "SDRTrunk";
4948
private static String PROPERTIES_FILENAME = "SDRTrunk.properties";
5049
private static String MANIFEST_VERSION = "Implementation-Version";
50+
private static String BUILD_TIMESTAMP = "Build-Timestamp";
5151

5252
private static SystemProperties INSTANCE;
5353
private static Properties mProperties;
@@ -208,11 +208,19 @@ public String getApplicationName()
208208
if(manifest != null)
209209
{
210210
String version = manifest.getMainAttributes().getValue(MANIFEST_VERSION);
211+
String timestamp = manifest.getMainAttributes().getValue(BUILD_TIMESTAMP);
211212

212213
if(version != null)
213214
{
214-
sb.append(" v");
215-
sb.append(version);
215+
if(version.contains("nightly") && timestamp != null)
216+
{
217+
sb.append( " nightly - ").append(timestamp);
218+
}
219+
else
220+
{
221+
sb.append(" v");
222+
sb.append(version);
223+
}
216224
}
217225
}
218226

0 commit comments

Comments
 (0)