aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGeckoEidechse <gecko.eidechse+git@pm.me>2022-08-27 21:26:58 +0200
committerGeckoEidechse <gecko.eidechse+git@pm.me>2022-08-27 21:26:58 +0200
commit37aa4a0cdfd3cdffa7df9cc270af3ec4146d7bc3 (patch)
tree1462d445b5ccb3e3710a36158d98b2e76b16be3e
parent2f2504dd4d899a86e68776ea6a5df96cd51964ba (diff)
downloadFlightCore-37aa4a0cdfd3cdffa7df9cc270af3ec4146d7bc3.tar.gz
FlightCore-37aa4a0cdfd3cdffa7df9cc270af3ec4146d7bc3.zip
Publish release file as artifact
-rw-r--r--.github/workflows/push-test.yml17
-rw-r--r--scripts/create-release-file.py44
2 files changed, 57 insertions, 4 deletions
diff --git a/.github/workflows/push-test.yml b/.github/workflows/push-test.yml
index 91ac6af2..0fdb054e 100644
--- a/.github/workflows/push-test.yml
+++ b/.github/workflows/push-test.yml
@@ -53,16 +53,25 @@ jobs:
uses: actions/upload-artifact@v2
with:
path: |
- src-tauri/target/release/bundle/appimage/*.AppImage
- src-tauri/target/release/bundle/deb/*.deb
- src-tauri/target/release/bundle/msi/*.msi
+ src-tauri/target/release/bundle/appimage/*
+ src-tauri/target/release/bundle/deb/*
+ src-tauri/target/release/bundle/msi/*
create-release-file:
needs: test-tauri
runs-on: ubuntu-20.04
steps:
- uses: actions/download-artifact@v3
- - name: Show folder structure
+ - uses: actions/checkout@v2
+ - name: Create release file
run: |
ls -al
tree
+ python3 scripts/create-release-file.py
+ ls -al
+
+ - name: upload build artifact
+ uses: actions/upload-artifact@v2
+ with:
+ path: |
+ latest-release.json
diff --git a/scripts/create-release-file.py b/scripts/create-release-file.py
new file mode 100644
index 00000000..1c364d90
--- /dev/null
+++ b/scripts/create-release-file.py
@@ -0,0 +1,44 @@
+# %%
+import json
+import datetime
+import sys
+
+assert("--version" in sys.argv)
+
+version_number = sys.argv[2]
+version_number_stripped_v = version_number.replace("v", "")
+
+PATH_TO_LINUX_SIG = f"./artifact/appimage/flightcore_{version_number_stripped_v}_amd64.AppImage.tar.gz.sig"
+PATH_TO_WINDOWS_SIG = f"./artifact/msi/flightcore_{version_number_stripped_v}_x64_en-US.msi.zip.sig"
+
+# Read signatures
+with open(PATH_TO_LINUX_SIG, "rt") as f:
+ linux_sig = f.read()
+with open(PATH_TO_WINDOWS_SIG, "rt") as f:
+ windows_sig = f.read()
+
+
+current_datetime_string = str(datetime.datetime.utcnow().replace(microsecond=0).isoformat() + "Z")
+
+release_dict = {
+ "version": f"{version_number}",
+ "notes": "Test version",
+ "pub_date": current_datetime_string,
+ "platforms": {
+ "linux-x86_64": {
+ "signature": linux_sig,
+ "url": f"https://github.com/GeckoEidechse/FlightCore/releases/download/{version_number}/flightcore_{version_number_stripped_v}_amd64.AppImage.tar.gz"
+ },
+ "windows-x86_64": {
+ "signature": windows_sig,
+ "url": f"https://github.com/GeckoEidechse/FlightCore/releases/download/{version_number}/flightcore_{version_number_stripped_v}_x64_en-US.msi.zip"
+ }
+ }
+}
+json_string = json.dumps(release_dict, indent=4)
+print(json_string)
+# %%
+RESULT_JSON_FILENAME = "latest-release.json"
+with open(RESULT_JSON_FILENAME, "wt") as f:
+ f.write(json_string)
+# %%