Skip to content
This repository was archived by the owner on Jul 13, 2025. It is now read-only.

Commit 0532ef4

Browse files
authored
change workflows (#6)
1 parent 4c9c41f commit 0532ef4

File tree

3 files changed

+108
-7
lines changed

3 files changed

+108
-7
lines changed

.github/workflows/pr.yaml

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -25,19 +25,17 @@ jobs:
2525
run: |
2626
sudo apt install libgirepository1.0-dev -y
2727
28-
- name: Install Poetry and Ruff
28+
- name: Install Poetry and Deps
2929
run: |
3030
python -m pip install --upgrade pip
31-
pip install poetry ruff
32-
poetry --version
33-
ruff --version
31+
pip install poetry && poetry --version
32+
poetry install --with dev
3433
3534
- name: Ruff Format/Lint
3635
run: |
37-
ruff format --check
38-
ruff check
36+
poetry run ruff format --check
37+
poetry run ruff check
3938
4039
- name: Run Pytest
4140
run: |
42-
poetry install --with dev
4341
poetry run coverage run -m pytest -v && poetry run coverage report -m

.github/workflows/release.yaml

Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
name: Release
2+
3+
on:
4+
push:
5+
branches: ["main"]
6+
tags:
7+
- 'v*'
8+
9+
jobs:
10+
build-linux:
11+
runs-on: ubuntu-latest
12+
strategy:
13+
matrix:
14+
python-version: ["3.12"]
15+
steps:
16+
- name: Git Checkout
17+
uses: actions/checkout@v4
18+
19+
- name: Setup Python ${{ matrix.python-version }}
20+
uses: actions/setup-python@v3
21+
with:
22+
python-version: ${{ matrix.python-version }}
23+
24+
- name: Install GTK deps
25+
run: |
26+
sudo apt install libgirepository1.0-dev gcc libgtk-4-dev -y
27+
28+
- name: Install Poetry and Deps
29+
run: |
30+
python -m pip install --upgrade pip
31+
pip install poetry && poetry --version
32+
poetry install --with dev
33+
34+
- name: Run Pyinstaller
35+
run: |
36+
poetry run pyinstaller --clean --onefile -w --add-data "data/style.css:./data" --exclude-module=pytest keyboard.py
37+
mv ./dist/keyboard ./dist/keyboard-linux-amd64
38+
39+
- name: Store Dist
40+
uses: actions/upload-artifact@v4
41+
with:
42+
name: linux-dist
43+
path: dist/
44+
45+
github-release:
46+
needs: [ build-linux ]
47+
runs-on: ubuntu-latest
48+
permissions:
49+
contents: write
50+
id-token: write
51+
steps:
52+
- name: Download Linux Artifacts
53+
uses: actions/download-artifact@v4
54+
with:
55+
name: linux-dist
56+
path: dist/
57+
58+
- name: Create GitHub Release
59+
env:
60+
GITHUB_TOKEN: ${{ github.token }}
61+
run: >-
62+
gh release create "${{ github.ref_name }}" dist/**
63+
--repo "${{ github.repository }}"
64+
--generate-notes

keyboard.spec

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
# -*- mode: python ; coding: utf-8 -*-
2+
3+
4+
a = Analysis(
5+
['keyboard.py'],
6+
pathex=[],
7+
binaries=[],
8+
datas=[('data/style.css', './data')],
9+
hiddenimports=[],
10+
hookspath=[],
11+
hooksconfig={},
12+
runtime_hooks=[],
13+
excludes=['pytest'],
14+
noarchive=False,
15+
optimize=0,
16+
)
17+
pyz = PYZ(a.pure)
18+
19+
exe = EXE(
20+
pyz,
21+
a.scripts,
22+
a.binaries,
23+
a.datas,
24+
[],
25+
name='keyboard',
26+
debug=False,
27+
bootloader_ignore_signals=False,
28+
strip=False,
29+
upx=True,
30+
upx_exclude=[],
31+
runtime_tmpdir=None,
32+
console=False,
33+
disable_windowed_traceback=False,
34+
argv_emulation=False,
35+
target_arch=None,
36+
codesign_identity=None,
37+
entitlements_file=None,
38+
icon=['keyboard.ico'],
39+
)

0 commit comments

Comments
 (0)