@@ -9,9 +9,12 @@ permissions:
99 contents : write
1010
1111jobs :
12- release :
12+ generate-changelog :
1313 runs-on : ubuntu-latest
14-
14+ outputs :
15+ version : ${{ steps.get_version.outputs.version }}
16+ changelog : ${{ steps.changelog.outputs.changelog }}
17+ release_body : ${{ steps.release_notes.outputs.body }}
1518 steps :
1619 - name : Checkout
1720 uses : actions/checkout@v4
@@ -31,27 +34,72 @@ jobs:
3134 else
3235 CHANGELOG=$(git log --pretty=format:"- %s" $PREV_TAG..${{ github.ref }})
3336 fi
34- CHANGELOG=$(echo "$CHANGELOG" | grep -vE "^(chore|ci|docs):")
37+ CHANGELOG=$(echo "$CHANGELOG" | grep -vE "^(chore|ci|docs):" || echo "- Initial release" )
3538 echo "changelog<<EOF" >> $GITHUB_OUTPUT
3639 echo "$CHANGELOG" >> $GITHUB_OUTPUT
3740 echo "EOF" >> $GITHUB_OUTPUT
3841
3942 - name : Generate release notes
4043 id : release_notes
4144 run : |
42- cat > release_body.md << EOF
45+ cat > release_body.md << ' EOF'
4346 # 🎉 Clipse GUI v${{ steps.get_version.outputs.version }}
4447
4548 A GTK3 graphical user interface for the excellent [clipse](https://github.com/savedra1/clipse).
4649
50+ ## 📦 Downloads
51+
52+ ### Linux
53+ - **x86_64**: `clipse-gui-v${{ steps.get_version.outputs.version }}-linux-x86_64`
54+ - **ARM64/aarch64**: `clipse-gui-v${{ steps.get_version.outputs.version }}-linux-aarch64`
55+
56+ ### Windows
57+ - **x86_64**: `clipse-gui-v${{ steps.get_version.outputs.version }}-windows-x86_64.exe`
58+ - **Note**: Requires GTK3 runtime. See [Windows Setup Guide](https://github.com/savedra1/clipse-gui#windows-installation)
59+
60+ ### macOS
61+ - **Intel (x86_64)**: `clipse-gui-v${{ steps.get_version.outputs.version }}-macos-x86_64`
62+ - **Apple Silicon (ARM64)**: `clipse-gui-v${{ steps.get_version.outputs.version }}-macos-arm64`
63+ - **Note**: Requires GTK3 via Homebrew. See [macOS Setup Guide](https://github.com/savedra1/clipse-gui#macos-installation)
64+
4765 ## 📝 Changelog
4866 ${{ steps.changelog.outputs.changelog }}
67+
68+ ## 🚀 Installation
69+
70+ ### Linux
71+ ```bash
72+ # Download and install
73+ chmod +x clipse-gui-v${{ steps.get_version.outputs.version }}-linux-*
74+ sudo mv clipse-gui-v${{ steps.get_version.outputs.version }}-linux-* /usr/local/bin/clipse-gui
75+ ```
76+
77+ ### Windows
78+ 1. Install GTK3 runtime from [gtk.org](https://www.gtk.org/docs/installations/windows/)
79+ 2. Download and run the `.exe` file
80+
81+ ### macOS
82+ ```bash
83+ # Install GTK3 first
84+ brew install gtk+3 pygobject3
85+
86+ # Download and install
87+ chmod +x clipse-gui-v${{ steps.get_version.outputs.version }}-macos-*
88+ sudo mv clipse-gui-v${{ steps.get_version.outputs.version }}-macos-* /usr/local/bin/clipse-gui
89+ ```
4990 EOF
5091
5192 echo "body<<EOF" >> $GITHUB_OUTPUT
5293 cat release_body.md >> $GITHUB_OUTPUT
5394 echo "EOF" >> $GITHUB_OUTPUT
5495
96+ build-linux-x86_64 :
97+ runs-on : ubuntu-latest
98+ needs : generate-changelog
99+ steps :
100+ - name : Checkout
101+ uses : actions/checkout@v4
102+
55103 - name : Install build dependencies
56104 run : |
57105 sudo apt-get update
@@ -74,15 +122,171 @@ jobs:
74122 - name : Rename artifact
75123 run : |
76124 mv dist/clipse-gui.bin \
77- dist/clipse-gui-v${{ steps.get_version.outputs.version }}-linux-x86_64
78- chmod +x dist/clipse-gui-v${{ steps.get_version.outputs.version }}-linux-x86_64
125+ dist/clipse-gui-v${{ needs.generate-changelog.outputs.version }}-linux-x86_64
126+ chmod +x dist/clipse-gui-v${{ needs.generate-changelog.outputs.version }}-linux-x86_64
127+
128+ - name : Upload artifact
129+ uses : actions/upload-artifact@v4
130+ with :
131+ name : linux-x86_64
132+ path : dist/clipse-gui-v${{ needs.generate-changelog.outputs.version }}-linux-x86_64
133+
134+ build-linux-arm64 :
135+ runs-on : ubuntu-latest
136+ needs : generate-changelog
137+ steps :
138+ - name : Checkout
139+ uses : actions/checkout@v4
140+
141+ - name : Set up QEMU
142+ uses : docker/setup-qemu-action@v3
143+ with :
144+ platforms : arm64
145+
146+ - name : Build in ARM64 container
147+ run : |
148+ docker run --rm --platform linux/arm64 \
149+ -v ${{ github.workspace }}:/workspace \
150+ -w /workspace \
151+ arm64v8/ubuntu:22.04 \
152+ bash -c "
153+ apt-get update && \
154+ DEBIAN_FRONTEND=noninteractive apt-get install -y \
155+ python3 python3-pip python3-venv python3-dev python3-gi python3-gi-cairo \
156+ gir1.2-gtk-3.0 libgirepository1.0-dev build-essential \
157+ libssl-dev zlib1g-dev patchelf libcairo2-dev pkg-config && \
158+ python3 -m venv --system-site-packages venv && \
159+ . venv/bin/activate && \
160+ pip install --upgrade pip && \
161+ pip install Nuitka==2.6.9 ordered-set==4.1.0 zstandard==0.23.0 && \
162+ make nuitka && \
163+ mv dist/clipse-gui.bin dist/clipse-gui-v${{ needs.generate-changelog.outputs.version }}-linux-aarch64 && \
164+ chmod +x dist/clipse-gui-v${{ needs.generate-changelog.outputs.version }}-linux-aarch64
165+ "
166+
167+ - name : Upload artifact
168+ uses : actions/upload-artifact@v4
169+ with :
170+ name : linux-arm64
171+ path : dist/clipse-gui-v${{ needs.generate-changelog.outputs.version }}-linux-aarch64
172+
173+ build-windows :
174+ runs-on : windows-latest
175+ needs : generate-changelog
176+ steps :
177+ - name : Checkout
178+ uses : actions/checkout@v4
179+
180+ - name : Setup Python
181+ uses : actions/setup-python@v5
182+ with :
183+ python-version : ' 3.11'
184+
185+ - name : Setup MSYS2
186+ uses : msys2/setup-msys2@v2
187+ with :
188+ msystem : MINGW64
189+ update : true
190+ install : >-
191+ mingw-w64-x86_64-gtk3
192+ mingw-w64-x86_64-python-gobject
193+ mingw-w64-x86_64-python-cairo
194+ mingw-w64-x86_64-python-pip
195+
196+ - name : Install Python dependencies
197+ shell : msys2 {0}
198+ run : |
199+ pip install pyinstaller pillow
200+
201+ - name : Build with PyInstaller
202+ shell : msys2 {0}
203+ run : |
204+ pyinstaller --onefile --windowed \
205+ --name clipse-gui-v${{ needs.generate-changelog.outputs.version }}-windows-x86_64 \
206+ --icon=clipse-gui.png \
207+ --hidden-import=gi \
208+ --collect-all gi \
209+ clipse-gui.py
210+
211+ - name : Upload artifact
212+ uses : actions/upload-artifact@v4
213+ with :
214+ name : windows-x86_64
215+ path : dist/clipse-gui-v${{ needs.generate-changelog.outputs.version }}-windows-x86_64.exe
216+
217+ build-macos :
218+ strategy :
219+ matrix :
220+ include :
221+ - os : macos-13 # Intel x86_64
222+ arch : x86_64
223+ - os : macos-14 # Apple Silicon ARM64
224+ arch : arm64
225+ runs-on : ${{ matrix.os }}
226+ needs : generate-changelog
227+ steps :
228+ - name : Checkout
229+ uses : actions/checkout@v4
230+
231+ - name : Setup Python
232+ uses : actions/setup-python@v5
233+ with :
234+ python-version : ' 3.11'
235+
236+ - name : Install GTK3 and dependencies
237+ run : |
238+ brew install gtk+3 pygobject3 cairo
239+
240+ - name : Install Python dependencies
241+ run : |
242+ pip install pyinstaller pillow
243+
244+ - name : Build with PyInstaller
245+ run : |
246+ pyinstaller --onefile \
247+ --name clipse-gui-v${{ needs.generate-changelog.outputs.version }}-macos-${{ matrix.arch }} \
248+ --hidden-import=gi \
249+ --collect-all gi \
250+ clipse-gui.py
251+
252+ - name : Make executable
253+ run : |
254+ chmod +x dist/clipse-gui-v${{ needs.generate-changelog.outputs.version }}-macos-${{ matrix.arch }}
255+
256+ - name : Upload artifact
257+ uses : actions/upload-artifact@v4
258+ with :
259+ name : macos-${{ matrix.arch }}
260+ path : dist/clipse-gui-v${{ needs.generate-changelog.outputs.version }}-macos-${{ matrix.arch }}
261+
262+ create-release :
263+ runs-on : ubuntu-latest
264+ needs :
265+ - generate-changelog
266+ - build-linux-x86_64
267+ - build-linux-arm64
268+ - build-windows
269+ - build-macos
270+ steps :
271+ - name : Download all artifacts
272+ uses : actions/download-artifact@v4
273+ with :
274+ path : artifacts
275+
276+ - name : Display structure
277+ run : ls -R artifacts
79278
80- - name : Upload release
279+ - name : Create release
81280 uses : softprops/action-gh-release@v2
82281 with :
83282 tag_name : ${{ github.ref }}
84- name : " Release v${{ steps.get_version.outputs.version }}"
85- body : ${{ steps.release_notes.outputs.body }}
86- files : dist/clipse-gui-v${{ steps.get_version.outputs.version }}-linux-x86_64
283+ name : " Release v${{ needs.generate-changelog.outputs.version }}"
284+ body : ${{ needs.generate-changelog.outputs.release_body }}
285+ files : |
286+ artifacts/linux-x86_64/*
287+ artifacts/linux-arm64/*
288+ artifacts/windows-x86_64/*
289+ artifacts/macos-x86_64/*
290+ artifacts/macos-arm64/*
87291 draft : false
88292 prerelease : false
0 commit comments