Repository navigation
97 lines (84 loc) · 3.52 KB
/
Copy pathrelease.yml
File metadata and controls
97 lines (84 loc) · 3.52 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
name: Release
on:
push:
tags:
- "v*"
jobs:
release:
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0 # hatch-vcs needs full history for the version tag
# ── Source archives ──────────────────────────────────────────────────
- name: Build source archives
run: |
git archive --format=tar.gz \
--prefix=bashboard-${{ github.ref_name }}/ \
-o bashboard-${{ github.ref_name }}.tar.gz \
HEAD
git archive --format=zip \
--prefix=bashboard-${{ github.ref_name }}/ \
-o bashboard-${{ github.ref_name }}.zip \
HEAD
# ── pip wheel ────────────────────────────────────────────────────────
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.12"
- name: Build wheel and sdist
run: |
pip install build hatch-vcs
python -m build
# ── deb package ──────────────────────────────────────────────────────
- name: Build deb package
run: |
VERSION=${{ github.ref_name }}
VERSION=${VERSION#v} # strip leading "v"
PKG=bashboard_${VERSION}_all
# Directory layout
mkdir -p ${PKG}/DEBIAN
mkdir -p ${PKG}/usr/bin
mkdir -p ${PKG}/usr/lib/bashboard
mkdir -p ${PKG}/usr/share/applications
mkdir -p ${PKG}/usr/share/icons/hicolor/scalable/apps
# App files
cp -r bashboard icons main.py ${PKG}/usr/lib/bashboard/
# Launcher
cat > ${PKG}/usr/bin/bashboard <<'SH'
#!/bin/sh
exec python3 /usr/lib/bashboard/main.py "$@"
SH
chmod 755 ${PKG}/usr/bin/bashboard
# Desktop entry and icon
sed "s|@PYTHON@|python3|g; s|@MAIN@|/usr/lib/bashboard/main.py|g" \
bashboard.desktop.in > ${PKG}/usr/share/applications/bashboard.desktop
cp icons/bashboard.svg \
${PKG}/usr/share/icons/hicolor/scalable/apps/bashboard.svg
# Control file
cat > ${PKG}/DEBIAN/control <<EOF
Package: bashboard
Version: ${VERSION}
Architecture: all
Maintainer: Ikhtierzhon Rakhimov <ihtier_@outlook.com>
Depends: python3 (>= 3.10), python3-pyside6, python3-pygments
Description: Desktop GUI for running bash scripts on Linux
Run, monitor, and interact with bash scripts via a PySide6 GUI.
EOF
dpkg-deb --build --root-owner-group ${PKG}
# ── GitHub Release ───────────────────────────────────────────────────
- name: Create GitHub Release
env:
GH_TOKEN: ${{ github.token }}
run: |
VERSION=${{ github.ref_name }}
gh release create ${VERSION} \
--title "${VERSION}" \
--generate-notes \
bashboard-${VERSION}.tar.gz \
bashboard-${VERSION}.zip \
dist/*.whl \
dist/*.tar.gz \
bashboard_${VERSION#v}_all.deb