Skip to content
Open
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
111 changes: 111 additions & 0 deletions .github/workflows/build-and-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -353,3 +353,114 @@ jobs:
releaseDraft: false
prerelease: false
args: ${{ matrix.args }}


# Create tar.gz archives for AUR (Arch Linux)
create-aur-tarball:
needs: [publish-tauri]
runs-on: ubuntu-22.04
permissions:
contents: write
steps:
- uses: actions/checkout@v4

- name: Get version from tag
id: get_version
run: |
if [ "${{ github.event_name }}" = "release" ]; then
TAG="${{ github.event.release.tag_name }}"
else
TAG="${{ github.event.inputs.tag }}"
fi
VERSION="${TAG#v}"
echo "version=${VERSION}" >> $GITHUB_OUTPUT
echo "tag=${TAG}" >> $GITHUB_OUTPUT

- name: Download Linux deb from release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
VERSION="${{ steps.get_version.outputs.version }}"
TAG="${{ steps.get_version.outputs.tag }}"
REPO="AOSSIE-Org/PictoPy"

echo "Waiting for .deb asset to be available in release ${TAG}..."

# Poll for up to 10 minutes (60 attempts, 10 seconds apart)
MAX_ATTEMPTS=60
ATTEMPT=0
DEB_ASSET_URL=""
DEB_ASSET_NAME=""

while [ $ATTEMPT -lt $MAX_ATTEMPTS ]; do
ATTEMPT=$((ATTEMPT + 1))
echo "Attempt ${ATTEMPT}/${MAX_ATTEMPTS}: Checking for release assets..."

# Query GitHub API for release assets
ASSETS_JSON=$(curl -s -H "Authorization: token ${GITHUB_TOKEN}" \
-H "Accept: application/vnd.github.v3+json" \
"https://api.github.com/repos/${REPO}/releases/tags/${TAG}")

# Check if release exists
if echo "$ASSETS_JSON" | jq -e '.assets' > /dev/null 2>&1; then
# Look for .deb file in assets (case-insensitive, amd64)
DEB_ASSET=$(echo "$ASSETS_JSON" | jq -r '.assets[] | select(.name | test(".*amd64\\.deb$"; "i")) | {name: .name, url: .browser_download_url}' | head -1)

if [ -n "$DEB_ASSET" ] && [ "$DEB_ASSET" != "null" ]; then
DEB_ASSET_NAME=$(echo "$ASSETS_JSON" | jq -r '.assets[] | select(.name | test(".*amd64\\.deb$"; "i")) | .name' | head -1)
DEB_ASSET_URL=$(echo "$ASSETS_JSON" | jq -r '.assets[] | select(.name | test(".*amd64\\.deb$"; "i")) | .browser_download_url' | head -1)

if [ -n "$DEB_ASSET_URL" ] && [ "$DEB_ASSET_URL" != "null" ]; then
echo "Found .deb asset: ${DEB_ASSET_NAME}"
echo "Download URL: ${DEB_ASSET_URL}"
break
fi
fi
fi

if [ $ATTEMPT -lt $MAX_ATTEMPTS ]; then
echo "Asset not found yet, waiting 10 seconds..."
sleep 10
fi
done

# Verify we found the asset
if [ -z "$DEB_ASSET_URL" ] || [ "$DEB_ASSET_URL" = "null" ]; then
echo "Error: Could not find .deb asset after ${MAX_ATTEMPTS} attempts"
echo "Available assets:"
echo "$ASSETS_JSON" | jq -r '.assets[].name' 2>/dev/null || echo "No assets found"
exit 1
fi

# Download the deb package
echo "Downloading ${DEB_ASSET_NAME}..."
curl -fLo pictopy.deb "$DEB_ASSET_URL"

echo "Successfully downloaded: pictopy.deb"
ls -la pictopy.deb

- name: Extract and repackage as tar.gz
run: |
VERSION="${{ steps.get_version.outputs.version }}"

# Extract deb package
mkdir -p extract
dpkg-deb -x pictopy.deb extract/

# Create tar.gz with proper structure
cd extract
tar -czvf "../pictopy_${VERSION}_amd64.tar.gz" .
cd ..

# Calculate checksum
sha256sum "pictopy_${VERSION}_amd64.tar.gz" > "pictopy_${VERSION}_amd64.tar.gz.sha256"

