Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Auto compilation of commits into exe and auto release of v* tagged versions #3

Open
wants to merge 11 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
71 changes: 71 additions & 0 deletions .github/workflows/Create-Release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
# This workflow will install Python dependencies, run tests and lint with a variety of Python versions
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions

on:
push:
# Sequence of patterns matched against refs/tags
tags:
- 'v*' # Push events to matching v*, i.e. v1.0, v20.15.10

name: Create Release

jobs:
build:
runs-on: windows-latest
strategy:
fail-fast: false
matrix:
python-version: ["3.7"]

steps:
- name: Get tag
id: tag
uses: dawidd6/action-get-tag@v1
- name: Checkout Code
uses: actions/checkout@v2
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
python -m pip install flake8 pytest pyinstaller
pip install -r requirements.txt
- name: Lint with flake8
run: |
# stop the build if there are Python syntax errors or undefined names
flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
# exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
- name: Package to .exe
run: |
mkdir build
cd build
pyinstaller -w -F ../hwa.py
cd ../
- name: Upload artifact
uses: actions/upload-artifact@v3
with:
name: HWA-Compiled
path: build/dist/hwa.exe
- name: Create Release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ github.ref }}
release_name: Release ${{ github.ref }}
draft: false
prerelease: false
- name: Upload Release Asset 1
id: upload-release-asset-1
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }} # This pulls from the CREATE RELEASE step above, referencing it's ID to get its outputs object, which include a `upload_url`. See this blog post for more info: https://jasonet.co/posts/new-features-of-github-actions/#passing-data-to-future-steps
asset_path: build/dist/hwa.exe
asset_name: HWA-${{ steps.tag.outputs.tag }}.exe
asset_content_type: application/vnd.microsoft.portable-executable
48 changes: 48 additions & 0 deletions .github/workflows/python-package.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
# This workflow will install Python dependencies, run tests and lint with a variety of Python versions
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions

name: Python package

on:
push:
branches: [ master ]
pull_request:
branches: [ master ]

jobs:
build:

runs-on: windows-latest
strategy:
fail-fast: false
matrix:
python-version: ["3.7"]

steps:
- uses: actions/checkout@v2
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
python -m pip install flake8 pytest pyinstaller
pip install -r requirements.txt
- name: Lint with flake8
run: |
# stop the build if there are Python syntax errors or undefined names
flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
# exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
- name: Package to .exe
run: |
mkdir build
cd build
pyinstaller -w -F ../hwa.py
cd ../
- name: Upload artifact
uses: actions/upload-artifact@v3
with:
name: HWA-Compiled
path: build/dist/hwa.exe
10 changes: 5 additions & 5 deletions hwmonitor/ui/dialogs/rollback_changes_dialog.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,17 +9,17 @@ def __init__(self, timeout=20, parent=None):
super().__init__(parent)
self.timeout = timeout

self.setWindowTitle("Änderung übernehmen?")
self.setWindowTitle("Keep Change?")
self.setWindowFlags(Qt.Dialog
| Qt.CustomizeWindowHint
| Qt.WindowTitleHint
| Qt.MSWindowsFixedSizeDialogHint
| Qt.WindowStaysOnTopHint)

self.setIcon(QMessageBox.Warning)
self.setText("Ihre Desktop-Konfiguration hat sich geändert.\n"
"Möchten Sie diese Änderung beibehalten?")
self.setInformativeText(f"Rücksetzung in {self.timeout} Sekunden")
self.setText("Your desktop configuration has changed.\n"
"Would you like to keep this change?")
self.setInformativeText(f"Reverting in {self.timeout} Seconds")
self.setStandardButtons(QMessageBox.Yes |
QMessageBox.No)
self.setDefaultButton(QMessageBox.No)
Expand All @@ -36,4 +36,4 @@ def _update_countdown(self):
if self.timeout == 0:
self._timer.stop()
self.defaultButton().animateClick()
self.setInformativeText(f"Rücksetzung in {self.timeout} Sekunden")
self.setInformativeText(f"Reverting in {self.timeout} Seconds")