Skip to content

Commit bfa8104

Browse files
github: implement automatic build number (displayed in about box); improved versioning / no patching plist; new upload path
1 parent 04b24c7 commit bfa8104

File tree

12 files changed

+93
-32
lines changed

12 files changed

+93
-32
lines changed

.github/workflows/linuxbuild.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,12 +23,12 @@ jobs:
2323
- name: Run Tests
2424
run: scripts/test.sh
2525
- name: Build for Linux
26-
run: TRAVIS_OS_NAME=linux travis/build.sh
26+
run: BUILD_OS_NAME=linux travis/build.sh
2727
- name: Upload for Linux
2828
env:
2929
gh_ed25519_key: ${{ secrets.GH_ENCRYPTED_ED25519_KEY }}
3030
gh_ed25519_iv: ${{ secrets.GH_ENCRYPTED_ED25519_IV }}
31-
run: TRAVIS_OS_NAME=linux travis/upload.sh
31+
run: BUILD_OS_NAME=linux travis/upload.sh
3232
- name: Upload artifact
3333
uses: actions/upload-artifact@v4
3434
with:

.github/workflows/macbuild.yml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@ jobs:
44
build_mac:
55
name: CI for macOS
66
runs-on: macos-latest
7+
env:
8+
GITHUB_BUILD_NUMBER: ${{ github.run_number }}
79
steps:
810
- name: Checkout for macOS
911
uses: actions/checkout@v4
@@ -14,7 +16,7 @@ jobs:
1416
with:
1517
xcode-version: '16'
1618
- name: Build for macOS
17-
run: TRAVIS_OS_NAME=osx travis/build.sh
19+
run: BUILD_OS_NAME=osx travis/build.sh
1820
- name: Publish Test Results
1921
uses: EnricoMi/publish-unit-test-result-action/macos@v2
2022
if: always()
@@ -25,7 +27,7 @@ jobs:
2527
env:
2628
gh_ed25519_key: ${{ secrets.GH_ENCRYPTED_ED25519_KEY }}
2729
gh_ed25519_iv: ${{ secrets.GH_ENCRYPTED_ED25519_IV }}
28-
run: TRAVIS_OS_NAME=osx travis/upload.sh
30+
run: BUILD_OS_NAME=osx travis/upload.sh
2931
- name: Upload build artifact
3032
uses: actions/upload-artifact@v4
3133
with:

.github/workflows/windowsbuild.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,13 +25,13 @@ jobs:
2525
mingw-w64-x86_64-ffmpeg
2626
- name: Build for Windows
2727
shell: msys2 {0}
28-
run: TRAVIS_OS_NAME=windows travis/build.sh
28+
run: BUILD_OS_NAME=windows travis/build.sh
2929
- name: Upload for Windows
3030
env:
3131
gh_ed25519_key: ${{ secrets.GH_ENCRYPTED_ED25519_KEY }}
3232
gh_ed25519_iv: ${{ secrets.GH_ENCRYPTED_ED25519_IV }}
3333
shell: msys2 {0}
34-
run: TRAVIS_OS_NAME=windows travis/upload.sh
34+
run: BUILD_OS_NAME=windows travis/upload.sh
3535
- name: Upload artifact
3636
uses: actions/upload-artifact@v4
3737
with:

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -98,3 +98,4 @@ build/
9898
dist/
9999
testbuild/
100100
.DS_Store
101+
build_data/BuildParameters.xcconfig

build_data/BUILD_NUMBER

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
local

build_data/VERSION

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
1.10.1-alpha