- name: Upload tar.gz to release
uses: softprops/action-gh-release@v1
with:
tag_name: ${{ steps.get_version.outputs.tag }}
files: |
pictopy_${{ steps.get_version.outputs.version }}_amd64.tar.gz
pictopy_${{ steps.get_version.outputs.version }}_amd64.tar.gz.sha256
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
162 changes: 162 additions & 0 deletions .github/workflows/publish-aur.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,162 @@
name: Publish to AUR

on:
release:
types: [published]
workflow_dispatch:
inputs:
tag:
description: "Tag name for the release (e.g., v1.1.0)"
required: true
type: string

jobs:
publish-aur:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Get version from tag
id: get_version
run: |
if [ "${{ github.event_name }}" = "release" ]; then
TAG="${{ github.event.release.tag_name }}"
else
TAG="${{ github.event.inputs.tag }}"
fi
# Remove 'v' prefix if present
VERSION="${TAG#v}"
echo "version=${VERSION}" >> $GITHUB_OUTPUT
echo "tag=${TAG}" >> $GITHUB_OUTPUT

- name: Wait for release assets
run: |
echo "Waiting for release assets to be available..."
sleep 60

- name: Calculate SHA256 checksums
id: checksums
run: |
VERSION="${{ steps.get_version.outputs.version }}"
BASE_URL="https://github.com/AOSSIE-Org/PictoPy/releases/download/v${VERSION}"

# Download and calculate checksums for x86_64
echo "Downloading x86_64 tarball..."
if curl -fLo pictopy_amd64.tar.gz "${BASE_URL}/pictopy_${VERSION}_amd64.tar.gz"; then
SHA256_X86_64=$(sha256sum pictopy_amd64.tar.gz | cut -d' ' -f1)
echo "sha256_x86_64=${SHA256_X86_64}" >> $GITHUB_OUTPUT
else
echo "sha256_x86_64=SKIP" >> $GITHUB_OUTPUT
fi

# Download and calculate checksums for aarch64
echo "Downloading aarch64 tarball..."
if curl -fLo pictopy_arm64.tar.gz "${BASE_URL}/pictopy_${VERSION}_arm64.tar.gz"; then
SHA256_AARCH64=$(sha256sum pictopy_arm64.tar.gz | cut -d' ' -f1)
echo "sha256_aarch64=${SHA256_AARCH64}" >> $GITHUB_OUTPUT
else
echo "sha256_aarch64=SKIP" >> $GITHUB_OUTPUT
fi

- name: Update PKGBUILD
run: |
VERSION="${{ steps.get_version.outputs.version }}"
SHA256_X86_64="${{ steps.checksums.outputs.sha256_x86_64 }}"
SHA256_AARCH64="${{ steps.checksums.outputs.sha256_aarch64 }}"

cd aur

# Update version in PKGBUILD
sed -i "s/^pkgver=.*/pkgver=${VERSION}/" PKGBUILD
sed -i "s/^pkgrel=.*/pkgrel=1/" PKGBUILD

# Update source URLs
sed -i "s|pictopy_[0-9.]*_amd64|pictopy_${VERSION}_amd64|g" PKGBUILD
sed -i "s|pictopy_[0-9.]*_arm64|pictopy_${VERSION}_arm64|g" PKGBUILD
sed -i "s|/v[0-9.]*/|/v${VERSION}/|g" PKGBUILD

# Update checksums
if [ "${SHA256_X86_64}" != "SKIP" ]; then
sed -i "s/^sha256sums_x86_64=.*/sha256sums_x86_64=('${SHA256_X86_64}')/" PKGBUILD
fi
if [ "${SHA256_AARCH64}" != "SKIP" ]; then
sed -i "s/^sha256sums_aarch64=.*/sha256sums_aarch64=('${SHA256_AARCH64}')/" PKGBUILD
fi

cat PKGBUILD

- name: Generate .SRCINFO
run: |
cd aur

VERSION="${{ steps.get_version.outputs.version }}"
SHA256_X86_64="${{ steps.checksums.outputs.sha256_x86_64 }}"
SHA256_AARCH64="${{ steps.checksums.outputs.sha256_aarch64 }}"

