Macos release #17
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: python -m venv venv | |
- name: Activate virtual environment | |
run: source venv/bin/activate | |
- name: Install dependencies | |
run: | | |
pip install -r requirements.txt | |
pip install py2app | |
- name: Replace import statement | |
run: | | |
sed -i '' 's/from pkg_resources import packaging/import packaging/g' $(python -c "import py2app, os; print(os.path.dirname(py2app.__file__))")/recipes/matplotlib.py | |
- name: Build py2app application | |
run: python setup.py py2app | |
- name: Zip the application | |
run: zip -r RstEyeApp.zip dist/app.app | |
- name: Upload files to a GitHub release | |
uses: svenstaro/[email protected] | |
with: | |
repo_token: ${{ secrets.GITHUB_TOKEN }} | |
file: RstEyeApp.zip | |
asset_name: RstEyeApp.zip | |
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 }} |