osx/deadbeef.xcodeproj/project.pbxproj

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5697,6 +5697,9 @@
56975697
2D31044F2D7B51C300B2E846 /* Weakify.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = Weakify.h; sourceTree = "<group>"; };
56985698
2D35A24A2B74D60F006D9356 /* filereader.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = filereader.h; sourceTree = "<group>"; };
56995699
2D35A24B2B74D60F006D9356 /* filereader.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = filereader.c; sourceTree = "<group>"; };
5700+
2D3645A92EB74FD600E7EA7A /* ApplyVersion.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = ApplyVersion.xcconfig; sourceTree = "<group>"; };
5701+
2D3645AB2EB7533300E7EA7A /* BUILD_NUMBER */ = {isa = PBXFileReference; lastKnownFileType = text; path = BUILD_NUMBER; sourceTree = "<group>"; };
5702+
2D3645AD2EB7539200E7EA7A /* VERSION */ = {isa = PBXFileReference; lastKnownFileType = text; path = VERSION; sourceTree = "<group>"; };
57005703
2D3992DF25C2038700CFA936 /* WeakRefWrapper.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = WeakRefWrapper.h; sourceTree = "<group>"; };
57015704
2D3992E025C2038700CFA936 /* WeakRefWrapper.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = WeakRefWrapper.m; sourceTree = "<group>"; };
57025705
2D3A4BB41D631530002C7098 /* medialib.dylib */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.dylib"; includeInIndex = 0; path = medialib.dylib; sourceTree = BUILT_PRODUCTS_DIR; };
@@ -9889,6 +9892,16 @@
98899892
path = dial68;
98909893
sourceTree = "<group>";
98919894
};
9895+
2D3645AC2EB7533300E7EA7A /* build_data */ = {
9896+
isa = PBXGroup;
9897+
children = (
9898+
2D3645AD2EB7539200E7EA7A /* VERSION */,
9899+
2D3645AB2EB7533300E7EA7A /* BUILD_NUMBER */,
9900+
);
9901+
name = build_data;
9902+
path = ../build_data;
9903+
sourceTree = SOURCE_ROOT;
9904+
};
98929905
2D4458DD1C04F1E400230939 /* vfs_zip */ = {
98939906
isa = PBXGroup;
98949907
children = (
@@ -11677,6 +11690,7 @@
1167711690
2DA9777324C5EC26002405DA /* xcodeconfig */ = {
1167811691
isa = PBXGroup;
1167911692
children = (
11693+
2D3645A92EB74FD600E7EA7A /* ApplyVersion.xcconfig */,
1168011694
2DC6565C2744287000583E14 /* gtk2.xcconfig */,
1168111695
2DA9777424C5EC26002405DA /* gtk3.xcconfig */,
1168211696
);
@@ -12675,6 +12689,7 @@
1267512689
4D1B3E7118379829003E6066 = {
1267612690
isa = PBXGroup;
1267712691
children = (
12692+
2D3645AC2EB7533300E7EA7A /* build_data */,
1267812693
2DA9777324C5EC26002405DA /* xcodeconfig */,
1267912694
2D92D19C29B9044300218F1D /* include */,
1268012695
2D92D18C29B9039A00218F1D /* src */,
@@ -16316,6 +16331,7 @@
1631616331
isa = PBXNativeTarget;
1631716332
buildConfigurationList = 4D1B3EAB18379829003E6066 /* Build configuration list for PBXNativeTarget "DeaDBeeF" */;
1631816333
buildPhases = (
16334+
2D3645992EB74D8200E7EA7A /* Setup Build Parameters */,
1631916335
4D1B3E7618379829003E6066 /* Sources */,
1632016336
4D1B3E7718379829003E6066 /* Frameworks */,
1632116337
4D1B3E7818379829003E6066 /* Resources */,
@@ -17107,6 +17123,31 @@
1710717123
};
1710817124
/* End PBXResourcesBuildPhase section */
1710917125

17126+
/* Begin PBXShellScriptBuildPhase section */
17127+
2D3645992EB74D8200E7EA7A /* Setup Build Parameters */ = {
17128+
isa = PBXShellScriptBuildPhase;
17129+
buildActionMask = 2147483647;
17130+
files = (
17131+
);
17132+
inputFileListPaths = (
17133+
);
17134+
inputPaths = (
17135+
"$(SRCROOT)/../build_data/VERSION",
17136+
"$(SRCROOT)/../build_data/BUILD_NUMBER",
17137+
"$(SRCROOT)/scripts/setup_xcode_variables.sh",
17138+
);
17139+
name = "Setup Build Parameters";
17140+
outputFileListPaths = (
17141+
);
17142+
outputPaths = (
17143+
"$(SRCROOT)/../build_data/BuildParameters.xcconfig",
17144+
);
17145+
runOnlyForDeploymentPostprocessing = 0;
17146+
shellPath = /bin/sh;
17147+
shellScript = "${SRCROOT}/../scripts/setup_xcode_variables.sh\n";
17148+
};
17149+
/* End PBXShellScriptBuildPhase section */
17150+
1711017151
/* Begin PBXSourcesBuildPhase section */
1711117152
07021EAC1C2734AC00FC9AF9 /* Sources */ = {
1711217153
isa = PBXSourcesBuildPhase;
@@ -24515,6 +24556,7 @@
2451524556
};
2451624557
4D1B3EA918379829003E6066 /* Debug */ = {
2451724558
isa = XCBuildConfiguration;
24559+
baseConfigurationReference = 2D3645A92EB74FD600E7EA7A /* ApplyVersion.xcconfig */;
2451824560
buildSettings = {
2451924561
ALWAYS_SEARCH_USER_PATHS = NO;
2452024562
CLANG_ANALYZER_DEADCODE_DEADSTORES = NO;
@@ -24575,6 +24617,7 @@
2457524617
};
2457624618
4D1B3EAA18379829003E6066 /* Release */ = {
2457724619
isa = XCBuildConfiguration;
24620+
baseConfigurationReference = 2D3645A92EB74FD600E7EA7A /* ApplyVersion.xcconfig */;
2457824621
buildSettings = {
2457924622
ALWAYS_SEARCH_USER_PATHS = NO;
2458024623
CLANG_ANALYZER_DEADCODE_DEADSTORES = NO;
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
#include "../../build_data/BuildParameters.xcconfig"

plugins/cocoaui/deadbeef-Info.plist

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -282,11 +282,11 @@
282282
<key>CFBundlePackageType</key>
283283
<string>APPL</string>
284284
<key>CFBundleShortVersionString</key>
285-
<string>devel</string>
285+
<string>$(MARKETING_VERSION)</string>
286286
<key>CFBundleSignature</key>
287287
<string>????</string>
288288
<key>CFBundleVersion</key>
289-
<string>1</string>
289+
<string>$(BUILD_NUMBER)</string>
290290
<key>LSApplicationCategoryType</key>
291291
<string>public.app-category.music</string>
292292
<key>LSEnvironment</key>

scripts/setup_xcode_variables.sh

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
#!/bin/bash
2+
set -e
3+
if [[ -z "$SRCROOT" ]]; then
4+
echo "ERROR: SRCROOT is not defined"
5+
exit 1
6+
fi
7+
XCCONFIG="${SRCROOT}/../build_data/BuildParameters.xcconfig"
8+
9+
VERSION=$(<"$SRCROOT/../build_data/VERSION")
10+
BUILD_NUMBER=$(<"$SRCROOT/../build_data/BUILD_NUMBER")
11+
12+
echo "MARKETING_VERSION = $VERSION" > "$XCCONFIG"
13+
echo "BUILD_NUMBER = $BUILD_NUMBER" >> "$XCCONFIG"

0 commit comments

Comments
 (0)