name: Release Linux
on:
workflow_run:
workflows: ["Release Core"]
types:
- completed
env:
CARGO_TERM_COLOR: always
jobs:
create-appimage:
name: Create AppImage
runs-on: ubuntu-latest
if: github.event.workflow_run.conclusion == 'success'
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Get version from workflow run
id: get_version
run: |
TAG=$(curl -s "${{ github.event.workflow_run.artifacts_url }}" | jq -r '.artifacts[0].name' | sed 's/binaries-.*//')
if [ -z "$TAG" ]; then
TAG=$(curl -s "https://api.github.com/repos/${GITHUB_REPOSITORY}/releases/latest" | jq -r '.tag_name')
fi
CLEAN_VERSION="${TAG#v}"
echo "version=$TAG" >> $GITHUB_OUTPUT
echo "clean_version=$CLEAN_VERSION" >> $GITHUB_OUTPUT
- name: Download Linux binary
run: |
wget -O standby.tar.gz "https://github.com/${GITHUB_REPOSITORY}/releases/download/${{ steps.get_version.outputs.version }}/standby-x86_64-unknown-linux-gnu.tar.gz"
tar -xzf standby.tar.gz
ls -la
- name: Install AppImage tools
run: |
sudo apt-get update
sudo apt-get install -y libfuse2 fuse desktop-file-utils
- name: Create AppImage
run: |
# Create AppDir structure
mkdir -p AppDir/usr/bin
mkdir -p AppDir/usr/share/applications
mkdir -p AppDir/usr/share/icons/hicolor/256x256/apps
# Copy binary
cp standby AppDir/usr/bin/
# Create desktop file
cat > AppDir/usr/share/applications/soundcheck.desktop << EOF
[Desktop Entry]
Name=Soundcheck
Exec=soundcheck
Icon=soundcheck
Type=Application
Categories=Audio;Utility;
Terminal=true
EOF
echo "Creating icon..."
cat > AppDir/AppRun << 'EOF'
HERE="$(dirname "$(readlink -f "${0}")")"
export PATH="${HERE}/usr/bin/:${PATH}"
export LD_LIBRARY_PATH="${HERE}/usr/lib/:${LD_LIBRARY_PATH}"
exec "${HERE}/usr/bin/standby" "$@"
EOF
chmod +x AppDir/AppRun
wget -O appimagetool "https://github.com/AppImage/AppImageKit/releases/download/continuous/appimagetool-x86_64.AppImage"
chmod +x appimagetool
./appimagetool AppDir standby-${{ steps.get_version.outputs.clean_version }}-x86_64.AppImage
- name: Upload AppImage
uses: actions/upload-artifact@v4
with:
name: appimage-package
path: standby-${{ steps.get_version.outputs.clean_version }}-x86_64.AppImage
create-aur-package:
name: Create AUR Package
runs-on: ubuntu-latest
if: github.event.workflow_run.conclusion == 'success'
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Get version from workflow run
id: get_version
run: |
TAG=$(curl -s "${{ github.event.workflow_run.artifacts_url }}" | jq -r '.artifacts[0].name' | sed 's/binaries-.*//')
if [ -z "$TAG" ]; then
TAG=$(curl -s "https://api.github.com/repos/${GITHUB_REPOSITORY}/releases/latest" | jq -r '.tag_name')
fi
CLEAN_VERSION="${TAG#v}"
echo "version=$TAG" >> $GITHUB_OUTPUT
echo "clean_version=$CLEAN_VERSION" >> $GITHUB_OUTPUT
- name: Download Linux binary
run: |
wget -O standby.tar.gz "https://github.com/${GITHUB_REPOSITORY}/releases/download/${{ steps.get_version.outputs.version }}/standby-x86_64-unknown-linux-gnu.tar.gz"
tar -xzf standby.tar.gz
ls -la
- name: Calculate SHA256
id: sha256
run: |
SHA=$(sha256sum standby | cut -d' ' -f1)
echo "sha=$SHA" >> $GITHUB_OUTPUT
- name: Create AUR package structure
run: |
mkdir -p aur-soundcheck
cd aur-soundcheck
# Create PKGBUILD
cat > PKGBUILD << EOF
pkgname=soundcheck
pkgver=${{ steps.get_version.outputs.clean_version }}
pkgrel=1
pkgdesc="Terminal-based audio monitoring application"
arch=('x86_64')
url="https://github.com/${GITHUB_REPOSITORY}"
license=('MIT')
depends=('alsa-lib')
makedepends=()
source=("\${pkgname}-\${pkgver}.tar.gz::https://github.com/${GITHUB_REPOSITORY}/releases/download/${{ steps.get_version.outputs.version }}/standby-x86_64-unknown-linux-gnu.tar.gz")
sha256sums=('${{ steps.sha256.outputs.sha }}')
package() {
cd "\$srcdir"
install -Dm755 standby "\$pkgdir/usr/bin/standby"
}
EOF
cat > .SRCINFO << EOF
pkgbase = soundcheck
pkgdesc = Terminal-based audio monitoring application
pkgver = ${{ steps.get_version.outputs.clean_version }}
pkgrel = 1
url = https://github.com/${GITHUB_REPOSITORY}
arch = x86_64
license = MIT
depends = alsa-lib
source = standby-${{ steps.get_version.outputs.clean_version }}.tar.gz::https://github.com/${GITHUB_REPOSITORY}/releases/download/${{ steps.get_version.outputs.version }}/standby-x86_64-unknown-linux-gnu.tar.gz
sha256sums = ${{ steps.sha256.outputs.sha }}
pkgname = soundcheck
EOF
- name: Upload AUR package
uses: actions/upload-artifact@v4
with:
name: aur-package
path: aur-soundcheck/
create-deb-package:
name: Create Debian Package
runs-on: ubuntu-latest
if: github.event.workflow_run.conclusion == 'success'
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Get version from workflow run
id: get_version
run: |
TAG=$(curl -s "${{ github.event.workflow_run.artifacts_url }}" | jq -r '.artifacts[0].name' | sed 's/binaries-.*//')
if [ -z "$TAG" ]; then
TAG=$(curl -s "https://api.github.com/repos/${GITHUB_REPOSITORY}/releases/latest" | jq -r '.tag_name')
fi
CLEAN_VERSION="${TAG#v}"
echo "version=$TAG" >> $GITHUB_OUTPUT
echo "clean_version=$CLEAN_VERSION" >> $GITHUB_OUTPUT
- name: Download Linux binary
run: |
wget -O standby.tar.gz "https://github.com/${GITHUB_REPOSITORY}/releases/download/${{ steps.get_version.outputs.version }}/standby-x86_64-unknown-linux-gnu.tar.gz"
tar -xzf standby.tar.gz
ls -la
- name: Install Debian packaging tools
run: |
sudo apt-get update
sudo apt-get install -y dpkg-dev debhelper
- name: Create Debian package structure
run: |
mkdir -p deb-package/soundcheck-${{ steps.get_version.outputs.clean_version }}/usr/bin
mkdir -p deb-package/soundcheck-${{ steps.get_version.outputs.clean_version }}/DEBIAN
# Copy binary
cp soundcheck deb-package/soundcheck-${{ steps.get_version.outputs.clean_version }}/usr/bin/
# Create control file
cat > deb-package/soundcheck-${{ steps.get_version.outputs.clean_version }}/DEBIAN/control << EOF
Package: soundcheck
Version: ${{ steps.get_version.outputs.clean_version }}-1
Section: utils
Priority: optional
Architecture: amd64
Depends: libc6 (>= 2.27), libasound2 (>= 1.1.0)
Maintainer: ${GITHUB_REPOSITORY_OWNER} <${GITHUB_REPOSITORY_OWNER}@users.noreply.github.com>
Description: Terminal-based audio monitoring application
A command-line tool for monitoring audio levels and detecting
when sound exceeds specified thresholds.
EOF
cd deb-package
dpkg-deb --build soundcheck-${{ steps.get_version.outputs.clean_version }}
- name: Upload Debian package
uses: actions/upload-artifact@v4
with:
name: deb-package
path: deb-package/soundcheck-${{ steps.get_version.outputs.clean_version }}.deb
publish-linux-packages:
name: Publish Linux Packages
needs: [create-appimage, create-aur-package, create-deb-package]
runs-on: ubuntu-latest
if: github.event.repository.fork == false
steps:
- name: Download all Linux packages
uses: actions/download-artifact@v4
- name: Get version
id: get_version
run: |
VERSION=$(ls appimage-package/soundcheck-*.AppImage | sed 's/.*soundcheck-\(.*\)-x86_64\.AppImage/\1/')
echo "version=v$VERSION" >> $GITHUB_OUTPUT
- name: Create Linux release
uses: softprops/action-gh-release@v1
with:
tag_name: ${{ steps.get_version.outputs.version }}
name: Linux Packages ${{ steps.get_version.outputs.version }}
body: |
## Linux Distribution Packages
This release includes packages for various Linux distributions:
### Universal
- **AppImage**: Run on any Linux distribution
- Download: `soundcheck-*.AppImage`
### Arch Linux (AUR)
- **AUR Package**: Install via `yay -S soundcheck`
- Files: `PKGBUILD` and `.SRCINFO`
### Debian/Ubuntu
- **DEB Package**: Install via `sudo dpkg -i soundcheck-*.deb`
- Dependencies: `libc6`, `libasound2`
## Installation Instructions
### AppImage (Universal)
```bash
chmod +x soundcheck-*.AppImage
./soundcheck-*.AppImage --help
```
### Arch Linux (AUR)
```bash
yay -S soundcheck
# Or manually build:
# tar -xzf aur-package.tar.gz
# cd aur-soundcheck
# makepkg -si
```
### Debian/Ubuntu
```bash
sudo apt install ./soundcheck-*.deb
soundcheck --help
```
files: |
appimage-package/soundcheck-*.AppImage
aur-package/PKGBUILD
aur-package/.SRCINFO
deb-package/soundcheck-*.deb
draft: false
prerelease: false