mirror of
https://github.com/KeksPirates/SoftwareManager.git
synced 2026-08-03 17:39:42 +02:00
Compare commits
7 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 2354adb349 | |||
| 4c69a17f0e | |||
| 2bab6c3321 | |||
| 91482760b6 | |||
| 83fa23df58 | |||
| 41d28095c2 | |||
| de2e49e60b |
+15
-13
@@ -25,18 +25,19 @@ jobs:
|
||||
matrix:
|
||||
include:
|
||||
- os: ubuntu-latest
|
||||
artifact_name: SoftwareManager-dev-linux
|
||||
asset_name: SoftwareManager-dev-linux
|
||||
artifact_name: SoftwareManager-dev-${{ github.sha }}-linux
|
||||
asset_name: SoftwareManager-dev-${{ github.sha }}-linux
|
||||
- os: windows-latest
|
||||
artifact_name: SoftwareManager-dev-windows.exe
|
||||
asset_name: SoftwareManager-dev-windows.exe
|
||||
artifact_name: SoftwareManager-dev-${{ github.sha }}-windows.exe
|
||||
asset_name: SoftwareManager-dev-${{ github.sha }}-windows.exe
|
||||
- os: macos-latest
|
||||
artifact_name: SoftwareManager-dev-macos
|
||||
asset_name: SoftwareManager-dev-macos
|
||||
artifact_name: SoftwareManager-dev-${{ github.sha }}-macos
|
||||
asset_name: SoftwareManager-dev-${{ github.sha }}-macos
|
||||
|
||||
runs-on: ${{ matrix.os }}
|
||||
outputs:
|
||||
version: ${{ steps.version.outputs.version }}
|
||||
short_sha: ${{ steps.version.outputs.short_sha }}
|
||||
|
||||
steps:
|
||||
- name: Checkout code
|
||||
@@ -130,10 +131,11 @@ jobs:
|
||||
- name: Prepare release files
|
||||
run: |
|
||||
mkdir -p release
|
||||
cp artifacts/ubuntu-latest-build/SoftwareManager-dev-linux release/
|
||||
cp artifacts/windows-latest-build/SoftwareManager-dev-windows.exe release/
|
||||
cp artifacts/macos-latest-build/SoftwareManager-dev-macos release/
|
||||
chmod +x release/SoftwareManager-dev-linux release/SoftwareManager-dev-macos
|
||||
SHORT_SHA="${{ needs.build.outputs.short_sha }}"
|
||||
cp artifacts/ubuntu-latest-build/SoftwareManager-dev-*-linux release/SoftwareManager-dev-${SHORT_SHA}-linux
|
||||
cp artifacts/windows-latest-build/SoftwareManager-dev-*-windows.exe release/SoftwareManager-dev-${SHORT_SHA}-windows.exe
|
||||
cp artifacts/macos-latest-build/SoftwareManager-dev-*-macos release/SoftwareManager-dev-${SHORT_SHA}-macos
|
||||
chmod +x release/SoftwareManager-dev-*-linux release/SoftwareManager-dev-*-macos
|
||||
ls -la release/
|
||||
|
||||
- name: Create Release (Public)
|
||||
@@ -142,8 +144,8 @@ jobs:
|
||||
tag_name: ${{ needs.build.outputs.version }}
|
||||
name: ${{ needs.build.outputs.version }}
|
||||
files: |
|
||||
release/SoftwareManager-dev-linux
|
||||
release/SoftwareManager-dev-windows.exe
|
||||
release/SoftwareManager-dev-macos
|
||||
release/SoftwareManager-dev-${{ needs.build.outputs.short_sha }}-linux
|
||||
release/SoftwareManager-dev-${{ needs.build.outputs.short_sha }}-windows.exe
|
||||
release/SoftwareManager-dev-${{ needs.build.outputs.short_sha }}-macos
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
|
||||
+11
-8
@@ -38,19 +38,22 @@ from core.interface.utils.searchhelper import return_pressed
|
||||
from core.interface.dialogs.settings import settings_dialog
|
||||
from core.network.aria2_integration import dlprogress
|
||||
|
||||
def download_update():
|
||||
filename = "SoftwareManager-dev-windows.exe"
|
||||
url = "https://github.com/KeksPirates/SoftwareManager/releases/latest/download/SoftwareManager-dev-windows.exe"
|
||||
print(os.path.abspath(__file__))
|
||||
|
||||
def download_update(latest_version):
|
||||
old_filename = f"SoftwareManager-dev-{state.version.replace('-dev', '')}-windows.exe"
|
||||
new_filename = f"SoftwareManager-dev-{latest_version.replace('-dev', '')}-windows.exe"
|
||||
url = f"https://github.com/KeksPirates/SoftwareManager/releases/latest/download/SoftwareManager-dev-{latest_version.replace('-dev', '')}-windows.exe"
|
||||
|
||||
print("Downloading update...")
|
||||
if os.path.exists(filename):
|
||||
os.remove(filename)
|
||||
if os.path.exists(old_filename):
|
||||
os.remove(old_filename)
|
||||
response = r.get(url, allow_redirects=True)
|
||||
with open(filename, "wb") as f:
|
||||
with open(new_filename, "wb") as f:
|
||||
f.write(response.content)
|
||||
if not os.path.exists(filename):
|
||||
if not os.path.exists(new_filename):
|
||||
raise FileNotFoundError(f"Executable not found")
|
||||
subprocess.Popen([filename], shell=True)
|
||||
subprocess.Popen([new_filename], shell=True)
|
||||
time.sleep(0.5)
|
||||
sys.exit(0)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user