cat > .SRCINFO << EOF
pkgbase = pictopy
pkgdesc = A privacy-focused photo management application with AI-powered tagging and face recognition
pkgver = ${VERSION}
pkgrel = 1
url = https://github.com/AOSSIE-Org/PictoPy
install = pictopy.install
arch = x86_64
arch = aarch64
license = MIT
makedepends = rust
makedepends = cargo
makedepends = nodejs
makedepends = npm
makedepends = python
makedepends = python-pip
makedepends = pyinstaller
makedepends = webkit2gtk-4.1
makedepends = base-devel
makedepends = curl
makedepends = wget
makedepends = file
makedepends = openssl
makedepends = appmenu-gtk-module
makedepends = librsvg
depends = webkit2gtk-4.1
depends = gtk3
depends = glib2
depends = cairo
depends = pango
depends = gdk-pixbuf2
depends = libsoup3
depends = openssl
depends = hicolor-icon-theme
optdepends = python-onnxruntime: For AI model inference
optdepends = python-opencv: For image processing
optdepends = python-numpy: For numerical operations
options = !strip
options = !emptydirs
source_x86_64 = pictopy-${VERSION}-x86_64.tar.gz::https://github.com/AOSSIE-Org/PictoPy/releases/download/v${VERSION}/pictopy_${VERSION}_amd64.tar.gz
sha256sums_x86_64 = ${SHA256_X86_64}
source_aarch64 = pictopy-${VERSION}-aarch64.tar.gz::https://github.com/AOSSIE-Org/PictoPy/releases/download/v${VERSION}/pictopy_${VERSION}_arm64.tar.gz
sha256sums_aarch64 = ${SHA256_AARCH64}

pkgname = pictopy
EOF

# Remove leading whitespace
sed -i 's/^ //' .SRCINFO

cat .SRCINFO

- name: Publish to AUR
uses: KSXGitHub/[email protected]
with:
pkgname: pictopy
pkgbuild: ./aur/PKGBUILD
commit_username: ${{ secrets.AUR_USERNAME }}
commit_email: ${{ secrets.AUR_EMAIL }}
ssh_private_key: ${{ secrets.AUR_SSH_PRIVATE_KEY }}
commit_message: "Update to version ${{ steps.get_version.outputs.version }}"
ssh_keyscan_types: ed25519
force_push: true
assets: |
./aur/pictopy.install
./aur/.SRCINFO
30 changes: 30 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,36 @@

PictoPy is an advanced desktop gallery application that combines the power of Tauri, React, and Rust for the frontend with a Python backend for sophisticated image analysis and management.

## Installation

### Arch Linux (AUR)

PictoPy is available on the Arch User Repository (AUR) for Arch-based distributions (Arch, Manjaro, EndeavourOS, etc.):

```bash
# Using yay
yay -S pictopy

# Using paru
paru -S pictopy

# Using pikaur
pikaur -S pictopy
```

For the development version built from source:
```bash
yay -S pictopy-git
```

### Other Linux Distributions

Download the AppImage or .deb package from the [Releases](https://github.com/AOSSIE-Org/PictoPy/releases) page.

### Windows & macOS

Download the installer from the [Releases](https://github.com/AOSSIE-Org/PictoPy/releases) page.

# Want to Contribute? 😄

&nbsp;&nbsp;&nbsp;<a href="https://discord.gg/hjUhu33uAn"><img src="https://github.com/user-attachments/assets/3ed93273-5055-4532-a524-87a337a4fbba" height="40"></a>
Expand Down
31 changes: 31 additions & 0 deletions aur/.SRCINFO
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
pkgbase = pictopy
pkgdesc = A privacy-focused photo management application with AI-powered tagging and face recognition
pkgver = 1.1.0
pkgrel = 1
url = https://github.com/AOSSIE-Org/PictoPy
install = pictopy.install
arch = x86_64
arch = aarch64
license = MIT
makedepends = curl
makedepends = wget
depends = webkit2gtk-4.1
depends = gtk3
depends = glib2
depends = cairo
depends = pango
depends = gdk-pixbuf2
depends = libsoup3
depends = openssl
depends = hicolor-icon-theme
optdepends = python-onnxruntime: For AI model inference
optdepends = python-opencv: For image processing
optdepends = python-numpy: For numerical operations
options = !strip
options = !emptydirs
source_x86_64 = pictopy-1.1.0-x86_64.tar.gz::https://github.com/AOSSIE-Org/PictoPy/releases/download/v1.1.0/pictopy_1.1.0_amd64.tar.gz
sha256sums_x86_64 = SKIP
source_aarch64 = pictopy-1.1.0-aarch64.tar.gz::https://github.com/AOSSIE-Org/PictoPy/releases/download/v1.1.0/pictopy_1.1.0_arm64.tar.gz
sha256sums_aarch64 = SKIP

pkgname = pictopy
Loading