Skip to content

Commit 764a5be

Browse files
Added static versioning
1 parent f1b7320 commit 764a5be

File tree

7 files changed

+19
-22
lines changed

7 files changed

+19
-22
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "website",
3-
"version": "1.0.0",
3+
"version": "1.12.24",
44
"repository": {
55
"type": "git",
66
"url": "https://github.com/web-dl-tools/website.git"

src/components/application/CardApiBuild.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
<v-card-text v-else>
1919
<v-row>
2020
<v-col class="text-center">
21-
<span class="font-weight-bold"> v{{ apiBuildInfo.tag }} </span>
21+
<span class="font-weight-bold"> v{{ apiBuildInfo.version }} </span>
2222
<v-divider class="mt-3" />
2323
<latest-release-check repo="api" />
2424
</v-col>

src/components/application/CardWebsiteBuild.vue

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,9 @@
1111
<v-card-text>
1212
<v-row>
1313
<v-col class="text-center">
14-
<span class="font-weight-bold"> v{{ websiteBuildInfo.tag }} </span>
14+
<span class="font-weight-bold">
15+
v{{ websiteBuildInfo.version }}
16+
</span>
1517
<v-divider class="mt-3" />
1618
<latest-release-check repo="website" />
1719
</v-col>

src/components/application/LatestReleaseCheck.vue

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@
4545
text
4646
x-small
4747
color="white"
48-
:href="`https://github.com/web-dl-tools/${repo}/compare/${buildInfo.tag}...${latestReleaseInfo.tag_name}`"
48+
:href="`https://github.com/web-dl-tools/${repo}/compare/${buildInfo.version}...${latestReleaseInfo.tag_name}`"
4949
>
5050
Changelog
5151
</v-btn>
@@ -93,7 +93,7 @@ export default {
9393
versionDifference() {
9494
if (this.buildInfo && this.latestReleaseInfo) {
9595
return this.formatVersioningDifference(
96-
this.buildInfo.tag,
96+
this.buildInfo.version,
9797
this.latestReleaseInfo.tag_name
9898
);
9999
}

src/components/ui/Footer.vue

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
cols="12"
2626
>
2727
<span class="font-weight-bold">Web DL Website</span>
28-
v{{ buildInfo.tag }}
28+
v{{ buildInfo.version }}
2929
</v-col>
3030

3131
<v-col
@@ -34,7 +34,7 @@
3434
cols="12"
3535
>
3636
<span class="font-weight-bold">Web DL API</span>
37-
v{{ apiBuildInfo.tag }} &middot; build
37+
v{{ apiBuildInfo.version }} &middot; build
3838
{{ apiBuildInfo.abbreviated_commit }} &middot;
3939
{{ formatDate(apiBuildInfo.commiter.date, "LL") }}
4040
</v-col>
@@ -44,7 +44,7 @@
4444
cols="12"
4545
>
4646
<span class="font-weight-bold">Web DL API</span>
47-
v{{ apiBuildInfo.tag }}
47+
v{{ apiBuildInfo.version }}
4848
</v-col>
4949
</div>
5050
</v-row>
@@ -53,12 +53,12 @@
5353
<v-row>
5454
<v-col class="pb-0" cols="12">
5555
<span class="font-weight-bold">Web DL Website</span>
56-
v{{ buildInfo.tag }}
56+
v{{ buildInfo.version }}
5757
</v-col>
5858

5959
<v-col class="pt-0" cols="12">
6060
<span class="font-weight-bold">Web DL API</span>
61-
v{{ apiBuildInfo.tag }}
61+
v{{ apiBuildInfo.version }}
6262
</v-col>
6363
</v-row>
6464
</v-col>

src/store/application/getters.js

Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -51,17 +51,8 @@ export const getWebsocket = (state) => state.websocket;
5151
*
5252
* @returns {any}
5353
*/
54-
export const getWebsiteBuildInfo = () => {
55-
const regex = /tag: [\w\.\-]+,/g;
56-
let buildInfo = JSON.parse(process.env.VUE_APP_BUILD_INFO);
57-
let tags = buildInfo.refs.match(regex);
58-
59-
buildInfo.tag = tags
60-
? tags[0].replace("tag:", "").replace(",", "").trim()
61-
: "0.0.0";
62-
63-
return buildInfo;
64-
};
54+
export const getWebsiteBuildInfo = () =>
55+
JSON.parse(process.env.VUE_APP_BUILD_INFO);
6556

6657
/**
6758
* Get the search query.

vue.config.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,10 @@ const command =
44
'git log -n 1 --pretty=format:\'{%n "commit": "%H",%n "abbreviated_commit": "%h",%n "tree": "%T",%n "abbreviated_tree": "%t",%n "parent": "%P",%n "abbreviated_parent": "%p",%n "refs": "%D",%n "encoding": "%e",%n "subject": "%s",%n "sanitized_subject_line": "%f",%n "body": "%b",%n "commit_notes": "%N",%n "verification_flag": "%G?",%n "signer": "%GS",%n "signer_key": "%GK",%n "author": {%n "name": "%aN",%n "date": "%aD"%n },%n "commiter": {%n "name": "%cN",%n "date": "%cD"%n }%n},\'\n';
55

66
buildInfo = execSync(command).toString().slice(0, -1);
7-
process.env.VUE_APP_BUILD_INFO = buildInfo;
7+
8+
process.env.VUE_APP_BUILD_INFO = JSON.stringify({
9+
...JSON.parse(buildInfo),
10+
version: process.env.npm_package_version,
11+
});
812

913
module.exports = {};

0 commit comments

Comments
 (0)