Skip to content

@

@ #45

Workflow file for this run

name: Build
on:
push:
tags: ['v*']
workflow_dispatch:
permissions:
contents: write
jobs:
build:
strategy:
fail-fast: false
matrix:
include:
- os: windows-latest
artifact: clipsync-windows
- os: macos-latest
artifact: clipsync-macos
- os: ubuntu-latest
artifact: clipsync-linux
- os: ubuntu-24.04-arm
artifact: clipsync-linux-arm64
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.12"
- name: Install system dependencies (Linux)
if: runner.os == 'Linux'
run: |
sudo apt-get update
sudo apt-get install -y libx11-dev libxext-dev libxcb1 xclip
- name: Install Python dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt
pip install pyinstaller
- name: Build with PyInstaller
run: |
pyinstaller clipsync.spec
- name: Package for release (macOS ditto preserves symlinks)
if: runner.os == 'macOS'
run: |
ditto -c -k --keepParent dist/clipsync.app clipsync-macos.zip
- name: Package for release (Windows)
if: runner.os == 'Windows'
shell: pwsh
run: |
Compress-Archive -Path dist/clipsync.exe -DestinationPath clipsync-windows.zip
- name: Package for release (Linux)
if: runner.os == 'Linux'
run: |
cd dist && tar -czf ../${{ matrix.artifact }}.tar.gz *
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: ${{ matrix.artifact }}
path: ${{ matrix.artifact }}*.*
if-no-files-found: error
release:
if: startsWith(github.ref, 'refs/tags/v')
needs: build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Download Windows build
uses: actions/download-artifact@v4
with:
name: clipsync-windows
path: dist
- name: Download macOS build
uses: actions/download-artifact@v4
with:
name: clipsync-macos
path: dist
- name: Download Linux build
uses: actions/download-artifact@v4
with:
name: clipsync-linux
path: dist
- name: Download Linux ARM64 build
uses: actions/download-artifact@v4
with:
name: clipsync-linux-arm64
path: dist
- name: Create Release
env:
GH_TOKEN: ${{ github.token }}
run: |
gh release delete "${{ github.ref_name }}" --yes 2>/dev/null || true
gh release create "${{ github.ref_name }}" \
--title "ClipSync ${{ github.ref_name }}" \
--notes "Automated build for ${{ github.ref_name }}.
- \`clipsync-windows.zip\` — Windows \`.exe\`
- \`clipsync-macos.zip\` — macOS \`.app\` bundle
- \`clipsync-linux.tar.gz\` — Linux x86_64 binary
- \`clipsync-linux-arm64.tar.gz\` — Linux ARM64 binary" \
dist/clipsync-windows.zip \
dist/clipsync-macos.zip \
dist/clipsync-linux.tar.gz \
dist/clipsync-linux-arm64.tar.gz