mirror of
https://gitlab.com/kelteseth/ScreenPlay.git
synced 2024-09-18 08:22:33 +02:00
Fix zip naming and hash creation
This commit is contained in:
parent
126af43f5c
commit
befa765117
@ -1,20 +1,26 @@
|
|||||||
import hashlib
|
import hashlib
|
||||||
import os
|
import os
|
||||||
|
from pathlib import Path
|
||||||
|
import util
|
||||||
|
|
||||||
|
|
||||||
def combine_sha256():
|
def combine_sha256():
|
||||||
|
tag = os.environ['CI_COMMIT_TAG']
|
||||||
|
|
||||||
|
# Get the repo root path as a Path object
|
||||||
|
root_path = Path(util.repo_root_path())
|
||||||
|
|
||||||
files = [
|
files = [
|
||||||
"build-x64-linux-release/ScreenPlay-" +
|
Path(
|
||||||
os.environ['CI_COMMIT_TAG'] + "-x64-linux-release.zip",
|
f"{root_path}/build-x64-windows-release/ScreenPlay-{tag}-x64-windows-release.zip"),
|
||||||
"build-x64-windows-release/ScreenPlay-" +
|
Path(
|
||||||
os.environ['CI_COMMIT_TAG'] + "-x64-windows-release.zip",
|
f"{root_path}/build-x64-linux-release/ScreenPlay-{tag}-x64-linux-release.zip"),
|
||||||
"build-64-osx-universal-release/ScreenPlay-" +
|
Path(f"{root_path}/build-64-osx-universal-release/ScreenPlay-{tag}-64-osx-universal-release.zip")
|
||||||
os.environ['CI_COMMIT_TAG'] + "-x64-osx-universal-release.zip"
|
|
||||||
]
|
]
|
||||||
|
|
||||||
with open('SHA512-SUMS.txt', 'w') as f_out:
|
with open('SHA512-SUMS.txt', 'w') as f_out:
|
||||||
for file in files:
|
for file in files:
|
||||||
with open(f"{file}.sha256.txt", 'r') as f_in:
|
with open(file.with_name(f"{file.name}.sha256.txt"), 'r') as f_in:
|
||||||
sha256_hash = f_in.read().strip()
|
sha256_hash = f_in.read().strip()
|
||||||
sha512_hash = hashlib.sha512(sha256_hash.encode()).hexdigest()
|
sha512_hash = hashlib.sha512(sha256_hash.encode()).hexdigest()
|
||||||
f_out.write(f"{sha512_hash} {file}\n")
|
f_out.write(f"{sha512_hash} {file}\n")
|
||||||
|
@ -140,7 +140,7 @@ def parse_semver(tag):
|
|||||||
|
|
||||||
|
|
||||||
def semver_to_string(semver_dict):
|
def semver_to_string(semver_dict):
|
||||||
version_str = f"V{semver_dict['major']}.{semver_dict['minor']}.{semver_dict['patch']}"
|
version_str = f"v{semver_dict['major']}.{semver_dict['minor']}.{semver_dict['patch']}"
|
||||||
if semver_dict['pre_release']:
|
if semver_dict['pre_release']:
|
||||||
version_str += f"-{semver_dict['pre_release']}"
|
version_str += f"-{semver_dict['pre_release']}"
|
||||||
return version_str
|
return version_str
|
||||||
|
Loading…
Reference in New Issue
Block a user