Update release.yml #19
Workflow file for this run
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: Publish | |
on: | |
push: | |
tags: | |
- '*' | |
jobs: | |
publish-mac: | |
name: Publish for macOS | |
runs-on: macos-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v3 | |
- name: Set up Python | |
uses: actions/setup-python@v2 | |
with: | |
python-version: '3.x' | |
- name: Create virtual environment | |
run: python3 -m venv .venv | |
- name: Activate virtual environment | |
run: source .venv/bin/activate | |
- name: Install dependencies | |
run: | | |
python3 -m pip install pillow pyinstaller python-dotenv | |
- name: Build PyInstaller application | |
run: | | |
pyinstaller --name RstEyeApp --windowed --onefile --add-data "med.gif:." --hidden-import=PIL.ImageTk --additional-hooks-dir=hooks app.py | |
- name: Zip the application | |
run: | | |
zip -r RstEyeApp.zip dist/RstEyeApp.app | |
- name: Upload ZIP file to GitHub release | |
uses: actions/upload-artifact@v2 | |
with: | |
name: RstEyeApp | |
path: RstEyeApp.zip | |
publish-ubuntu: | |
name: Publish for Ubuntu | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v3 | |
- name: Build Docker image | |
run: docker build -t rsteye-build . | |
- name: Create container and copy binary | |
run: | | |
docker run --rm -v $(pwd):/host rsteye-build sh -c 'cp /app/dist/RstEyeApp /host/RstEyeApp' | |
- name: Create Debian package structure and build package | |
run: | | |
mkdir -p rsteye/DEBIAN | |
mkdir -p rsteye/usr/bin | |
mkdir -p rsteye/lib/systemd/system | |
cp RstEyeApp rsteye/usr/bin/RstEyeApp | |
cp debian_pkg_files/rsteye.service rsteye/lib/systemd/system/rsteye.service | |
cp debian_pkg_files/control rsteye/DEBIAN/control | |
cp debian_pkg_files/postinst rsteye/DEBIAN/postinst | |
cp debian_pkg_files/postrm rsteye/DEBIAN/postrm | |
chmod 755 rsteye/DEBIAN/postinst | |
chmod 755 rsteye/DEBIAN/postrm | |
dpkg-deb --build rsteye | |
- name: Upload files to a GitHub release | |
uses: svenstaro/[email protected] | |
with: | |
repo_token: ${{ secrets.GITHUB_TOKEN }} | |
file: rsteye.deb | |
asset_name: rsteye.deb | |
tag: ${{ github.ref }} |