Added joint script to make a release

This commit is contained in:
Gres 2022-02-05 20:32:16 +03:00
parent 958b86044e
commit 5581f385ae
2 changed files with 56 additions and 48 deletions

View File

@ -63,56 +63,11 @@ jobs:
path: deps
key: ${{ env.OS }}-deps
- name: Get Qt
run: python ./share/ci/get_qt.py
- name: Get ssl
run: python ./share/ci/get_qt_ssl.py
- name: Get leptonica
run: python ./share/ci/get_leptonica.py
- name: Get tesseract optimized
env:
MARCH: sandy-bridge
TAG: optimized
run: python ./share/ci/get_tesseract.py
- name: Get tesseract compatible
env:
MARCH: nehalem
TAG: compatible
run: python ./share/ci/get_tesseract.py
- name: Get hunspell
run: python ./share/ci/get_hunspell.py
- name: Test
run: python ./share/ci/test.py
- name: Build
run: python ./share/ci/build.py
- name: Create AppImage
if: runner.os == 'Linux'
- name: Make a release
shell: bash
run: |
python ./share/ci/appimage.py
echo "artifact=`python ./share/ci/appimage.py artifact_name`" >> $GITHUB_ENV
- name: Create win deploy
if: runner.os == 'Windows'
shell: bash
run: |
python ./share/ci/windeploy.py
echo "artifact=`python ./share/ci/windeploy.py artifact_name`" >> $GITHUB_ENV
- name: Create mac deploy
if: runner.os == 'macOS'
shell: bash
run: |
python ./share/ci/macdeploy.py
echo "artifact=`python ./share/ci/macdeploy.py artifact_name`" >> $GITHUB_ENV
python ./share/ci/release.py
echo "artifact=`python ./share/ci/release.py artifact_name`" >> $GITHUB_ENV
- name: Upload build artifact
if: env.artifact != ''

53
share/ci/release.py Normal file
View File

@ -0,0 +1,53 @@
import os
import platform
import sys
import subprocess
here = os.path.dirname(__file__)
def r_out(script, args):
return subprocess.run([sys.executable, os.path.join(here, script)] + args, check=True, stdout=subprocess.PIPE).stdout.decode('utf-8').strip()
if len(sys.argv) > 1 and sys.argv[1] == 'artifact_name':
artifact_name = ''
if platform.system() == "Linux":
artifact_name = r_out('appimage.py', ['artifact_name'])
if platform.system() == "Windows":
artifact_name = r_out('windeploy.py', ['artifact_name'])
if platform.system() == "Darwin":
artifact_name = r_out('macdeploy.py', ['artifact_name'])
print(artifact_name)
exit(0)
def r(script):
return subprocess.run([sys.executable, os.path.join(here, script)], check=True)
r('get_qt.py')
r('get_qt_ssl.py')
r('get_leptonica.py')
os.environ['MARCH'] = 'sandy-bridge'
os.environ['TAG'] = 'optimized'
r('get_tesseract.py')
os.environ['MARCH'] = 'nehalem'
os.environ['TAG'] = 'compatible'
r('get_tesseract.py')
del os.environ['MARCH']
del os.environ['TAG']
r('get_hunspell.py')
r('test.py')
r('build.py')
if platform.system() == "Linux":
r('appimage.py')
if platform.system() == "Windows":
r('windeploy.py')
if platform.system() == "Darwin":
r('macdeploy.py')