Merge pull request #19 from RstEyeApp/mac_os_installer #28
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:." --add-data "rsteye.png:." --hidden-import=PIL.ImageTk --additional-hooks-dir=hooks app.py | |
- name: Create initial PKG structure | |
run: | | |
pkgbuild --root dist/RstEyeApp.app --scripts mac_os_files/scripts --identifier com.rsteye.rsteye --version 1.0 --install-location /Applications/RstEyeApp mac_os_files/RstEyeApp.pkg | |
# - name: Sign PKG | |
# run: | | |
# codesign --deep -s - --options runtime --timestamp --entitlements mac_os_files/entitlements.plist mac_os_files/RstEyeApp.pkg | |
- name: Create Final Installer | |
run: | | |
productbuild --distribution mac_os_files/distribution.xml --resources mac_os_files/resources --package-path mac_os_files --version 1.0 RstEyeAppInstaller.pkg | |
- name: Upload files to a GitHub release | |
uses: svenstaro/[email protected] | |
with: | |
repo_token: ${{ secrets.GITHUB_TOKEN }} | |
file: RstEyeAppInstaller.pkg | |
asset_name: RstEyeAppInstaller.pkg | |
tag: ${{ github.ref }} | |
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 }} | |
publish-windows: | |
name: Publish for Windows | |
runs-on: windows-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: python -m venv .venv | |
- name: Activate virtual environment | |
run: .\.venv\Scripts\activate | |
- name: Install dependencies | |
run: | | |
python -m pip install pillow pyinstaller python-dotenv | |
- name: Build PyInstaller application | |
run: | | |
pyinstaller --name RstEyeApp --onefile --add-data "med.gif;." --hidden-import=PIL.ImageTk --additional-hooks-dir=hooks app.py | |
- name: Install Inno Setup | |
run: | | |
choco install innosetup | |
- name: Create Inno Setup installer | |
shell: pwsh | |
run: | | |
& "C:\Program Files (x86)\Inno Setup 6\ISCC.exe" setup.iss | |
- name: Upload files to a GitHub release | |
uses: svenstaro/[email protected] | |
with: | |
repo_token: ${{ secrets.GITHUB_TOKEN }} | |
file: dist\RstEyeAppInstaller.exe | |
asset_name: RstEyeAppInstaller.exe | |
tag: ${{ github.ref }} |