Skip to content

Commit

Permalink
Tryout pyinstaller and innosetup in github action
Browse files Browse the repository at this point in the history
  • Loading branch information
RalfG committed Mar 31, 2022
1 parent ea500ff commit ace10f8
Showing 1 changed file with 76 additions and 48 deletions.
124 changes: 76 additions & 48 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,76 +2,104 @@ name: Publish to PyPI and GitHub release

on:
push:
tags:
- 'v*'
# tags:
# - 'v*'

jobs:
publish:
python-package:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2

- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: '3.8'

- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install setuptools wheel twine
- name: Copy models to GUI directory
run: |
cp -r deeplc/mods deeplc_gui
- name: Zip GUI directory
uses: thedoctor0/zip-release@master
with:
filename: 'deeplc_gui.zip'
exclusions: '/*src/*'
path: 'deeplc_gui/*'

- name: Create GitHub Release
uses: docker://antonyurchenko/git-release:v4
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
DRAFT_RELEASE: "false"
PRE_RELEASE: "false"
CHANGELOG_FILE: "CHANGELOG.md"
with:
args: |
deeplc_gui.zip
- name: Build and publish to PyPI
env:
TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }}
TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
run: |
python setup.py sdist bdist_wheel
twine upload dist/*
# twine upload dist/*
- name: Upload compiled wheels
uses: actions/upload-artifact@v2
with:
name: dist
path: dist/*.whl

build-streamlit-image:
runs-on: ubuntu-latest
needs: publish
windows-installer:
runs-on: windows-2022
needs: python-package
steps:
- uses: actions/checkout@v2
- id: latest_release
uses: pozetroninc/github-action-get-latest-release@master
- uses: actions/setup-python@v2
with:
owner: compomics
repo: DeepLC
- name: Login to GitHub Container Registry
uses: docker/login-action@v1
python-version: '3.8'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install . gooey pyinstaller
- name: Install Inno Setup
uses: crazy-max/ghaction-chocolatey@v1
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build and push to ghcr.io
uses: docker/build-push-action@v2
args: install innosetup -y --allow-unofficial --force
- name: Run pyinstaller
run: pyinstaller ./deeplc_pyinstaller.spec --clean --noconfirm
- name: Test built DeepLC exe
run: dist/deeplc/deeplc.exe --ignore-gooey --help
- name: Run Inno Setup
run: ISCC.exe ./deeplc_innosetup.iss
- name: Upload installer
uses: actions/upload-artifact@v2
with:
context: streamlit
push: true
tags: |
ghcr.io/compomics/deeplc-streamlit:${{ steps.latest_release.outputs.release }}
ghcr.io/compomics/deeplc-streamlit:latest
name: dist
path: dist/*.exe

# git-release:
# runs-on: ubuntu-latest
# needs: windows-installer
# steps:
# - name: Download installer
# uses: actions/download-artifact@v2
# with:
# name: dist
# path: dist
# - name: Create GitHub Release
# uses: docker://antonyurchenko/git-release:v4
# env:
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# DRAFT_RELEASE: "false"
# PRE_RELEASE: "false"
# CHANGELOG_FILE: "CHANGELOG.md"
# with:
# args: |
# dist/*.exe

# build-streamlit-image:
# runs-on: ubuntu-latest
# needs: python-package
# steps:
# - uses: actions/checkout@v2
# - id: latest_release
# uses: pozetroninc/github-action-get-latest-release@master
# with:
# owner: compomics
# repo: DeepLC
# - name: Login to GitHub Container Registry
# uses: docker/login-action@v1
# with:
# registry: ghcr.io
# username: ${{ github.repository_owner }}
# password: ${{ secrets.GITHUB_TOKEN }}
# - name: Build and push to ghcr.io
# uses: docker/build-push-action@v2
# with:
# context: streamlit
# push: true
# tags: |
# ghcr.io/compomics/deeplc-streamlit:${{ steps.latest_release.outputs.release }}
# ghcr.io/compomics/deeplc-streamlit:latest

0 comments on commit ace10f8

Please sign in to comment.