Skip to content

Commit 4899986

Browse files
authored
Versioning: use YYYY.MM.DD rather than YYYYMMDD.
2 parents b5797d9 + eac4780 commit 4899986

File tree

6 files changed

+67
-64
lines changed

6 files changed

+67
-64
lines changed

CMakeLists.txt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ endforeach()
1010

1111
# Project details.
1212

13-
project(libOpenCOR VERSION 20250508)
13+
project(libOpenCOR VERSION 2025.05.09)
1414

1515
# Enable C++20.
1616

@@ -57,7 +57,7 @@ else()
5757
endif()
5858
endif()
5959

60-
set(LIBOPENCOR_FILE_NAME_WE ${CMAKE_PROJECT_NAME}-${PROJECT_VERSION}${PLATFORM}${ARCHITECTURE}-Static${MODE})
60+
set(LIBOPENCOR_FILE_NAME_WE ${CMAKE_PROJECT_NAME}-${PROJECT_VERSION_MAJOR}.${PROJECT_VERSION_MINOR}.${PROJECT_VERSION_PATCH}${PLATFORM}${ARCHITECTURE}-Static${MODE})
6161
set(LIBOPENCOR_FILE_NAME ${LIBOPENCOR_FILE_NAME_WE}${EXTENSION})
6262

6363
file(DOWNLOAD https://opencor.ws/libopencor/downloads/${LIBOPENCOR_FILE_NAME}
@@ -167,7 +167,7 @@ string(TIMESTAMP CURRENT_YEAR "%Y")
167167
string(TIMESTAMP CURRENT_MONTH "%m")
168168
string(TIMESTAMP CURRENT_DAY "%d")
169169

170-
set(VERSION "${CURRENT_YEAR}${CURRENT_MONTH}${CURRENT_DAY}")
170+
set(VERSION "${CURRENT_YEAR}.${CURRENT_MONTH}.${CURRENT_DAY}")
171171

172172
configure_file(src/main/assets/splashscreen.html.in
173173
${CMAKE_BINARY_DIR}/../../out/splashscreen.html)

electron-builder.yml

Lines changed: 4 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,22 @@
11
appId: ws.opencor.app
2+
buildVersion: 2025.05.09
23
productName: OpenCOR
34
win:
4-
artifactName: ${productName}-${version}-Windows-${arch}.${ext}
5+
artifactName: ${productName}-${buildVersion}-Windows-${arch}.${ext}
56
target:
67
- nsis
78
- zip
89
nsis:
910
uninstallDisplayName: ${productName}
1011
linux:
11-
artifactName: ${productName}-${version}-Linux-${arch}.${ext}
12+
artifactName: ${productName}-${buildVersion}-Linux-${arch}.${ext}
1213
category: Utility
1314
executableName: OpenCOR
1415
target:
1516
- AppImage
1617
- tar.gz
1718
mac:
18-
# - Code signing:
19-
# - Generate a “Developer ID Application” certificate (this can only be done by the team’s account holder; see https://developer.apple.com/help/account/create-certificates/create-developer-id-certificates).
20-
# - For the certificate to be usable by other team members, the account holder must generate (and then share) a `.p12` file and its corresponding password:
21-
# - Double click on the `.cer` file (this will add the certificate to the `My Certificates` section of the `login` keychain).
22-
# - Export the certificate (by right clicking on it) and give it a password.
23-
# - Notarisation:
24-
# - APPLE_ID: the team member’s email address used to login to https://account.apple.com/.
25-
# - APPLE_APP_SPECIFIC_PASSWORD: a password the team member generated using the App-Specific Passwords tool at https://account.apple.com/account/manage.
26-
# - APPLE_TEAM_ID: an id that can be found in the top right corner of https://developer.apple.com/account/resources/certificates/list.
27-
artifactName: ${productName}-${version}-macOS-${arch}.${ext}
19+
artifactName: ${productName}-${buildVersion}-macOS-${arch}.${ext}
2820
target:
2921
- dmg
3022
- pkg

package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
"url": "git+https://github.com/opencor/webapp.git"
2424
},
2525
"type": "module",
26-
"version": "20250508",
26+
"version": "2025.05.09",
2727
"pnpm": {
2828
"onlyBuiltDependencies": [
2929
"electron",
@@ -54,7 +54,7 @@
5454
"@primevue/auto-import-resolver": "^4.3.4",
5555
"@tailwindcss/postcss": "^4.1.5",
5656
"@tailwindcss/vite": "^4.1.5",
57-
"@types/node": "^22.15.16",
57+
"@types/node": "^22.15.17",
5858
"@vitejs/plugin-vue": "^5.2.3",
5959
"@vue/eslint-config-prettier": "^10.2.0",
6060
"@vue/eslint-config-typescript": "^14.5.0",
@@ -69,7 +69,7 @@
6969
"electron-settings": "^4.0.4",
7070
"electron-vite": "^3.1.0",
7171
"eslint": "^9.26.0",
72-
"libopencor": "https://opencor.ws/libopencor/downloads/libopencor-20250508.tgz",
72+
"libopencor": "https://opencor.ws/libopencor/downloads/libopencor-2025.05.09.tgz",
7373
"node-addon-api": "^8.3.1",
7474
"prettier": "^3.5.3",
7575
"primeicons": "^7.0.0",

pnpm-lock.yaml

Lines changed: 38 additions & 38 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

scripts/version.js

Lines changed: 18 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,29 @@
11
import fs from 'fs'
2+
import yaml from 'js-yaml'
23

34
const now = new Date()
45
const year = now.getFullYear()
56
const month = now.getMonth() + 1
67
const day = now.getDate()
7-
const version = `${year}${String(month).padStart(2, '0')}${String(day).padStart(2, '0')}`
8+
const version = `${year}.${String(month).padStart(2, '0')}.${String(day).padStart(2, '0')}`
89

9-
function updateVersion(packageJsonPath) {
10-
const json = JSON.parse(fs.readFileSync(packageJsonPath))
10+
function updatePackageJsonFile(filePath) {
11+
const contents = JSON.parse(fs.readFileSync(filePath))
1112

12-
json.version = version
13+
contents.version = version
1314

14-
fs.writeFileSync(packageJsonPath, JSON.stringify(json, null, 2) + '\n')
15+
fs.writeFileSync(filePath, JSON.stringify(contents, null, 2) + '\n')
1516
}
1617

17-
updateVersion('package.json')
18-
updateVersion('src/renderer/package.json')
18+
updatePackageJsonFile('package.json')
19+
updatePackageJsonFile('src/renderer/package.json')
20+
21+
function updateYamlFile(filePath) {
22+
const contents = yaml.load(fs.readFileSync(filePath))
23+
24+
contents.buildVersion = version
25+
26+
fs.writeFileSync(filePath, yaml.dump(contents))
27+
}
28+
29+
updateYamlFile('electron-builder.yml')

src/renderer/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
"url": "git+https://github.com/opencor/webapp.git"
1717
},
1818
"type": "module",
19-
"version": "20250508",
19+
"version": "2025.05.09",
2020
"devDependencies": {
2121
"@primeuix/themes": "^1.1.1",
2222
"@primevue/auto-import-resolver": "^4.3.4",

0 commit comments

Comments
 (0)