feat: auto-publish GitHub Release on version tags

This commit is contained in:
jegly 2026-03-27 13:44:01 +11:00
commit 85d2af718d

View file

@ -15,6 +15,8 @@ jobs:
build-linux:
name: Build Linux
runs-on: ubuntu-22.04
permissions:
contents: write
steps:
- name: Checkout
uses: actions/checkout@v4
@ -71,40 +73,55 @@ jobs:
if [ ! -f build/appicon.png ]; then
python3 -c "
import struct, zlib
def png(w, h, color):
def chunk(name, data):
c = zlib.crc32(name + data) & 0xffffffff
return struct.pack('>I', len(data)) + name + data + struct.pack('>I', c)
raw = b''.join(b'\x00' + bytes(color) * w for _ in range(h))
return b'\x89PNG\r\n\x1a\n' + chunk(b'IHDR', struct.pack('>IIBBBBB', w, h, 8, 2, 0, 0, 0)) + chunk(b'IDAT', zlib.compress(raw)) + chunk(b'IEND', b'')
open('build/appicon.png', 'wb').write(png(256, 256, [34, 197, 94]))
"
fi
if [ ! -f build/atk.desktop ]; then
cat > build/atk.desktop << 'DESKTOP'
[Desktop Entry]
Type=Application
Name=ATK
GenericName=Android Toolkit
Comment=All-in-one ADB GUI for Android power users and bug hunters
Exec=/opt/atk/ATK
Icon=atk
Categories=Development;Utility;
Terminal=false
StartupWMClass=ATK
Keywords=android;adb;fastboot;debloat;logcat;flash;
DESKTOP
printf '[Desktop Entry]\nType=Application\nName=ATK\nGenericName=Android Toolkit\nComment=All-in-one ADB GUI for Android power users and bug hunters\nExec=/opt/atk/ATK\nIcon=atk\nCategories=Development;Utility;\nTerminal=false\nStartupWMClass=ATK\nKeywords=android;adb;fastboot;debloat;logcat;flash;\n' > build/atk.desktop
fi
- name: Package .deb
run: nfpm pkg --packager deb --target build/
run: |
nfpm pkg --packager deb --target build/
# Rename to include version
mv build/atk_*.deb build/ATK-${{ github.ref_name }}-amd64.deb
- name: Upload artifacts
uses: actions/upload-artifact@v4
- name: Create GitHub Release
uses: softprops/action-gh-release@v2
if: startsWith(github.ref, 'refs/tags/')
with:
name: atk-linux-${{ github.ref_name }}
path: |
name: ATK ${{ github.ref_name }}
body: |
## ATK — Android Toolkit ${{ github.ref_name }}
An all-in-one ADB GUI for Android power users, security researchers, and bug hunters.
### Install
**Debian/Ubuntu (.deb):**
```bash
sudo dpkg -i ATK-${{ github.ref_name }}-amd64.deb
atk
```
**Or run the binary directly:**
```bash
chmod +x ATK
./ATK
```
### Requirements
```bash
sudo apt install adb fastboot libwebkit2gtk-4.1-0
```
files: |
build/ATK-${{ github.ref_name }}-amd64.deb
build/bin/ATK
build/*.deb
draft: false
prerelease: false