ci: fix linuxdeploy-plugin-gtk download URL #29
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Release | |
| on: | |
| push: | |
| tags: | |
| - "v*.*.*" | |
| permissions: | |
| contents: write | |
| jobs: | |
| generate-changelog: | |
| runs-on: ubuntu-latest | |
| outputs: | |
| version: ${{ steps.get_version.outputs.version }} | |
| changelog: ${{ steps.changelog.outputs.changelog }} | |
| release_body: ${{ steps.release_notes.outputs.body }} | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 | |
| - name: Extract version | |
| id: get_version | |
| run: echo "version=${GITHUB_REF#refs/tags/v}" >> $GITHUB_OUTPUT | |
| - name: Generate changelog | |
| id: changelog | |
| run: | | |
| set -e | |
| PREV_TAG=$(git describe --tags --abbrev=0 HEAD^ 2>/dev/null || echo "") | |
| if [ -z "$PREV_TAG" ]; then | |
| CHANGELOG=$(git log --pretty=format:"- %s" ${{ github.ref_name }}) | |
| else | |
| CHANGELOG=$(git log --pretty=format:"- %s" $PREV_TAG..${{ github.ref_name }}) | |
| fi | |
| CHANGELOG=$(echo "$CHANGELOG" | grep -vE "^(chore|ci|docs):" || echo "- Initial release") | |
| echo "changelog<<EOF" >> $GITHUB_OUTPUT | |
| echo "$CHANGELOG" >> $GITHUB_OUTPUT | |
| echo "EOF" >> $GITHUB_OUTPUT | |
| - name: Generate release notes | |
| id: release_notes | |
| run: | | |
| cat > release_body.md << 'EOF' | |
| # 🎉 Clipse GUI v${{ steps.get_version.outputs.version }} | |
| A GTK3 graphical user interface for the excellent | |
| [clipse](https://github.com/savedra1/clipse). | |
| ## 📝 Changelog | |
| ${{ steps.changelog.outputs.changelog }} | |
| EOF | |
| echo "body<<EOF" >> $GITHUB_OUTPUT | |
| cat release_body.md >> $GITHUB_OUTPUT | |
| echo "EOF" >> $GITHUB_OUTPUT | |
| build-linux-x86_64: | |
| runs-on: ubuntu-latest | |
| needs: generate-changelog | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Install dependencies | |
| run: | | |
| sudo apt-get update | |
| sudo apt-get install -y \ | |
| python3-venv python3-dev python3-gi python3-gi-cairo \ | |
| gir1.2-gtk-3.0 libgirepository1.0-dev build-essential \ | |
| libssl-dev zlib1g-dev patchelf libcairo2-dev pkg-config | |
| - name: Build | |
| run: | | |
| set -e | |
| python3 -m venv --system-site-packages venv | |
| . venv/bin/activate | |
| pip install -U pip Nuitka==2.6.9 ordered-set==4.1.0 zstandard==0.23.0 | |
| make nuitka | |
| mv dist/clipse-gui.bin \ | |
| dist/clipse-gui-v${{ needs.generate-changelog.outputs.version }}-linux-x86_64 | |
| chmod +x dist/* | |
| - uses: actions/upload-artifact@v4 | |
| with: | |
| name: linux-x86_64 | |
| path: dist/clipse-gui-v${{ needs.generate-changelog.outputs.version }}-linux-x86_64 | |
| build-appimage: | |
| runs-on: ubuntu-latest | |
| needs: | |
| - generate-changelog | |
| - build-linux-x86_64 | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Download linux binary | |
| uses: actions/download-artifact@v4 | |
| with: | |
| name: linux-x86_64 | |
| path: dist | |
| - name: Install AppImage tools | |
| run: | | |
| set -e | |
| sudo apt-get update | |
| sudo apt-get install -y \ | |
| libfuse2 wget patchelf desktop-file-utils | |
| wget https://github.com/linuxdeploy/linuxdeploy/releases/download/continuous/linuxdeploy-x86_64.AppImage | |
| wget https://raw.githubusercontent.com/linuxdeploy/linuxdeploy-plugin-gtk/master/linuxdeploy-plugin-gtk.sh | |
| chmod +x linuxdeploy-x86_64.AppImage linuxdeploy-plugin-gtk.sh | |
| - name: Prepare AppDir | |
| run: | | |
| set -e | |
| mkdir -p AppDir/usr/bin | |
| mv dist/clipse-gui-v${{ needs.generate-changelog.outputs.version }}-linux-x86_64 \ | |
| AppDir/usr/bin/clipse-gui | |
| chmod +x AppDir/usr/bin/clipse-gui | |
| - name: Add desktop file | |
| run: | | |
| cat > AppDir/clipse-gui.desktop << EOF | |
| [Desktop Entry] | |
| Type=Application | |
| Name=Clipse GUI | |
| Exec=clipse-gui | |
| Icon=clipse-gui | |
| Categories=Utility; | |
| Terminal=false | |
| EOF | |
| - name: Add icon | |
| run: | | |
| mkdir -p AppDir/usr/share/icons/hicolor/256x256/apps | |
| cp clipse-gui.png AppDir/usr/share/icons/hicolor/256x256/apps/clipse-gui.png | |
| - name: Build AppImage | |
| run: | | |
| set -e | |
| export ARCH=x86_64 | |
| ./linuxdeploy-x86_64.AppImage \ | |
| --appdir AppDir \ | |
| --plugin gtk \ | |
| --output appimage | |
| mv Clipse_GUI-*.AppImage \ | |
| clipse-gui-v${{ needs.generate-changelog.outputs.version }}-linux-x86_64.AppImage | |
| - name: Upload AppImage | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: appimage-x86_64 | |
| path: clipse-gui-v${{ needs.generate-changelog.outputs.version }}-linux-x86_64.AppImage | |
| build-linux-arm64: | |
| runs-on: ubuntu-latest | |
| needs: generate-changelog | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: docker/setup-qemu-action@v3 | |
| with: | |
| platforms: arm64 | |
| - name: Build in ARM64 container | |
| run: | | |
| set -e | |
| docker run --rm --platform linux/arm64 \ | |
| -v ${{ github.workspace }}:/workspace \ | |
| -w /workspace arm64v8/ubuntu:22.04 bash -c " | |
| set -e | |
| apt-get update && | |
| apt-get install -y python3 python3-pip python3-venv python3-dev \ | |
| python3-gi python3-gi-cairo gir1.2-gtk-3.0 \ | |
| libgirepository1.0-dev build-essential \ | |
| libssl-dev zlib1g-dev patchelf libcairo2-dev pkg-config && | |
| python3 -m venv --system-site-packages venv && | |
| . venv/bin/activate && | |
| pip install -U pip Nuitka==2.6.9 ordered-set==4.1.0 zstandard==0.23.0 && | |
| make nuitka && | |
| mv dist/clipse-gui.bin \ | |
| dist/clipse-gui-v${{ needs.generate-changelog.outputs.version }}-linux-aarch64 && | |
| chmod +x dist/* | |
| " | |
| - uses: actions/upload-artifact@v4 | |
| with: | |
| name: linux-arm64 | |
| path: dist/clipse-gui-v${{ needs.generate-changelog.outputs.version }}-linux-aarch64 | |
| build-macos: | |
| needs: generate-changelog | |
| strategy: | |
| matrix: | |
| include: | |
| - os: macos-13 | |
| arch: x86_64 | |
| - os: macos-15 | |
| arch: arm64 | |
| runs-on: ${{ matrix.os }} | |
| # macos-13 = Intel (x86_64), macos-14 = Apple Silicon (arm64) | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: actions/setup-python@v5 | |
| with: | |
| python-version: "3.11" | |
| - name: Install deps | |
| run: brew install gtk+3 pygobject3 cairo | |
| - name: Build | |
| run: | | |
| set -e | |
| python -m pip install pyinstaller pillow | |
| python -m PyInstaller --onefile \ | |
| --name clipse-gui-v${{ needs.generate-changelog.outputs.version }}-macos-${{ matrix.arch }} \ | |
| --hidden-import=gi \ | |
| --collect-all gi \ | |
| clipse-gui.py | |
| chmod +x dist/* | |
| - uses: actions/upload-artifact@v4 | |
| with: | |
| name: macos-${{ matrix.arch }} | |
| path: dist/clipse-gui-v${{ needs.generate-changelog.outputs.version }}-macos-${{ matrix.arch }} | |
| create-release: | |
| runs-on: ubuntu-latest | |
| needs: | |
| - generate-changelog | |
| - build-linux-x86_64 | |
| - build-linux-arm64 | |
| - build-macos | |
| - build-appimage | |
| steps: | |
| - uses: actions/download-artifact@v4 | |
| with: | |
| path: artifacts | |
| - uses: softprops/action-gh-release@v2 | |
| with: | |
| tag_name: ${{ github.ref_name }} | |
| name: "Release v${{ needs.generate-changelog.outputs.version }}" | |
| body: ${{ needs.generate-changelog.outputs.release_body }} | |
| files: | | |
| artifacts/linux-x86_64/* | |
| artifacts/linux-arm64/* | |
| artifacts/macos-x86_64/* | |
| artifacts/macos-arm64/* | |
| artifacts/appimage-x86_64/* |