mirror of
https://github.com/Next-Flip/Momentum-Firmware.git
synced 2026-04-24 03:29:57 -07:00
New build system
This commit is contained in:
4
.github/workflow_data/commit.sh
vendored
4
.github/workflow_data/commit.sh
vendored
@@ -1,4 +0,0 @@
|
||||
#!/bin/bash
|
||||
|
||||
export VERSION_TAG="$(python -c 'import fbt_options; print(fbt_options.DIST_SUFFIX, end="")')"
|
||||
echo "VERSION_TAG=${VERSION_TAG}" >> $GITHUB_ENV
|
||||
18
.github/workflow_data/package.sh
vendored
18
.github/workflow_data/package.sh
vendored
@@ -1,18 +0,0 @@
|
||||
#!/bin/bash
|
||||
export ARTIFACT_DIR="${VERSION_TAG}"
|
||||
|
||||
export ARTIFACT_TGZ="${VERSION_TAG}.tgz"
|
||||
export ARTIFACT_ZIP="${VERSION_TAG}.zip"
|
||||
export ARTIFACT_SDK="${VERSION_TAG}-sdk.zip"
|
||||
cd dist/${DEFAULT_TARGET}-*
|
||||
mv ${DEFAULT_TARGET}-update-* ${ARTIFACT_DIR}
|
||||
tar --format=ustar -czvf ../../${ARTIFACT_TGZ} ${ARTIFACT_DIR}
|
||||
cd ${ARTIFACT_DIR}
|
||||
7z a ../../../${ARTIFACT_ZIP} .
|
||||
cd ..
|
||||
mv flipper-z-${DEFAULT_TARGET}-sdk-*.zip ../../${ARTIFACT_SDK}
|
||||
cd ../..
|
||||
|
||||
echo "ARTIFACT_TGZ=${ARTIFACT_TGZ}" >> $GITHUB_ENV
|
||||
echo "ARTIFACT_ZIP=${ARTIFACT_ZIP}" >> $GITHUB_ENV
|
||||
echo "ARTIFACT_SDK=${ARTIFACT_SDK}" >> $GITHUB_ENV
|
||||
13
.github/workflow_data/version.sh
vendored
13
.github/workflow_data/version.sh
vendored
@@ -1,13 +0,0 @@
|
||||
#!/bin/bash
|
||||
|
||||
export VERSION_TAG="$(python -c '''
|
||||
import datetime as dt
|
||||
import json
|
||||
import os
|
||||
with open(os.environ["GITHUB_EVENT_PATH"], "r") as f:
|
||||
event = json.load(f)
|
||||
version = int(event["pull_request"]["title"].removeprefix("V").removesuffix(" Release")
|
||||
date = dt.datetime.now().strftime("%d%m%Y")
|
||||
print(f"MNTM-{version:03}_{date}", end="")
|
||||
''')"
|
||||
echo "VERSION_TAG=${VERSION_TAG}" >> $GITHUB_ENV
|
||||
36
.github/workflow_data/webupdater.py
vendored
36
.github/workflow_data/webupdater.py
vendored
@@ -1,36 +0,0 @@
|
||||
import nextcloud_client
|
||||
import requests
|
||||
import json
|
||||
import os
|
||||
|
||||
if __name__ == "__main__":
|
||||
client = nextcloud_client.Client(os.environ["NC_HOST"])
|
||||
client.login(os.environ["NC_USER"], os.environ["NC_PASS"])
|
||||
|
||||
file = os.environ["ARTIFACT_TGZ"]
|
||||
path = f"MNTM-Release/{file}"
|
||||
try:
|
||||
client.delete(path)
|
||||
except Exception:
|
||||
pass
|
||||
client.put_file(path, file)
|
||||
|
||||
file = file.removesuffix(".tgz") + ".md"
|
||||
path = path.removesuffix(".tgz") + ".md"
|
||||
try:
|
||||
client.delete(path)
|
||||
except Exception:
|
||||
pass
|
||||
client.put_file(path, file)
|
||||
|
||||
version = os.environ['VERSION_TAG'].split("_")[0]
|
||||
files = (
|
||||
os.environ['ARTIFACT_TGZ'],
|
||||
os.environ['ARTIFACT_TGZ'].removesuffix(".tgz") + ".md"
|
||||
)
|
||||
for file in client.list("MNTM-Release"):
|
||||
if file.name.startswith(version) and file.name not in files:
|
||||
try:
|
||||
client.delete(file.path)
|
||||
except Exception:
|
||||
pass
|
||||
Reference in New Issue
Block a user