mirror of
https://github.com/nixietab/picodulce.git
synced 2025-04-10 10:28:56 +01:00
Compare commits
7 Commits
874e513b47
...
6522b70066
Author | SHA1 | Date | |
---|---|---|---|
![]() |
6522b70066 | ||
![]() |
8d486a9af2 | ||
![]() |
97393e4ae7 | ||
![]() |
e35120bb36 | ||
![]() |
f2cfb3ceb3 | ||
![]() |
15246cd535 | ||
![]() |
3edcd10c12 |
36
.github/workflows/Bleeding-Job.yaml
vendored
Normal file
36
.github/workflows/Bleeding-Job.yaml
vendored
Normal file
@ -0,0 +1,36 @@
|
|||||||
|
name: Bleeding Update version
|
||||||
|
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
branches:
|
||||||
|
- main
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
update-version:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- name: Check out the repository
|
||||||
|
uses: actions/checkout@v3
|
||||||
|
|
||||||
|
- name: Set up Python
|
||||||
|
uses: actions/setup-python@v4
|
||||||
|
with:
|
||||||
|
python-version: '3.x'
|
||||||
|
|
||||||
|
- name: Update version.json
|
||||||
|
run: |
|
||||||
|
git fetch --prune --unshallow
|
||||||
|
commit_count=$(git rev-list --count HEAD)
|
||||||
|
version=$(jq -r '.version' version.json)
|
||||||
|
jq --arg versionBleeding "$version-$commit_count" '. + {versionBleeding: $versionBleeding}' version.json > version.tmp && mv version.tmp version.json
|
||||||
|
|
||||||
|
- name: Commit and push changes
|
||||||
|
run: |
|
||||||
|
git config --global user.name 'github-actions[bot]'
|
||||||
|
git config --global user.email 'github-actions[bot]@users.noreply.github.com'
|
||||||
|
git add version.json
|
||||||
|
git commit -m "Update version.json with commit count"
|
||||||
|
git push
|
||||||
|
env:
|
||||||
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
4
.github/workflows/Build.yml
vendored
4
.github/workflows/Build.yml
vendored
@ -9,6 +9,8 @@ jobs:
|
|||||||
version-release:
|
version-release:
|
||||||
runs-on: windows-latest # Use Windows 10 runner
|
runs-on: windows-latest # Use Windows 10 runner
|
||||||
|
|
||||||
|
if: github.actor != 'github-actions[bot]' # Only run if the actor is not the GitHub Actions bot
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout repository
|
- name: Checkout repository
|
||||||
uses: actions/checkout@v3
|
uses: actions/checkout@v3
|
||||||
@ -36,7 +38,7 @@ jobs:
|
|||||||
run: |
|
run: |
|
||||||
dir actions-temp
|
dir actions-temp
|
||||||
dir
|
dir
|
||||||
|
|
||||||
- name: Get version and name from version.json
|
- name: Get version and name from version.json
|
||||||
id: version_info
|
id: version_info
|
||||||
run: |
|
run: |
|
||||||
|
46
picodulce.py
46
picodulce.py
@ -1162,8 +1162,22 @@ class PicomcVersionSelector(QWidget):
|
|||||||
with open('version.json', 'r') as version_file:
|
with open('version.json', 'r') as version_file:
|
||||||
version_data = json.load(version_file)
|
version_data = json.load(version_file)
|
||||||
version_number = version_data.get('version', 'unknown version')
|
version_number = version_data.get('version', 'unknown version')
|
||||||
|
version_bleeding = version_data.get('versionBleeding', None)
|
||||||
except (FileNotFoundError, json.JSONDecodeError):
|
except (FileNotFoundError, json.JSONDecodeError):
|
||||||
version_number = 'unknown version'
|
version_number = 'unknown version'
|
||||||
|
version_bleeding = None
|
||||||
|
|
||||||
|
# Check the configuration for IsBleeding
|
||||||
|
try:
|
||||||
|
with open('config.json', 'r') as config_file:
|
||||||
|
config_data = json.load(config_file)
|
||||||
|
is_bleeding = config_data.get('IsBleeding', False)
|
||||||
|
except (FileNotFoundError, json.JSONDecodeError):
|
||||||
|
is_bleeding = False
|
||||||
|
|
||||||
|
# Use versionBleeding if IsBleeding is true
|
||||||
|
if is_bleeding and version_bleeding:
|
||||||
|
version_number = version_bleeding
|
||||||
|
|
||||||
about_message = (
|
about_message = (
|
||||||
f"PicoDulce Launcher (v{version_number})\n\n"
|
f"PicoDulce Launcher (v{version_number})\n\n"
|
||||||
@ -1180,7 +1194,9 @@ class PicomcVersionSelector(QWidget):
|
|||||||
with open("version.json") as f:
|
with open("version.json") as f:
|
||||||
local_version_info = json.load(f)
|
local_version_info = json.load(f)
|
||||||
local_version = local_version_info.get("version")
|
local_version = local_version_info.get("version")
|
||||||
|
local_version_bleeding = local_version_info.get("versionBleeding")
|
||||||
logging.info(f"Local version: {local_version}")
|
logging.info(f"Local version: {local_version}")
|
||||||
|
logging.info(f"Local bleeding version: {local_version_bleeding}")
|
||||||
|
|
||||||
with open("config.json") as config_file:
|
with open("config.json") as config_file:
|
||||||
config = json.load(config_file)
|
config = json.load(config_file)
|
||||||
@ -1189,10 +1205,20 @@ class PicomcVersionSelector(QWidget):
|
|||||||
if local_version:
|
if local_version:
|
||||||
remote_version_info = self.fetch_remote_version()
|
remote_version_info = self.fetch_remote_version()
|
||||||
remote_version = remote_version_info.get("version")
|
remote_version = remote_version_info.get("version")
|
||||||
|
remote_version_bleeding = remote_version_info.get("versionBleeding")
|
||||||
logging.info(f"Remote version: {remote_version}")
|
logging.info(f"Remote version: {remote_version}")
|
||||||
if remote_version and (remote_version != local_version or is_bleeding):
|
logging.info(f"Remote bleeding version: {remote_version_bleeding}")
|
||||||
|
|
||||||
|
if is_bleeding:
|
||||||
|
remote_version_to_check = remote_version_bleeding
|
||||||
|
local_version_to_check = local_version_bleeding
|
||||||
|
else:
|
||||||
|
remote_version_to_check = remote_version
|
||||||
|
local_version_to_check = local_version
|
||||||
|
|
||||||
|
if remote_version_to_check and (remote_version_to_check != local_version_to_check):
|
||||||
if is_bleeding:
|
if is_bleeding:
|
||||||
update_message = f"Do you want to update to the bleeding edge version ({remote_version})?"
|
update_message = f"Do you want to update to the bleeding edge version ({remote_version_bleeding})?"
|
||||||
else:
|
else:
|
||||||
update_message = f"A new version ({remote_version}) is available!\nDo you want to download it now?"
|
update_message = f"A new version ({remote_version}) is available!\nDo you want to download it now?"
|
||||||
update_dialog = QMessageBox.question(self, "Update Available", update_message, QMessageBox.Yes | QMessageBox.No, QMessageBox.No)
|
update_dialog = QMessageBox.question(self, "Update Available", update_message, QMessageBox.Yes | QMessageBox.No, QMessageBox.No)
|
||||||
@ -1213,7 +1239,9 @@ class PicomcVersionSelector(QWidget):
|
|||||||
with open("version.json") as f:
|
with open("version.json") as f:
|
||||||
local_version_info = json.load(f)
|
local_version_info = json.load(f)
|
||||||
local_version = local_version_info.get("version")
|
local_version = local_version_info.get("version")
|
||||||
|
local_version_bleeding = local_version_info.get("versionBleeding")
|
||||||
logging.info(f"Local version: {local_version}")
|
logging.info(f"Local version: {local_version}")
|
||||||
|
logging.info(f"Local bleeding version: {local_version_bleeding}")
|
||||||
|
|
||||||
with open("config.json") as config_file:
|
with open("config.json") as config_file:
|
||||||
config = json.load(config_file)
|
config = json.load(config_file)
|
||||||
@ -1222,10 +1250,20 @@ class PicomcVersionSelector(QWidget):
|
|||||||
if local_version:
|
if local_version:
|
||||||
remote_version_info = self.fetch_remote_version()
|
remote_version_info = self.fetch_remote_version()
|
||||||
remote_version = remote_version_info.get("version")
|
remote_version = remote_version_info.get("version")
|
||||||
|
remote_version_bleeding = remote_version_info.get("versionBleeding")
|
||||||
logging.info(f"Remote version: {remote_version}")
|
logging.info(f"Remote version: {remote_version}")
|
||||||
if remote_version and (remote_version != local_version or is_bleeding):
|
logging.info(f"Remote bleeding version: {remote_version_bleeding}")
|
||||||
|
|
||||||
|
if is_bleeding:
|
||||||
|
remote_version_to_check = remote_version_bleeding
|
||||||
|
local_version_to_check = local_version_bleeding
|
||||||
|
else:
|
||||||
|
remote_version_to_check = remote_version
|
||||||
|
local_version_to_check = local_version
|
||||||
|
|
||||||
|
if remote_version_to_check and (remote_version_to_check != local_version_to_check):
|
||||||
if is_bleeding:
|
if is_bleeding:
|
||||||
update_message = f"Do you want to update to the bleeding edge version ({remote_version})?"
|
update_message = f"Do you want to update to the bleeding edge version ({remote_version_bleeding})?"
|
||||||
else:
|
else:
|
||||||
update_message = f"A new version ({remote_version}) is available!\nDo you want to download it now?"
|
update_message = f"A new version ({remote_version}) is available!\nDo you want to download it now?"
|
||||||
update_dialog = QMessageBox.question(self, "Update Available", update_message, QMessageBox.Yes | QMessageBox.No, QMessageBox.No)
|
update_dialog = QMessageBox.question(self, "Update Available", update_message, QMessageBox.Yes | QMessageBox.No, QMessageBox.No)
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
{
|
{
|
||||||
"version": "0.11.8",
|
"version": "0.11.9",
|
||||||
"links": [
|
"links": [
|
||||||
"https://raw.githubusercontent.com/nixietab/picodulce/main/version.json",
|
"https://raw.githubusercontent.com/nixietab/picodulce/main/version.json",
|
||||||
"https://raw.githubusercontent.com/nixietab/picodulce/main/picodulce.py",
|
"https://raw.githubusercontent.com/nixietab/picodulce/main/picodulce.py",
|
||||||
@ -7,5 +7,6 @@
|
|||||||
"https://raw.githubusercontent.com/nixietab/picodulce/main/drums.gif",
|
"https://raw.githubusercontent.com/nixietab/picodulce/main/drums.gif",
|
||||||
"https://raw.githubusercontent.com/nixietab/picodulce/main/marroc.py",
|
"https://raw.githubusercontent.com/nixietab/picodulce/main/marroc.py",
|
||||||
"https://raw.githubusercontent.com/nixietab/picodulce/main/holiday.ico"
|
"https://raw.githubusercontent.com/nixietab/picodulce/main/holiday.ico"
|
||||||
]
|
],
|
||||||
|
"versionBleeding": "0.11.9-151"
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user