Skip to content

Commit bebc012

Browse files
committed
add build deb scripts
1 parent 1cb4a0a commit bebc012

File tree

2 files changed

+96
-0
lines changed

2 files changed

+96
-0
lines changed

.github/workflows/build-deb.sh

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
#!/bin/bash
2+
3+
# Build script for creating a DEB package for immersionpod
4+
5+
set -euo pipefail
6+
7+
PACKAGE_NAME="immersionpod"
8+
VERSION=${VERSION:?Version is not set.}
9+
VERSION=${VERSION##v}
10+
PACKAGE_DIR="deb_package"
11+
OUTPUT_FILE="${PACKAGE_NAME}-${VERSION}.deb"
12+
13+
ROOT_DIR=$(git rev-parse --show-toplevel)
14+
cd -- "$ROOT_DIR" || exit 1
15+
16+
# Clean up previous build
17+
rm -rf -- "$PACKAGE_DIR" "$OUTPUT_FILE"
18+
19+
# Create package directory structure
20+
mkdir -p -- "$PACKAGE_DIR/DEBIAN"
21+
mkdir -p -- "$PACKAGE_DIR/usr/bin"
22+
mkdir -p -- "$PACKAGE_DIR/usr/share/doc/$PACKAGE_NAME"
23+
mkdir -p -- "$PACKAGE_DIR/usr/share/licenses/$PACKAGE_NAME"
24+
25+
# Create control file
26+
cat > "$PACKAGE_DIR/DEBIAN/control" << EOF
27+
Package: $PACKAGE_NAME
28+
Version: $VERSION
29+
Section: utils
30+
Priority: optional
31+
Architecture: all
32+
Maintainer: Ajatt-Tools and contributors <tatsu@autistici.org>
33+
Depends: bash, file, gawk, ffmpeg, mpd, xdg-user-dirs
34+
Recommends: mpc, libnotify-bin, yt-dlp
35+
Description: AJATT-style passive listening and condensed audio without bloat.
36+
Immersion pod is a tool for managing passive immersion. It converts
37+
foreign language movies and TV shows to audio and uses it for passive
38+
listening. It supports condensed audio and creates it by default
39+
if it finds subtitles in the container or externally.
40+
Homepage: https://ajatt.top
41+
License: GPL-3.0
42+
EOF
43+
44+
# Copy files to package directory
45+
cp -- impd "$PACKAGE_DIR/usr/bin/"
46+
cp -- README.md "$PACKAGE_DIR/usr/share/doc/$PACKAGE_NAME/"
47+
cp -- LICENSE "$PACKAGE_DIR/usr/share/licenses/$PACKAGE_NAME/"
48+
49+
# Build the DEB package
50+
dpkg-deb --build "$PACKAGE_DIR" "$OUTPUT_FILE"
51+
52+
echo "DEB package created: $OUTPUT_FILE"
53+
54+
# Show package info
55+
echo "Package info:"
56+
dpkg-deb --info "$OUTPUT_FILE"

.github/workflows/release-deb.yml

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
name: Release Debian Package
2+
3+
on:
4+
push:
5+
tags:
6+
- 'v*'
7+
8+
jobs:
9+
build-and-release:
10+
runs-on: ubuntu-latest
11+
12+
steps:
13+
- name: Checkout repository
14+
uses: actions/checkout@v6
15+
with:
16+
fetch-depth: 1
17+
18+
- name: Install build dependencies
19+
run: |
20+
sudo apt update
21+
sudo apt install -y dpkg-dev
22+
23+
- name: Make build script executable
24+
run: chmod +x -- ./.github/workflows/build-deb.sh
25+
26+
- name: Build DEB package
27+
run: ./.github/workflows/build-deb.sh
28+
env:
29+
VERSION: ${{ github.ref_name }}
30+
31+
- name: Create Release
32+
id: create_release
33+
uses: softprops/action-gh-release@v2
34+
with:
35+
prerelease: false
36+
make_latest: true
37+
generate_release_notes: true
38+
name: "impd ${{github.ref_name}}"
39+
files: |
40+
*.deb

0 commit comments

Comments
 (0)