Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
226 changes: 188 additions & 38 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Build Auto-Wall
name: Build Auto-Wall Multi-Platform

on:
push:
Expand All @@ -12,59 +12,209 @@ permissions:
packages: write

jobs:
build:
# Version setup job to extract version once
version:
runs-on: ubuntu-latest
outputs:
version: ${{ steps.set_version.outputs.version }}
is_release: ${{ steps.set_version.outputs.is_release }}

steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Set version number
id: set_version
run: |
if [[ "${{ github.ref_type }}" == "tag" ]]; then
VERSION="${{ github.ref_name }}"
# Remove 'v' prefix if present
VERSION=${VERSION#v}
IS_RELEASE="true"
echo "Setting release version to $VERSION"
else
# For non-tag builds, use current date and commit
VERSION="dev-$(date +%Y%m%d)-$(echo ${{ github.sha }} | cut -c1-7)"
IS_RELEASE="false"
echo "Setting dev version to $VERSION"
fi

echo "version=$VERSION" >> $GITHUB_OUTPUT
echo "is_release=$IS_RELEASE" >> $GITHUB_OUTPUT
echo "VERSION=$VERSION" >> $GITHUB_ENV

# Update version in auto_wall.py
sed -i "s/APP_VERSION = \".*\"/APP_VERSION = \"$VERSION\"/" auto_wall.py

# Windows build job
build-windows:
needs: version
runs-on: windows-latest

steps:
- name: Checkout repository
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Set up Python
uses: actions/setup-python@v4
uses: actions/setup-python@v5
with:
python-version: '3.12.2'
python-version: '3.12'

- name: Update version number
- name: Update version
run: |
# Get version from tag
if ("${{ github.ref_type }}" -eq "tag") {
$VERSION = "${{ github.ref_name }}"
# Remove 'v' prefix if present
if ($VERSION.StartsWith("v")) {
$VERSION = $VERSION.Substring(1)
}
echo "Setting version to $VERSION"
} else {
echo "::error::No valid tag found. Workflow must be triggered by a tag push."
exit 1
}

# Update version in auto_wall.py
$FILE = "auto_wall.py"
$CONTENT = Get-Content -Path $FILE -Raw
$NEW_CONTENT = $CONTENT -replace 'APP_VERSION = ".*"', "APP_VERSION = ""$VERSION"""
Set-Content -Path $FILE -Value $NEW_CONTENT -Force
# save the version for later use
echo "version=$VERSION" >> $GITHUB_ENV
$VERSION = "${{ needs.version.outputs.version }}"
$CONTENT = Get-Content -Path "auto_wall.py" -Raw
$NEW_CONTENT = $CONTENT -replace 'APP_VERSION = ".*"', "APP_VERSION = `"$VERSION`""
Set-Content -Path "auto_wall.py" -Value $NEW_CONTENT -NoNewline

- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt
pip install pyinstaller --no-cache-dir

- name: Build with python
- name: Build Windows executable
run: |
python build.py

- name: Create GitHub Release
id: create_version_release
uses: ncipollo/release-action@v1.16.0
python build.py --platform windows

- name: Upload Windows artifacts
uses: actions/upload-artifact@v4
with:
name: Auto-Wall-Windows-${{ needs.version.outputs.version }}
path: |
dist/Auto-Wall.exe
retention-days: 30

# Linux build job
build-linux:
needs: version
runs-on: ubuntu-latest

steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.12'

- name: Update version
run: |
VERSION="${{ needs.version.outputs.version }}"
sed -i "s/APP_VERSION = \".*\"/APP_VERSION = \"$VERSION\"/" auto_wall.py

- name: Install system dependencies
run: |
sudo apt-get update
sudo apt-get install -y \
python3-dev python3-tk \
fakeroot wget file desktop-file-utils \
gzip

- name: Install Python dependencies
run: |
python3 -m pip install --upgrade pip
pip install -r requirements.txt

- name: Build Linux packages
run: |
python3 build.py --platform linux

- name: Upload Linux artifacts
uses: actions/upload-artifact@v4
with:
name: Auto-Wall-Linux-${{ needs.version.outputs.version }}
path: |
dist/*.AppImage
dist/*.deb
retention-days: 30

# macOS build job
build-macos:
needs: version
runs-on: macos-latest

steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.12'

- name: Update version
run: |
VERSION="${{ needs.version.outputs.version }}"
sed -i "" "s/APP_VERSION = \".*\"/APP_VERSION = \"$VERSION\"/" auto_wall.py

- name: Install dependencies
run: |
python3 -m pip install --upgrade pip
pip install -r requirements.txt

- name: Build macOS app
run: |
python3 build.py --platform macos

- name: Upload macOS artifacts
uses: actions/upload-artifact@v4
with:
name: Auto-Wall-macOS-${{ needs.version.outputs.version }}
path: |
dist/*.dmg
retention-days: 30

# Release job - only runs on tag pushes
release:
if: needs.version.outputs.is_release == 'true'
needs: [version, build-windows, build-linux, build-macos]
runs-on: ubuntu-latest

steps:
- name: Download all artifacts
uses: actions/download-artifact@v4
with:
path: artifacts

- name: Display structure of downloaded files
run: ls -la artifacts/

- name: Create Release
uses: softprops/action-gh-release@v2
with:
allowUpdates: false
name: Release ${{ env.version }}
files: |
artifacts/**/*
draft: false
prerelease: false
token: ${{ secrets.GITHUB_TOKEN }}
artifacts: "./dist/Auto-Wall.exe"
tag: ${{ github.ref_name }}
tag_name: ${{ github.ref_name }}
name: "Auto-Wall v${{ needs.version.outputs.version }}"
body: |
## Auto-Wall v${{ needs.version.outputs.version }}

### 📥 Downloads

**Windows:**
- `Auto-Wall.exe` - Standalone executable

**Linux:**
- `Auto-Wall-*-x86_64.AppImage` - Universal Linux package
- `auto-wall_*_amd64.deb` - Debian/Ubuntu package

**macOS:**
- `Auto-Wall-macOS.dmg` - macOS installer

### 🚀 Installation

**Windows:** Download and run `Auto-Wall.exe`

**Linux:**
- AppImage: `chmod +x Auto-Wall-*.AppImage && ./Auto-Wall-*.AppImage`
- Debian: `sudo dpkg -i auto-wall_*.deb`

**macOS:** Download and open `Auto-Wall-macOS.dmg`, then drag the app to Applications

### 📝 Changes

See the [changelog](https://github.com/ThreeHats/auto-wall/releases) for detailed changes in this version.
generate_release_notes: true
36 changes: 34 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,7 +1,39 @@
build/
# Build artifacts
dist/
build/pyinstaller_work/
*.spec

# AppImage build artifacts
Auto-Wall.AppDir/
appimagetool-x86_64.AppImage

# Debian package build artifacts
auto-wall_debian/

# Python artifacts
__init__.py
__pycache__/
*.pyc
*.pyo
*.pyd
.Python

# Virtual environments
.venv/
venv/
env/

# Development files
wall_color_mask_debug.png
*.log
.venv/

# OS specific
.DS_Store
Thumbs.db

# IDE files
.vscode/
.idea/
*.swp
*.swo
*~
52 changes: 0 additions & 52 deletions Auto-Wall.spec

This file was deleted.

Loading