Skip to content

Commit

Permalink
ci: add reelase workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
daxartio committed Oct 7, 2024
1 parent fbbc527 commit afb5826
Show file tree
Hide file tree
Showing 53 changed files with 106 additions and 9,684 deletions.
8 changes: 4 additions & 4 deletions .github/workflows/check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@ jobs:
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: '3.8'

Expand All @@ -33,8 +33,8 @@ jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: '3.8'

Expand Down
42 changes: 42 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
name: Release

on:
push:
branches: [ 'workflows/release' ]
tags:
- "v*"
workflow_dispatch:

jobs:
build:
runs-on: windows-latest
strategy:
matrix:
architecture: [x64]
name: Build on Windows ${{ matrix.architecture }}
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set up Python
id: set_up_python
uses: actions/setup-python@v5
with:
python-version: '3.8'
architecture: ${{ matrix.architecture }}
- name: Install python dependencies
run: pip install poetry && poetry install -E win
- name: Build
run: poetry run python builder.py build
- name: Generate installer
run: poetry run python builder.py bdist_msi
- name: Upload the artifact
uses: actions/upload-artifact@v4
with:
path: dist/*.msi
name: ${{ runner.os }}-${{ matrix.architecture }}
# - name: Release
# uses: softprops/action-gh-release@v1
# if: startsWith(github.ref, 'refs/tags/')
# with:
# files: |
# dist/*.msi
63 changes: 42 additions & 21 deletions builder.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,42 +5,64 @@
from sportorg import config

base = None
if sys.platform == "win32":
base = "Win32GUI"
if sys.platform == 'win32':
base = 'Win32GUI'

include_files = [
config.LOCALE_DIR,
config.TEMPLATE_DIR,
config.IMG_DIR,
config.SOUND_DIR,
config.base_dir("LICENSE"),
config.base_dir("changelog.md"),
config.base_dir("changelog_ru.md"),
config.base_dir("configs"),
config.base_dir('LICENSE'),
config.base_dir('changelog.md'),
config.base_dir('changelog_ru.md'),
config.base_dir('configs'),
config.STYLE_DIR,
]
includes = ["atexit", "codecs", "playsound", "pyImpinj"]
excludes = ["Tkinter", "unittest", "test", "pydoc"]

options = {
"build_exe": {
"includes": includes,
"excludes": excludes,
"packages": ["idna", "requests", "encodings", "asyncio", "pywinusb"],
"include_files": include_files,
"zip_include_packages": ["PySide6"],
"optimize": 2,
'include_msvcr': True,
}
build_exe_options = {
"includes": includes,
"excludes": excludes,
"packages": ["idna", "requests", "encodings", "asyncio", "pywinusb"],
"include_files": include_files,
"zip_include_packages": ["PySide6"],
"optimize": 2,
'include_msvcr': True,
'silent': 1,
}

bdist_msi_options = {
'all_users': False,
'data': {
'Shortcut': [
(
'DesktopShortcut', # Shortcut
'DesktopFolder', # Directory
config.NAME, # Name
'TARGETDIR', # Component
'[TARGETDIR]SportOrg.exe', # Target
None, # Arguments
None, # Description
None, # Hotkey
None, # Icon
None, # IconIndex
None, # ShowCmd
'TARGETDIR', # WkDir
),
]
},
}

options = {'build_exe': build_exe_options, 'bdist_msi': bdist_msi_options}

executables = [
Executable(
"SportOrg.pyw",
'SportOrg.pyw',
base=base,
icon=config.icon_dir("sportorg.ico"),
shortcut_dir=config.NAME.lower(),
copyright="GNU GENERAL PUBLIC LICENSE {}".format(config.NAME),
icon=config.icon_dir('sportorg.ico'),
copyright='GNU GENERAL PUBLIC LICENSE {}'.format(config.NAME),
)
]

Expand All @@ -50,5 +72,4 @@
description=config.NAME,
options=options,
executables=executables,
packages=[],
)
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ requires = ["poetry-core>=1.0.0"]
build-backend = "poetry.core.masonry.api"

[tool.poe.env]
CODE = "tests sportorg"
CODE = "tests sportorg builder.py"

[tool.poe.tasks.all]
help = "Run format lint test"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,22 +7,6 @@ <h3>{{ race.data.description }} <br>{{ race.data.start_datetime|date }} {{ race.
<h2>RESULT LIST</h2>
</div>
<div id="results-tables"></div>
<!--
<div>
<table class="empty-table">
<tr>
<td><b>Chief referee:</b></td>
<td width="150px"></td>
<td><b>{{ race.data.chief_referee }}</b></td>
</tr>
<tr>
<td><b>Secretary:</b></td>
<td width="150px"></td>
<td><b>{{ race.data.secretary }}</b></td>
</tr>
</table>
</div>
-->
{% raw %}
<style>
table.table-split {
Expand Down
Loading

0 comments on commit afb5826

Please sign in to comment.