Files
Windows-11-Clipboard-Histor…/.github/workflows/release.yml
dependabot[bot] 092dc854e5 chore(ci): bump actions/upload-artifact from 4 to 6 (#190)
Bumps [actions/upload-artifact](https://github.com/actions/upload-artifact) from 4 to 6.
- [Release notes](https://github.com/actions/upload-artifact/releases)
- [Commits](https://github.com/actions/upload-artifact/compare/v4...v6)

---
updated-dependencies:
- dependency-name: actions/upload-artifact
  dependency-version: '6'
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-02-16 16:30:17 -03:00

361 lines
14 KiB
YAML

name: Release
on:
push:
tags:
- "v*"
permissions:
contents: write
env:
CARGO_TERM_COLOR: always
jobs:
build:
name: Build (${{ matrix.arch }})
runs-on: ${{ matrix.runner }}
strategy:
fail-fast: false
matrix:
include:
- arch: x86_64
runner: ubuntu-latest
deb_arch: amd64
rpm_arch: x86_64
- arch: aarch64
runner: ubuntu-24.04-arm
deb_arch: arm64
rpm_arch: aarch64
steps:
- name: Checkout repository
uses: actions/checkout@v6
with:
fetch-depth: 0
- name: Get version from tag
id: get_version
run: echo "VERSION=${GITHUB_REF#refs/tags/v}" >> $GITHUB_OUTPUT
- name: Setup Node.js
uses: actions/setup-node@v6
with:
node-version: "20"
cache: "npm"
- name: Install Rust
uses: dtolnay/rust-toolchain@stable
- name: Cache Cargo
uses: actions/cache@v5
with:
path: |
~/.cargo/bin/
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
src-tauri/target/
key: ${{ runner.os }}-${{ matrix.arch }}-cargo-release-${{ hashFiles('**/Cargo.lock') }}
- name: Install system dependencies
run: |
sudo apt-get update
sudo apt-get install -y libwebkit2gtk-4.1-dev build-essential curl wget file \
libssl-dev libayatana-appindicator3-dev librsvg2-dev libxdo-dev \
libgtk-3-dev libglib2.0-dev
- name: Update version files
run: |
VERSION=${{ steps.get_version.outputs.VERSION }}
echo "Syncing version to $VERSION"
npm version $VERSION --no-git-tag-version --allow-same-version
sed -i 's/"version": "[^"]*"/"version": "'"$VERSION"'"/' src-tauri/tauri.conf.json
sed -i '0,/^version = "[^"]*"/s//version = "'"$VERSION"'"/' src-tauri/Cargo.toml
echo "=== Versions after sync ==="
echo "package.json: $(grep '"version"' package.json | head -1)"
echo "tauri.conf.json: $(grep '"version"' src-tauri/tauri.conf.json | head -1)"
echo "Cargo.toml: $(grep '^version' src-tauri/Cargo.toml | head -1)"
- name: Install npm dependencies
run: npm ci
- name: Build Tauri app
run: npm run tauri:build
- name: Upload build artifacts
uses: actions/upload-artifact@v6
with:
name: build-${{ matrix.arch }}
path: |
src-tauri/target/release/bundle/deb/*.deb
src-tauri/target/release/bundle/appimage/*.AppImage
src-tauri/target/release/bundle/rpm/*.rpm
retention-days: 1
release:
name: Create Release
needs: build
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v6
- name: Get version from tag
id: get_version
run: echo "VERSION=${GITHUB_REF#refs/tags/v}" >> $GITHUB_OUTPUT
- name: Download all artifacts
uses: actions/download-artifact@v4
with:
path: artifacts
merge-multiple: true
- name: List artifacts
run: find artifacts -type f | head -50
- name: Create Release and Upload Assets
uses: softprops/action-gh-release@v2
if: startsWith(github.ref, 'refs/tags/')
with:
tag_name: ${{ github.ref_name }}
name: Release ${{ github.ref_name }}
generate_release_notes: true
draft: false
prerelease: ${{ contains(github.ref_name, 'alpha') || contains(github.ref_name, 'beta') || contains(github.ref_name, 'rc') || contains(github.ref_name, 'dev') }}
files: |
artifacts/**/*.deb
artifacts/**/*.AppImage
artifacts/**/*.rpm
body: |
<div align="center">
<img width="128" height="128" alt="logo" src="https://github.com/user-attachments/assets/4534e915-5d83-45f3-9f09-48a0f94b1d9a" />
# W11 Clipboard For Linux ${{ github.ref_name }}
## 🚀 Quick Installation (Recommended)
```bash
curl -fsSL https://raw.githubusercontent.com/gustavosett/Windows-11-Clipboard-History-For-Linux/master/scripts/install.sh | bash
```
This script auto-detects your distro and architecture, then sets up everything including paste permissions.
</div>
---
### 📦 Manual Installation
<details>
<summary>Ubuntu/Debian (APT Repository - enables auto-updates)</summary>
```bash
curl -1sLf 'https://dl.cloudsmith.io/public/gustavosett/clipboard-manager/setup.deb.sh' | sudo -E bash
sudo apt update && sudo apt install win11-clipboard-history
sudo setfacl -m u:$USER:rw /dev/uinput # For immediate paste access
```
Or download the `.deb` directly (amd64 for x86_64, arm64 for ARM64):
```bash
sudo apt install ./win11-clipboard-history_${{ steps.get_version.outputs.VERSION }}_amd64.deb
sudo setfacl -m u:$USER:rw /dev/uinput
```
</details>
<details>
<summary>Fedora/RHEL (DNF Repository - enables auto-updates)</summary
```bash
curl -1sLf 'https://dl.cloudsmith.io/public/gustavosett/clipboard-manager/setup.rpm.sh' | sudo -E bash
sudo dnf install win11-clipboard-history
sudo setfacl -m u:$USER:rw /dev/uinput # For immediate paste access
```
Or download the `.rpm` directly (x86_64 for Intel/AMD, aarch64 for ARM64):
```bash
sudo dnf install ./win11-clipboard-history-${{ steps.get_version.outputs.VERSION }}-1.x86_64.rpm
sudo setfacl -m u:$USER:rw /dev/uinput
```
</details>
<details>
<summary>Arch Linux (AUR)</summary>
```bash
yay -S win11-clipboard-history-bin
```
</details>
<details>
<summary>AppImage (Universal - any distro)</summary>
> ## Some features are disabled; we strongly recommend the complete installation.
```bash
# Download the correct AppImage for your architecture
chmod +x win11-clipboard-history_${{ steps.get_version.outputs.VERSION }}_amd64.AppImage
sudo setfacl -m u:$USER:rw /dev/uinput # Required for paste simulation
./win11-clipboard-history_${{ steps.get_version.outputs.VERSION }}_amd64.AppImage
```
then register the command that you want in your system to open the AppImage
```
KEYBOARD SETTINGS -> SHORTCUTS -> NEW SHORTCUT -> Super+V -> ./my_awesome_folder/win11-clipboard-history_${{ steps.get_version.outputs.VERSION }}_amd64.AppImage
```
> **Note:** The `setfacl` command is temporary (resets on reboot). For permanent setup, see the [README](https://github.com/gustavosett/Windows-11-Clipboard-History-For-Linux#appimage-universal).
</details>
---
### ⌨️ Usage
Press **Super+V** to open the clipboard history. The app will show a Setup Wizard on first run to configure shortcuts and permissions.
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Upload to Cloudsmith (stable releases only)
if: ${{ !contains(github.ref_name, 'alpha') && !contains(github.ref_name, 'beta') && !contains(github.ref_name, 'rc') && !contains(github.ref_name, 'dev') }}
continue-on-error: true
env:
CLOUDSMITH_API_KEY: ${{ secrets.CLOUDSMITH_API_KEY }}
run: |
if [ -z "$CLOUDSMITH_API_KEY" ]; then
echo "⚠️ CLOUDSMITH_API_KEY not set, skipping Cloudsmith upload"
exit 0
fi
pip install cloudsmith-cli
VERSION=${{ steps.get_version.outputs.VERSION }}
echo "Uploading STABLE release v$VERSION to Cloudsmith..."
# Upload all .deb files (x86_64 and arm64)
deb_files=$(find artifacts -name '*.deb' 2>/dev/null)
if [ -n "$deb_files" ]; then
echo "$deb_files" | while read -r deb; do
echo "Uploading $deb..."
cloudsmith push deb gustavosett/clipboard-manager/any-distro/any-version \
"$deb" --api-key $CLOUDSMITH_API_KEY || echo "Cloudsmith .deb upload failed for $deb (may already exist)"
done
else
echo "No .deb files found to upload"
fi
# Upload all .rpm files (x86_64 and aarch64)
rpm_files=$(find artifacts -name '*.rpm' 2>/dev/null)
if [ -n "$rpm_files" ]; then
echo "$rpm_files" | while read -r rpm; do
echo "Uploading $rpm..."
cloudsmith push rpm gustavosett/clipboard-manager/any-distro/any-version \
"$rpm" --api-key $CLOUDSMITH_API_KEY || echo "Cloudsmith .rpm upload failed for $rpm (may already exist)"
done
else
echo "No .rpm files found to upload"
fi
- name: Update AUR Package
if: ${{ !contains(github.ref_name, 'alpha') && !contains(github.ref_name, 'beta') && !contains(github.ref_name, 'rc') && !contains(github.ref_name, 'dev') }}
continue-on-error: true
env:
AUR_SSH_KEY: ${{ secrets.AUR_SSH_KEY }}
run: |
if [ -z "$AUR_SSH_KEY" ]; then
echo "AUR_SSH_KEY not set, skipping AUR update"
exit 0
fi
VERSION=${{ steps.get_version.outputs.VERSION }}
# Compute checksums for each architecture
DEB_X86_64=$(find artifacts -name "*_amd64.deb" | head -1)
DEB_ARM64=$(find artifacts -name "*_arm64.deb" | head -1)
if [ -z "$DEB_X86_64" ]; then
echo "x86_64 .deb not found, skipping AUR update"
exit 0
fi
SHA256_X86_64=$(sha256sum "$DEB_X86_64" | cut -d' ' -f1)
SHA256_ARM64=""
if [ -n "$DEB_ARM64" ]; then
SHA256_ARM64=$(sha256sum "$DEB_ARM64" | cut -d' ' -f1)
fi
echo "Updating AUR package to version $VERSION"
echo "x86_64 checksum: $SHA256_X86_64"
echo "arm64 checksum: ${SHA256_ARM64:-SKIP}"
# Setup SSH for AUR
mkdir -p ~/.ssh
echo "$AUR_SSH_KEY" > ~/.ssh/aur
chmod 600 ~/.ssh/aur
echo "Host aur.archlinux.org
User aur
IdentityFile ~/.ssh/aur
StrictHostKeyChecking no" > ~/.ssh/config
# Clone AUR repo
git clone ssh://aur@aur.archlinux.org/win11-clipboard-history-bin.git /tmp/aur-pkg
cd /tmp/aur-pkg
# Use aur/PKGBUILD from the repo as the single source of truth
cp "$GITHUB_WORKSPACE/aur/PKGBUILD" PKGBUILD
cp "$GITHUB_WORKSPACE/aur/win11-clipboard-history-bin.install" . 2>/dev/null || true
# Update version and checksums via sed
sed -i "s/^pkgver=.*/pkgver=$VERSION/" PKGBUILD
sed -i "s/^pkgrel=.*/pkgrel=1/" PKGBUILD
sed -i "s/sha256sums_x86_64=.*/sha256sums_x86_64=('$SHA256_X86_64')/" PKGBUILD
if [ -n "$SHA256_ARM64" ]; then
sed -i "s/sha256sums_aarch64=.*/sha256sums_aarch64=('$SHA256_ARM64')/" PKGBUILD
else
sed -i "s/sha256sums_aarch64=.*/sha256sums_aarch64=('SKIP')/" PKGBUILD
fi
# Generate .SRCINFO
docker run --rm -v "$PWD:/pkg" archlinux bash -c "
pacman -Sy --noconfirm pacman-contrib
cd /pkg
makepkg --printsrcinfo > .SRCINFO
" || {
echo "Docker failed, generating .SRCINFO manually"
TAB=$'\t'
cat > .SRCINFO << SRCINFO_EOF
pkgbase = win11-clipboard-history-bin
${TAB}pkgdesc = Windows 11-style Clipboard History Manager for Linux
${TAB}pkgver = $VERSION
${TAB}pkgrel = 1
${TAB}url = https://github.com/gustavosett/Windows-11-Clipboard-History-For-Linux
${TAB}install = win11-clipboard-history-bin.install
${TAB}arch = x86_64
${TAB}arch = aarch64
${TAB}license = MIT
${TAB}depends = webkit2gtk-4.1
${TAB}depends = gtk3
${TAB}depends = libayatana-appindicator
${TAB}depends = xclip
${TAB}depends = xdotool
${TAB}depends = wl-clipboard
${TAB}depends = acl
${TAB}depends = polkit
${TAB}optdepends = libappindicator-gtk3: Legacy tray icon support
${TAB}provides = win11-clipboard-history
${TAB}conflicts = win11-clipboard-history
${TAB}options = !strip
${TAB}options = !debug
${TAB}source_x86_64 = https://github.com/gustavosett/Windows-11-Clipboard-History-For-Linux/releases/download/v$VERSION/win11-clipboard-history_${VERSION}_amd64.deb
${TAB}sha256sums_x86_64 = $SHA256_X86_64
${TAB}source_aarch64 = https://github.com/gustavosett/Windows-11-Clipboard-History-For-Linux/releases/download/v$VERSION/win11-clipboard-history_${VERSION}_arm64.deb
${TAB}sha256sums_aarch64 = ${SHA256_ARM64:-SKIP}
pkgname = win11-clipboard-history-bin
SRCINFO_EOF
sed -i 's/^ //' .SRCINFO
}
# Commit and push
git config user.name "GitHub Actions"
git config user.email "actions@github.com"
git add PKGBUILD .SRCINFO
git commit -m "Update to version $VERSION" || echo "No changes to commit"
git push || echo "Push failed - may need manual intervention"