adb-toolkit/.github/workflows/build.yml
Workflow config file is invalid. Please check your config file: yaml: line 108: found character that cannot start any token

127 lines
3.8 KiB
YAML

name: Build ATK
on:
push:
tags:
- 'v*'
workflow_dispatch:
env:
GO_VERSION: "1.23"
NODE_VERSION: "20"
PNPM_VERSION: "10"
jobs:
build-linux:
name: Build Linux
runs-on: ubuntu-22.04
permissions:
contents: write
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Install system dependencies
run: |
sudo apt-get update
sudo apt-get install -y \
build-essential pkg-config \
libgtk-3-dev libwebkit2gtk-4.1-dev \
libayatana-appindicator3-dev
- name: Setup Go
uses: actions/setup-go@v5
with:
go-version: ${{ env.GO_VERSION }}
- name: Setup Node
uses: actions/setup-node@v4
with:
node-version: ${{ env.NODE_VERSION }}
- name: Setup pnpm
uses: pnpm/action-setup@v4
with:
version: ${{ env.PNPM_VERSION }}
run_install: false
- name: Install Wails
run: go install github.com/wailsapp/wails/v2/cmd/wails@latest
- name: Install nfpm
run: go install github.com/goreleaser/nfpm/v2/cmd/nfpm@latest
- name: Install frontend dependencies
run: pnpm install
working-directory: frontend
- name: Set webkit pkg-config path
run: |
echo "PKG_CONFIG_PATH=/usr/lib/x86_64-linux-gnu/pkgconfig" >> $GITHUB_ENV
echo "CGO_CFLAGS=$(pkg-config --cflags webkit2gtk-4.1)" >> $GITHUB_ENV
echo "CGO_LDFLAGS=$(pkg-config --libs webkit2gtk-4.1)" >> $GITHUB_ENV
- name: Download Go modules
run: go mod download
- name: Build binary
run: wails build -tags webkit2_41
- name: Prepare packaging assets
run: |
mkdir -p build
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
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/
# Rename to include version
mv build/atk_*.deb build/ATK-${{ github.ref_name }}-amd64.deb
- name: Create GitHub Release
uses: softprops/action-gh-release@v2
if: startsWith(github.ref, 'refs/tags/')
with:
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
draft: false
prerelease: false