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

Commit 47ff97f

Browse files
authored
add release pipeline for windows
1 parent 0a3b53d commit 47ff97f

File tree

1 file changed

+73
-0
lines changed

1 file changed

+73
-0
lines changed

.github/workflows/release.yaml

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

0 commit comments

Comments
 (0)