Improve release creation action #84
This file contains 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: Create release | |
on: | |
push: | |
branches: | |
- "reborn" | |
tags: | |
- "v1.**" | |
jobs: | |
build-appimage: | |
name: Build Appimage | |
runs-on: ubuntu-22.04 | |
steps: | |
- run: sudo apt install desktop-file-utils -y | |
- uses: actions/checkout@v4 | |
- name: Download appimagetool | |
run: wget https://github.com/AppImage/appimagetool/releases/download/continuous/appimagetool-x86_64.AppImage -O appimagetool | |
- run: chmod +x appimagetool | |
- uses: actions/setup-python@v5 | |
with: | |
python-version: 3.12 | |
- name: Install poetry | |
uses: abatilo/actions-poetry@v2 | |
- name: Install deps | |
run: poetry install | |
- run: poetry update qcanvas-backend | |
- name: Build pyinstaller | |
run: poetry run pyinstaller --hidden-import aiosqlite --onedir -n AppRun qcanvas/run.py | |
- name: Move files | |
run: mv dist/*/* appimage/ | |
- name: Set version | |
uses: richardrigutins/replace-in-files@v2 | |
with: | |
files: "appimage/qcanvas.desktop" | |
search-text: "#VERSION#" | |
replacement-text: ${{github.ref_name}} | |
- name: Package AppImage | |
run: ./appimagetool appimage -u "gh-releases-zsync|QCanvas|QCanvasApp|latest|QCanvas-x86_64.AppImage.zsync" | |
- name: Create release | |
run: gh release create ${{ github.ref_name }} --generate-notes | |
- name: Upload binaries | |
run: gh release ${{ github.ref_name }} QCanvas-* --clobber | |
build-windows: | |
name: Build PyInstaller Windows | |
runs-on: windows-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-python@v5 | |
with: | |
python-version: 3.12 | |
- name: Install poetry | |
uses: abatilo/actions-poetry@v2 | |
- name: Install deps | |
run: poetry install | |
- run: poetry update qcanvas-backend | |
- name: Build pyinstaller | |
run: poetry run pyinstaller --hidden-import aiosqlite --onefile -n QCanvas --icon windows/qcanvas.ico qcanvas/run.py --windowed | |
- name: Create release | |
run: gh release create ${{ github.ref_name }} --generate-notes | |
- name: Upload binaries | |
run: gh release ${{ github.ref_name }} dist/QCanvas.exe --clobber |