Compare commits

..

10 Commits

Author SHA1 Message Date
KeksNino 83fa23df58 fix release file names 2025-10-20 17:58:40 +02:00
KeksNino 41d28095c2 fix workflows 2025-10-20 17:53:35 +02:00
KeksNino de2e49e60b add back commit sha to release file name 2025-10-20 17:40:39 +02:00
KeksNino dd6d16d833 fix workflows (again) 2025-10-20 17:24:04 +02:00
KeksNino 7d0c8d16ec fix workflows (again) 2025-10-20 17:21:47 +02:00
KeksNino 80750f010f fix workflows (again) 2025-10-20 17:00:14 +02:00
KeksNino c93f6345c8 fix workflows (again) 2025-10-20 16:36:10 +02:00
KeksNino a7132ed1cd fix workflows (again) 2025-10-19 19:45:19 +02:00
KeksNino a2cff15d0d fix workflows (hopefully) 2025-10-19 19:39:33 +02:00
KeksNino 2eb384f7cf fix build_info.json 2025-10-19 17:51:21 +02:00
2 changed files with 60 additions and 53 deletions
+47 -41
View File
@@ -25,16 +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
@@ -66,13 +69,35 @@ jobs:
pip install -r requirements.txt
pip install pyinstaller
- name: Inject commit hash into code
- name: Generate version
id: version
shell: bash
run: |
echo "version = '${GITHUB_SHA}'" > build_info.json
COMMIT_SHA=${{ github.sha }}
SHORT_SHA=${COMMIT_SHA:0:7}
VERSION="${SHORT_SHA}-dev"
echo "VERSION=$VERSION" >> $GITHUB_ENV
echo "version=$VERSION" >> $GITHUB_OUTPUT
echo "short_sha=$SHORT_SHA" >> $GITHUB_OUTPUT
echo "Generated version: $VERSION"
- name: Build executable with PyInstaller
- name: Inject commit hash into code (Windows)
if: runner.os == 'Windows'
shell: pwsh
run: |
$json = '{
"version": "' + $env:VERSION + '"
}'
$json | Out-File -Encoding utf8 build_info.json
- name: Build executable with PyInstaller (Windows)
if: runner.os == 'Windows'
run: pyinstaller --onefile --windowed --add-data "build_info.json:." --name ${{ env.APP_NAME }} main.py
- name: Build executable with PyInstaller (Unix)
if: runner.os != 'Windows'
run: pyinstaller --onefile --windowed --name ${{ env.APP_NAME }} main.py
- name: Make executable (Unix)
if: runner.os != 'Windows'
run: chmod +x dist/${{ env.APP_NAME }}
@@ -98,49 +123,30 @@ jobs:
if: success()
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Download all artifacts
uses: actions/download-artifact@v4
- uses: actions/checkout@v4
- uses: actions/download-artifact@v4
with:
path: artifacts
- name: Display downloaded artifacts
run: |
echo "Downloaded artifacts:"
find artifacts -type f
ls -la artifacts/
- name: Generate version
id: version
run: |
COMMIT_SHA=${{ github.sha }}
SHORT_SHA=${COMMIT_SHA:0:7}
VERSION="${SHORT_SHA}-dev"
echo "version=${VERSION}" >> $GITHUB_OUTPUT
echo "short_sha=${SHORT_SHA}" >> $GITHUB_OUTPUT
echo "Generated version: ${VERSION}"
- name: Prepare release files
run: |
mkdir -p release
cp artifacts/ubuntu-latest-build/SoftwareManager-dev-linux release/SoftwareManager-dev-linux
cp artifacts/windows-latest-build/SoftwareManager-dev-windows.exe release/SoftwareManager-dev-windows.exe
cp artifacts/macos-latest-build/SoftwareManager-dev-macos release/SoftwareManager-dev-macos
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)
uses: softprops/action-gh-release@v2
with:
tag_name: ${{ steps.version.outputs.version }}
name: ${{ steps.version.outputs.version }}
draft: false
prerelease: false
tag_name: ${{ needs.build.outputs.version }}
name: ${{ needs.build.outputs.version }}
prerelease: true
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 }}
+13 -12
View File
@@ -16,10 +16,9 @@ from PySide6.QtWidgets import (
QHeaderView,
QMessageBox,
QTableWidget,
QTableWidgetItem
)
from PySide6.QtGui import QIcon, QAction, QCloseEvent, QPalette
from PySide6.QtGui import QIcon, QAction, QCloseEvent
import darkdetect
import threading
import platform
@@ -29,7 +28,6 @@ import subprocess
import time
import sys
import json
from core.utils.config.settings import save_settings
from core.utils.general.wrappers import run_thread
from core.utils.data.state import state
from core.utils.network.download import download_selected
@@ -40,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}-windows.exe"
new_filename = f"SoftwareManager-dev-{latest_version}-windows.exe"
url = f"https://github.com/KeksPirates/SoftwareManager/releases/latest/download/SoftwareManager-dev-{latest_version}-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)
@@ -64,7 +65,7 @@ class MainWindow(QtWidgets.QMainWindow, QWidget):
if os.path.exists(build_info_path):
with open(build_info_path, "r") as f:
build_info = json.load(f)
state.version = build_info.get("version", "dev")
state.version = build_info.get("version")
# Check for updates on Windows
if state.ignore_updates is False: