This repository has been archived by the owner on Jun 30, 2024. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1 from rix1337/dev
Initialize Workflows
- Loading branch information
Showing
6 changed files
with
231 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
### Installation und Update: | ||
|
||
`pip install -U budgeteer` | ||
|
||
--- | ||
|
||
### Changelog BudgeTeer: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
github: rix1337 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
# -*- coding: utf-8 -*- | ||
# BudgeTeer | ||
# Projekt von https://github.com/rix1337 | ||
# Dieses Script prüft, ob Versionsnummern und Changelog gegenüber main geändert wurden. | ||
|
||
import json | ||
import re | ||
import subprocess | ||
import sys | ||
from distutils.version import StrictVersion | ||
from urllib.request import urlopen | ||
|
||
if __name__ == '__main__': | ||
python_version = "" | ||
try: | ||
result = subprocess.run(['python', 'budgeteer/providers/version.py'], stdout=subprocess.PIPE) | ||
python_version = str(result.stdout.decode("utf-8")).strip() | ||
except: | ||
pass | ||
|
||
if not python_version: | ||
sys.exit('Version info missing in budgeteer/providers/version.py') | ||
|
||
vue_version = "" | ||
try: | ||
with open('budgeteer/web_interface/vuejs_frontend/package.json') as fp: | ||
data = json.load(fp) | ||
vue_version = str(data['version']).strip() | ||
except: | ||
pass | ||
|
||
if not vue_version: | ||
sys.exit('Version info missing in budgeteer/web_interface/vuejs_frontend/package.json') | ||
|
||
if not python_version == vue_version: | ||
sys.exit( | ||
'Version info mismatch in budgeteer/providers/version.py and budgeteer/web_interface/vuejs_frontend/package.json') | ||
|
||
online_changelog = urlopen( | ||
'https://raw.githubusercontent.com/rix1337/BudgeTeer/main/.github/Changelog.md').read() | ||
online_changelog = online_changelog.decode("utf-8") | ||
with open('.github/Changelog.md', encoding='utf8') as local_changelog: | ||
local_changelog = local_changelog.read() | ||
if online_changelog == local_changelog: | ||
sys.exit('.github/Changelog.md not updated') | ||
|
||
latest = urlopen('https://github.com/rix1337/BudgeTeer/releases/latest').read() | ||
latest_title = latest.decode("utf-8") | ||
latest_title_text = re.findall(r'<title>(.+)</title>', latest_title)[0] | ||
onlineversion = re.search(r'(\d{1,3}\.\d{1,3}\.\d{1,3})', latest_title_text).group() | ||
if StrictVersion(python_version) > StrictVersion(onlineversion) and StrictVersion(vue_version) > StrictVersion( | ||
onlineversion): | ||
print("Proper version increase in branch detected.") | ||
sys.exit(0) | ||
else: | ||
sys.exit('Version not increased on branch') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,112 @@ | ||
name: Release Artifacts | ||
|
||
on: | ||
push: | ||
paths-ignore: | ||
- '.github/ISSUE_TEMPLATE/**' | ||
- '.github/workflows/**' | ||
branches: | ||
- main | ||
|
||
jobs: | ||
build_wheel: | ||
name: Build Linux wheel | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v3 | ||
- uses: actions/cache@v3 | ||
with: | ||
path: ~/.cache/pip | ||
key: ${{ runner.os }}-pip-${{ hashFiles('requirements.txt') }}-${{ hashFiles('setup.py') }} | ||
restore-keys: | | ||
${{ runner.os }}-pip- | ||
- name: Install Python dependencies | ||
run: | | ||
pip install wheel | ||
pip install pyinstaller | ||
pip install -r requirements.txt | ||
- name: Setup Node.js | ||
uses: actions/setup-node@v3 | ||
with: | ||
node-version: 16.x | ||
- name: Install Node dependencies | ||
run: npm ci | ||
working-directory: budgeteer/web_interface/vuejs_frontend | ||
- run: npm run build | ||
working-directory: budgeteer/web_interface/vuejs_frontend | ||
- name: Compile Linux wheel | ||
run: | | ||
python setup.py sdist bdist_wheel | ||
- name: Upload Linux wheel | ||
uses: actions/upload-artifact@v3 | ||
with: | ||
name: artifact-wheel | ||
path: ./dist/* | ||
|
||
build_exe: | ||
name: Build Windows Exe | ||
runs-on: windows-latest | ||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v3 | ||
- uses: actions/cache@v3 | ||
with: | ||
path: ~\AppData\Local\pip\Cache | ||
key: ${{ runner.os }}-pip-${{ hashFiles('requirements.txt') }}-${{ hashFiles('setup.py') }} | ||
restore-keys: | | ||
${{ runner.os }}-pip- | ||
- name: Install Python dependencies | ||
run: | | ||
pip install wheel | ||
pip install pyinstaller | ||
pip install -r requirements.txt | ||
- name: Setup Node.js | ||
uses: actions/setup-node@v3 | ||
with: | ||
node-version: 16.x | ||
- name: Install Node dependencies | ||
run: npm ci | ||
working-directory: budgeteer/web_interface/vuejs_frontend | ||
- run: npm run build | ||
working-directory: budgeteer/web_interface/vuejs_frontend | ||
- name: Compile Windows Exe | ||
run: | | ||
$version = python budgeteer/providers/version.py | ||
pyinstaller --onefile -y -i "budgeteer/web_interface/vuejs_frontend/public/favicon.ico" --noconsole --version-file "file_version_info.txt" --add-data "budgeteer/web_interface/vuejs_frontend;web_interface/vuejs_frontend" "BudgeTeer.py" -n "budgeteer-$version-standalone-win64" | ||
- name: Upload Windows Exe | ||
uses: actions/upload-artifact@v3 | ||
with: | ||
name: artifact-exe | ||
path: ./dist/*.exe | ||
|
||
release: | ||
name: Release Artifacts | ||
runs-on: ubuntu-latest | ||
needs: [ build_wheel, build_exe ] | ||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v3 | ||
- uses: actions/download-artifact@v3 | ||
- uses: actions/cache@v3 | ||
with: | ||
path: ~/.cache/pip | ||
key: ${{ runner.os }}-pip-${{ hashFiles('requirements.txt') }}-${{ hashFiles('setup.py') }} | ||
restore-keys: | | ||
${{ runner.os }}-pip- | ||
- name: Install requirements | ||
run: | | ||
pip install twine | ||
- name: Get Version | ||
run: echo "version=$(python budgeteer/providers/version.py)" >>$GITHUB_OUTPUT | ||
id: version | ||
- name: Create Release | ||
uses: ncipollo/release-action@v1 | ||
with: | ||
artifacts: "./artifact-wheel/*.whl,./artifact-exe/*.exe" | ||
artifactErrorsFailBuild: true | ||
bodyFile: ".github/Changelog.md" | ||
tag: v.${{ steps.version.outputs.version }} | ||
- name: Upload to PyPI | ||
run: | | ||
python -m twine upload ./artifact-wheel/* -u __token__ -p ${{ secrets.PYPI_TOKEN }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
name: Run Tests | ||
on: [ pull_request ] | ||
|
||
jobs: | ||
check-branch: | ||
name: Check version info and changelog | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- name: Setup python | ||
uses: actions/setup-python@v4 | ||
with: | ||
python-version: 3.11 | ||
architecture: x64 | ||
- name: Verify version and changelog info | ||
run: python .github/workflows/CheckBranch.py | ||
build-python: | ||
runs-on: ubuntu-latest | ||
needs: check-branch | ||
strategy: | ||
matrix: | ||
python-version: [ 3.8, 3.9, "3.10", 3.11 ] | ||
name: Python ${{ matrix.python-version }} build | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- name: Setup python | ||
uses: actions/setup-python@v4 | ||
with: | ||
python-version: ${{ matrix.python-version }} | ||
architecture: x64 | ||
- uses: actions/cache@v3 | ||
with: | ||
path: ~/.cache/pip | ||
key: ${{ hashFiles('setup.py') }}-${{ hashFiles('requirements.txt') }} | ||
- name: Install dependencies | ||
run: pip install -r requirements.txt | ||
- name: Run build from branch | ||
run: python BudgeTeer.py --port=9090 --config="/home/runner/work/_temp/_github_home" --test_run --log-level=DEBUG | ||
build-vuejs: | ||
runs-on: ubuntu-latest | ||
needs: check-branch | ||
name: Node.js build | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- name: Setup Node.js | ||
uses: actions/setup-node@v3 | ||
with: | ||
node-version: 16.x | ||
- name: Install dependencies | ||
run: npm ci | ||
working-directory: budgeteer/web_interface/vuejs_frontend | ||
- name: Run build from branch | ||
run: npm run build | ||
working-directory: budgeteer/web_interface/vuejs_frontend |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters