Skip to content

Commit

Permalink
add release.yaml (#16)
Browse files Browse the repository at this point in the history
* add release.yaml

* add release.yaml

* remove --one-file

* try -no-pie

* try again with latest ubuntu 24.04

* try again with latest ubuntu 24.04

* test

* use awk

* done
  • Loading branch information
mrwormhole authored Jul 28, 2024
1 parent a5c0c56 commit 3840fe6
Show file tree
Hide file tree
Showing 4 changed files with 121 additions and 2 deletions.
63 changes: 63 additions & 0 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
name: Release

on:
push:
branches: ["main"]
tags:
- 'v*'

jobs:
build-linux:
runs-on: ubuntu-24.04
steps:
- name: Setup Python ${{ matrix.python-version }}
uses: actions/setup-python@v3
with:
python-version: "3.12"

- name: Git Checkout
uses: actions/checkout@v4

- name: Install GTK deps
run: |
sudo apt install libgirepository1.0-dev gcc libgtk-4-dev -y
- name: Install Poetry and Deps
run: |
python -m pip install --upgrade pip
pip install poetry && poetry --version
poetry install --with dev
- name: Run Pyinstaller
run: |
poetry run pyinstaller keyboard.spec
version=$(ldd --version | head -n 1 | awk '{print $NF}')
pyversion=$(python --version 2>&1 | awk '{print $2}')
mv ./dist/keyboard ./dist/virtual-keyboard-py$pyversion-glib$version-x86_64
- name: Store Dist
uses: actions/upload-artifact@v4
with:
name: linux-dist
path: dist/

github-release:
needs: [ build-linux ]
runs-on: ubuntu-latest
permissions:
contents: write
id-token: write
steps:
- name: Download Linux Artifacts
uses: actions/download-artifact@v4
with:
name: linux-dist
path: dist/

- name: Create GitHub Release
env:
GITHUB_TOKEN: ${{ github.token }}
run: >-
gh release create "${{ github.ref_name }}" dist/**
--repo "${{ github.repository }}"
--generate-notes
10 changes: 8 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ I have been inspired by [this website](https://www.branah.com/) in my trilingual

### Dependencies

- Python (>=3.11) download [here](https://www.python.org/downloads/)
- Python (>=3.12) download [here](https://www.python.org/downloads/)
- GTK (>=4) download [here](https://gnome.pages.gitlab.gnome.org/pygobject/getting_started.html)

Note: please don't do global system installation of python dependencies through pip, poetry can install it safely for you
Expand All @@ -28,10 +28,16 @@ Or roll your own binary

```shell
poetry shell && poetry install --with dev
poetry run pyinstaller --clean --onefile -w --add-data "data/style.css:./data" --exclude-module=pytest keyboard.py
poetry run pyinstaller keyboard.spec
./dist/keyboard
```

### Linux Binaries

Grab the binary from releases for your OS then rename it to `virtual-keyboard` and move to `/usr/local/bin`

Create the `virtual-keyboard.desktop` in `/usr/share/applications` and copy the contents of the [this desktop file](https://github.com/mrwormhole/virtual-keyboard/blob/main/virtual-keyboard.desktop)

### FAQs

- Do you plan to add more languages?
Expand Down
44 changes: 44 additions & 0 deletions keyboard.spec
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
# -*- mode: python ; coding: utf-8 -*-


a = Analysis(
['keyboard.py'],
pathex=[],
binaries=[],
datas=[('data/style.css', './data')],
hiddenimports=[],
hookspath=[],
hooksconfig={
'gi': {
'module-versions': {
'Gtk': '4.0'
}
}
},
runtime_hooks=[],
excludes=['pytest'],
noarchive=False,
optimize=0,
)
pyz = PYZ(a.pure)

exe = EXE(
pyz,
a.scripts,
a.binaries,
a.datas,
[],
name='keyboard',
debug=False,
bootloader_ignore_signals=False,
strip=False,
upx=True,
upx_exclude=[],
runtime_tmpdir=None,
console=False,
disable_windowed_traceback=False,
argv_emulation=False,
target_arch=None,
codesign_identity=None,
entitlements_file=None,
)
6 changes: 6 additions & 0 deletions virtual-keyboard.desktop
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
[Desktop Entry]
Type=Application
Name=Virtual Keyboard
GenericName=On-screen Keyboard
Comment=All-in-one virtual keyboard
Exec=/usr/local/bin/virtual-keyboard

0 comments on commit 3840fe6

Please sign in to comment.