Skip to content

Commit a3a3dd4

Browse files
authored
Merge pull request #685 from JabRef/pathBuildNr
set unique safari build number
2 parents 02fbfc4 + 251b02b commit a3a3dd4

1 file changed

Lines changed: 19 additions & 0 deletions

File tree

.github/workflows/safari-signing-test.yml

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,25 @@ jobs:
3838
- name: Build Safari project
3939
run: make safari
4040

41+
- name: Set unique build number
42+
shell: bash
43+
run: |
44+
build_number="$(date -u +%Y%m%d%H%M%S)${GITHUB_RUN_ATTEMPT}"
45+
project_pbxproj='dist/safari/JabRef Browser Extension.xcodeproj/project.pbxproj'
46+
perl -0pi -e "s/CURRENT_PROJECT_VERSION = [0-9]+;/CURRENT_PROJECT_VERSION = ${build_number};/g" "$project_pbxproj"
47+
48+
for plist in \
49+
'dist/safari/JabRef Browser Extension/Info.plist' \
50+
'dist/safari/JabRef Browser Extension Extension/Info.plist' \
51+
'dist/safari/JabRef Browser Extension.app/Contents/Info.plist' \
52+
'dist/safari/JabRef Browser Extension.app/Contents/PlugIns/JabRef Browser Extension Extension.appex/Contents/Info.plist'
53+
do
54+
if [ -f "$plist" ]; then
55+
/usr/libexec/PlistBuddy -c "Set :CFBundleVersion ${build_number}" "$plist" >/dev/null 2>&1 || \
56+
/usr/libexec/PlistBuddy -c "Add :CFBundleVersion string ${build_number}" "$plist"
57+
fi
58+
done
59+
4160
- name: Upload Safari to App Store Connect
4261
uses: rxliuli/safari-webext-publish-action@624701331ecbeb38464a09d3cac6d246b6efb006
4362
with:

0 commit comments

Comments
 (0)