From 86800fb081de84dd1b92ae85ec4546c50031382d Mon Sep 17 00:00:00 2001 From: Marc Foley Date: Tue, 9 Nov 2021 23:27:06 +0000 Subject: [PATCH 1/8] wip pyinstaller spec --- gftools.spec | 100 +++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 100 insertions(+) create mode 100644 gftools.spec diff --git a/gftools.spec b/gftools.spec new file mode 100644 index 000000000..fe5327421 --- /dev/null +++ b/gftools.spec @@ -0,0 +1,100 @@ +# -*- mode: python ; coding: utf-8 -*- +from PyInstaller.utils.hooks import collect_all + +datas = [] +binaries = [('venv/lib/python3.9/site-packages/freetype/libfreetype.dylib', '.')] +hiddenimports = [] +tmp_ret = collect_all('gftools') +datas += tmp_ret[0]; binaries += tmp_ret[1]; hiddenimports += tmp_ret[2] +tmp_ret = collect_all('glyphsLib') +datas += tmp_ret[0]; binaries += tmp_ret[1]; hiddenimports += tmp_ret[2] + + + + + +qa_a = Analysis(['bin/gftools-qa.py'], + pathex=[], + binaries=[], + datas=[], + hiddenimports=[], + hookspath=[], + hooksconfig={}, + runtime_hooks=[], + excludes=[], + win_no_prefer_redirects=False, + win_private_assemblies=False, + noarchive=False) + +builder_a = Analysis(['bin/gftools-builder.py'], + pathex=[], + binaries=[], + datas=[], + hiddenimports=[], + hookspath=[], + hooksconfig={}, + runtime_hooks=[], + excludes=[], + win_no_prefer_redirects=False, + win_private_assemblies=False, + noarchive=False) + + +MERGE((qa_a, 'gftools-qa', 'bin/gftools-qa.py'), (builder_a, 'gftools-builder', 'bin/gftools-builder.py')) + + + +qa_pyz = PYZ(qa_a.pure) + +qa_exe = EXE(qa_pyz, + qa_a.scripts, + [], + exclude_binaries=True, + name='gftools-qa', + debug=False, + bootloader_ignore_signals=False, + strip=False, + upx=True, + console=True, + disable_windowed_traceback=False, + target_arch=None, + codesign_identity=None, + entitlements_file=None ) + +qa_coll = COLLECT(qa_exe, + qa_a.binaries, + qa_a.zipfiles, + qa_a.datas, + strip=False, + upx=True, + upx_exclude=[], + name='gftools-qa') + + + + +builder_pyz = PYZ(builder_a.pure) + +builder_exe = EXE(builder_pyz, + builder_a.scripts, + [], + exclude_binaries=True, + name='gftools-builder', + debug=False, + bootloader_ignore_signals=False, + strip=False, + upx=True, + console=True, + disable_windowed_traceback=False, + target_arch=None, + codesign_identity=None, + entitlements_file=None ) + +builder_coll = COLLECT(builder_exe, + builder_a.binaries, + builder_a.zipfiles, + builder_a.datas, + strip=False, + upx=True, + upx_exclude=[], + name='gftools-builder') \ No newline at end of file From 70eb86967d63be3e2759d0ae3c559c52007dd9b3 Mon Sep 17 00:00:00 2001 From: Marc Foley Date: Wed, 10 Nov 2021 14:05:54 +0000 Subject: [PATCH 2/8] good standalones --- gftools-builder.spec | 47 ++++++++++++++++++++++++++++++++++++++++++++ gftools-qa.spec | 47 ++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 94 insertions(+) create mode 100644 gftools-builder.spec create mode 100644 gftools-qa.spec diff --git a/gftools-builder.spec b/gftools-builder.spec new file mode 100644 index 000000000..75500aae8 --- /dev/null +++ b/gftools-builder.spec @@ -0,0 +1,47 @@ +# -*- mode: python ; coding: utf-8 -*- +from PyInstaller.utils.hooks import collect_all + +datas = [] +binaries = [] +hiddenimports = [] +tmp_ret = collect_all('glyphsLib') +datas += tmp_ret[0]; binaries += tmp_ret[1]; hiddenimports += tmp_ret[2] + + +block_cipher = None + + +a = Analysis(['bin/gftools-builder.py'], + pathex=[], + binaries=binaries, + datas=datas, + hiddenimports=hiddenimports, + hookspath=[], + hooksconfig={}, + runtime_hooks=[], + excludes=[], + win_no_prefer_redirects=False, + win_private_assemblies=False, + cipher=block_cipher, + noarchive=False) +pyz = PYZ(a.pure, a.zipped_data, + cipher=block_cipher) + +exe = EXE(pyz, + a.scripts, + a.binaries, + a.zipfiles, + a.datas, + [], + name='gftools-builder', + debug=False, + bootloader_ignore_signals=False, + strip=False, + upx=True, + upx_exclude=[], + runtime_tmpdir=None, + console=True, + disable_windowed_traceback=False, + target_arch=None, + codesign_identity=None, + entitlements_file=None ) diff --git a/gftools-qa.spec b/gftools-qa.spec new file mode 100644 index 000000000..2a31c5425 --- /dev/null +++ b/gftools-qa.spec @@ -0,0 +1,47 @@ +# -*- mode: python ; coding: utf-8 -*- +from PyInstaller.utils.hooks import collect_all + +datas = [] +binaries = [('venv/lib/python3.9/site-packages/freetype/libfreetype.dylib', '.')] +hiddenimports = [] +tmp_ret = collect_all('gftools') +datas += tmp_ret[0]; binaries += tmp_ret[1]; hiddenimports += tmp_ret[2] + + +block_cipher = None + + +a = Analysis(['bin/gftools-qa.py'], + pathex=[], + binaries=binaries, + datas=datas, + hiddenimports=hiddenimports, + hookspath=[], + hooksconfig={}, + runtime_hooks=[], + excludes=[], + win_no_prefer_redirects=False, + win_private_assemblies=False, + cipher=block_cipher, + noarchive=False) +pyz = PYZ(a.pure, a.zipped_data, + cipher=block_cipher) + +exe = EXE(pyz, + a.scripts, + a.binaries, + a.zipfiles, + a.datas, + [], + name='gftools-qa', + debug=False, + bootloader_ignore_signals=False, + strip=False, + upx=True, + upx_exclude=[], + runtime_tmpdir=None, + console=True, + disable_windowed_traceback=False, + target_arch=None, + codesign_identity=None, + entitlements_file=None ) From 66ffb97d3f42e43c7fc0c5a22029a6465bdcc4a3 Mon Sep 17 00:00:00 2001 From: Marc Foley Date: Wed, 10 Nov 2021 14:44:18 +0000 Subject: [PATCH 3/8] add gftool.spec --- gftools-builder.spec | 47 ----------- gftools-qa.spec | 47 ----------- gftools.spec | 189 +++++++++++++++++++++---------------------- 3 files changed, 94 insertions(+), 189 deletions(-) delete mode 100644 gftools-builder.spec delete mode 100644 gftools-qa.spec diff --git a/gftools-builder.spec b/gftools-builder.spec deleted file mode 100644 index 75500aae8..000000000 --- a/gftools-builder.spec +++ /dev/null @@ -1,47 +0,0 @@ -# -*- mode: python ; coding: utf-8 -*- -from PyInstaller.utils.hooks import collect_all - -datas = [] -binaries = [] -hiddenimports = [] -tmp_ret = collect_all('glyphsLib') -datas += tmp_ret[0]; binaries += tmp_ret[1]; hiddenimports += tmp_ret[2] - - -block_cipher = None - - -a = Analysis(['bin/gftools-builder.py'], - pathex=[], - binaries=binaries, - datas=datas, - hiddenimports=hiddenimports, - hookspath=[], - hooksconfig={}, - runtime_hooks=[], - excludes=[], - win_no_prefer_redirects=False, - win_private_assemblies=False, - cipher=block_cipher, - noarchive=False) -pyz = PYZ(a.pure, a.zipped_data, - cipher=block_cipher) - -exe = EXE(pyz, - a.scripts, - a.binaries, - a.zipfiles, - a.datas, - [], - name='gftools-builder', - debug=False, - bootloader_ignore_signals=False, - strip=False, - upx=True, - upx_exclude=[], - runtime_tmpdir=None, - console=True, - disable_windowed_traceback=False, - target_arch=None, - codesign_identity=None, - entitlements_file=None ) diff --git a/gftools-qa.spec b/gftools-qa.spec deleted file mode 100644 index 2a31c5425..000000000 --- a/gftools-qa.spec +++ /dev/null @@ -1,47 +0,0 @@ -# -*- mode: python ; coding: utf-8 -*- -from PyInstaller.utils.hooks import collect_all - -datas = [] -binaries = [('venv/lib/python3.9/site-packages/freetype/libfreetype.dylib', '.')] -hiddenimports = [] -tmp_ret = collect_all('gftools') -datas += tmp_ret[0]; binaries += tmp_ret[1]; hiddenimports += tmp_ret[2] - - -block_cipher = None - - -a = Analysis(['bin/gftools-qa.py'], - pathex=[], - binaries=binaries, - datas=datas, - hiddenimports=hiddenimports, - hookspath=[], - hooksconfig={}, - runtime_hooks=[], - excludes=[], - win_no_prefer_redirects=False, - win_private_assemblies=False, - cipher=block_cipher, - noarchive=False) -pyz = PYZ(a.pure, a.zipped_data, - cipher=block_cipher) - -exe = EXE(pyz, - a.scripts, - a.binaries, - a.zipfiles, - a.datas, - [], - name='gftools-qa', - debug=False, - bootloader_ignore_signals=False, - strip=False, - upx=True, - upx_exclude=[], - runtime_tmpdir=None, - console=True, - disable_windowed_traceback=False, - target_arch=None, - codesign_identity=None, - entitlements_file=None ) diff --git a/gftools.spec b/gftools.spec index fe5327421..e1af843b9 100644 --- a/gftools.spec +++ b/gftools.spec @@ -2,99 +2,98 @@ from PyInstaller.utils.hooks import collect_all datas = [] -binaries = [('venv/lib/python3.9/site-packages/freetype/libfreetype.dylib', '.')] +binaries = [("venv/lib/python3.9/site-packages/freetype/libfreetype.dylib", ".")] hiddenimports = [] -tmp_ret = collect_all('gftools') -datas += tmp_ret[0]; binaries += tmp_ret[1]; hiddenimports += tmp_ret[2] -tmp_ret = collect_all('glyphsLib') -datas += tmp_ret[0]; binaries += tmp_ret[1]; hiddenimports += tmp_ret[2] - - - - - -qa_a = Analysis(['bin/gftools-qa.py'], - pathex=[], - binaries=[], - datas=[], - hiddenimports=[], - hookspath=[], - hooksconfig={}, - runtime_hooks=[], - excludes=[], - win_no_prefer_redirects=False, - win_private_assemblies=False, - noarchive=False) - -builder_a = Analysis(['bin/gftools-builder.py'], - pathex=[], - binaries=[], - datas=[], - hiddenimports=[], - hookspath=[], - hooksconfig={}, - runtime_hooks=[], - excludes=[], - win_no_prefer_redirects=False, - win_private_assemblies=False, - noarchive=False) - - -MERGE((qa_a, 'gftools-qa', 'bin/gftools-qa.py'), (builder_a, 'gftools-builder', 'bin/gftools-builder.py')) - - - -qa_pyz = PYZ(qa_a.pure) - -qa_exe = EXE(qa_pyz, - qa_a.scripts, - [], - exclude_binaries=True, - name='gftools-qa', - debug=False, - bootloader_ignore_signals=False, - strip=False, - upx=True, - console=True, - disable_windowed_traceback=False, - target_arch=None, - codesign_identity=None, - entitlements_file=None ) - -qa_coll = COLLECT(qa_exe, - qa_a.binaries, - qa_a.zipfiles, - qa_a.datas, - strip=False, - upx=True, - upx_exclude=[], - name='gftools-qa') - - - - -builder_pyz = PYZ(builder_a.pure) - -builder_exe = EXE(builder_pyz, - builder_a.scripts, - [], - exclude_binaries=True, - name='gftools-builder', - debug=False, - bootloader_ignore_signals=False, - strip=False, - upx=True, - console=True, - disable_windowed_traceback=False, - target_arch=None, - codesign_identity=None, - entitlements_file=None ) - -builder_coll = COLLECT(builder_exe, - builder_a.binaries, - builder_a.zipfiles, - builder_a.datas, - strip=False, - upx=True, - upx_exclude=[], - name='gftools-builder') \ No newline at end of file +tmp_ret = collect_all("gftools") +datas += tmp_ret[0] +binaries += tmp_ret[1] +hiddenimports += tmp_ret[2] + +# from gftools builder +tmp_ret = collect_all("glyphsLib") +datas += tmp_ret[0] +binaries += tmp_ret[1] +hiddenimports += tmp_ret[2] + + + +block_cipher = None + + +a_qa = Analysis( + ["bin/gftools-qa.py"], + pathex=["."], + binaries=binaries, + datas=datas, + hiddenimports=hiddenimports, + hookspath=[], + hooksconfig={}, + runtime_hooks=[], + excludes=[], + win_no_prefer_redirects=False, + win_private_assemblies=False, + cipher=block_cipher, + noarchive=False, +) +a_builder = Analysis( + ["bin/gftools-builder.py"], + pathex=["."], + binaries=binaries, + datas=datas, + hiddenimports=hiddenimports, + hookspath=[], + hooksconfig={}, + runtime_hooks=[], + excludes=[], + win_no_prefer_redirects=False, + win_private_assemblies=False, + cipher=block_cipher, + noarchive=False, +) + +MERGE( + (a_qa, "gftools-qa", "gftools-qa"), + (a_builder, "gftools-builder", "gftools-builder"), +) + +pyz_qa = PYZ(a_qa.pure, a_qa.zipped_data, cipher=block_cipher) +pyz_builder = PYZ(a_builder.pure, a_builder.zipped_data, cipher=block_cipher) + +exe_qa = EXE( + pyz_qa, + a_qa.scripts, + a_qa.binaries, + a_qa.dependencies, + a_qa.zipfiles, + a_qa.datas, + [], + name="gftools-qa", + debug=False, + bootloader_ignore_signals=False, + strip=False, + upx=True, + console=True, + disable_windowed_traceback=False, + target_arch=None, + codesign_identity=None, + entitlements_file=None, +) +exe_builder = EXE( + pyz_builder, + a_builder.scripts, + a_builder.binaries, + a_builder.dependencies, + a_builder.zipfiles, + a_builder.datas, + [], + name="gftools-builder", + debug=False, + bootloader_ignore_signals=False, + strip=False, + upx=True, + console=True, + disable_windowed_traceback=False, + target_arch=None, + codesign_identity=None, + entitlements_file=None, +) \ No newline at end of file From 3c833572366d0da64cf314b81757cd6c4fb7911d Mon Sep 17 00:00:00 2001 From: Marc Foley Date: Thu, 18 Nov 2021 13:36:45 +0000 Subject: [PATCH 4/8] Build stand alones for each platform --- .github/workflows/publish-release.yml | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/.github/workflows/publish-release.yml b/.github/workflows/publish-release.yml index d115677ea..436d3dd30 100644 --- a/.github/workflows/publish-release.yml +++ b/.github/workflows/publish-release.yml @@ -6,6 +6,28 @@ on: name: Create and Publish Release jobs: + apps: + runs-on: ${{ matrix.platform }} + strategy: + matrix: + python-version: [3.9] + platform: [ubuntu-latest, windows-latest] + steps: + - uses: actions/checkout@v2 + with: + submodules: recursive + fetch-depth: 0 + - name: Set up Python ${{ matrix.python-version }} + uses: actions/setup-python@v2 + with: + python-version: ${{ matrix.python-version }} + - name: Install packages + run: | + pip install . + pip install pyinstaller + - name: Build executables + run: | + pyinstaller gftools.spec build: name: Create and Publish Release runs-on: ubuntu-latest From 6da2ca1b7988d57f1f85c0b66d637293a0c1ab31 Mon Sep 17 00:00:00 2001 From: Marc Foley Date: Thu, 18 Nov 2021 14:27:59 +0000 Subject: [PATCH 5/8] Dynamically get freetype binary --- gftools.spec | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/gftools.spec b/gftools.spec index e1af843b9..b25b7f9b6 100644 --- a/gftools.spec +++ b/gftools.spec @@ -1,8 +1,9 @@ # -*- mode: python ; coding: utf-8 -*- from PyInstaller.utils.hooks import collect_all +import freetype as ft datas = [] -binaries = [("venv/lib/python3.9/site-packages/freetype/libfreetype.dylib", ".")] +binaries = [(ft.raw.filename, ".")] hiddenimports = [] tmp_ret = collect_all("gftools") datas += tmp_ret[0] From 141876778d1f871a1bc21ae310671019eefa9b98 Mon Sep 17 00:00:00 2001 From: Marc Foley Date: Thu, 18 Nov 2021 14:30:44 +0000 Subject: [PATCH 6/8] install qa tools --- .github/workflows/publish-release.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/publish-release.yml b/.github/workflows/publish-release.yml index 436d3dd30..0754de4f5 100644 --- a/.github/workflows/publish-release.yml +++ b/.github/workflows/publish-release.yml @@ -23,7 +23,7 @@ jobs: python-version: ${{ matrix.python-version }} - name: Install packages run: | - pip install . + pip install .[qa] pip install pyinstaller - name: Build executables run: | From b1276b74ffe02f01e1cc68d96b0dc57410720567 Mon Sep 17 00:00:00 2001 From: Marc Foley Date: Thu, 18 Nov 2021 15:39:40 +0000 Subject: [PATCH 7/8] fix attaching zips --- .github/workflows/publish-release.yml | 45 +++++++++++++++++++++++++++ 1 file changed, 45 insertions(+) diff --git a/.github/workflows/publish-release.yml b/.github/workflows/publish-release.yml index 0754de4f5..8fc32df65 100644 --- a/.github/workflows/publish-release.yml +++ b/.github/workflows/publish-release.yml @@ -28,9 +28,24 @@ jobs: - name: Build executables run: | pyinstaller gftools.spec + - name: zip filename + id: zip-name + shell: bash + run: | + run: echo "ZIP_NAME=$(echo '${{ RUNNER_OS }}'-binaries" >> $GITHUB_ENV + - name: Archive artifacts + uses: actions/upload-artifact@v2 + with: + name: ${{ env.ZIP_NAME }} + path: | + dist/* + outputs: + zip_name: ${{ env.ZIP_NAME }} build: name: Create and Publish Release runs-on: ubuntu-latest + needs: + - apps steps: - uses: actions/checkout@v2 @@ -77,3 +92,33 @@ jobs: run: | python setup.py sdist bdist_wheel twine upload dist/gftools* + outputs: + zip_name: ${{ env.ZIP_NAME }} + + attach: + # only run if the commit is tagged... + if: github.event_name == 'release' + # ... and it builds successfully + needs: + - build + runs-on: ubuntu-latest + env: + ZIP_NAME: ${{ needs.build.outputs.zip_name }} + steps: + - uses: actions/checkout@v2 + - name: Download artefact files + uses: actions/download-artifact@v2 + with: + name: ${{ env.ZIP_NAME }} + path: ${{ env.ZIP_NAME }} + - name: Zip files + run: zip -r ${{ env.ZIP_NAME }}.zip ${{ env.ZIP_NAME }} + - name: Upload binaries to release + uses: svenstaro/upload-release-action@v2 + with: + repo_token: ${{ secrets.GITHUB_TOKEN }} + file: ${{ env.ZIP_NAME }}.zip + asset_name: ${{ env.ZIP_NAME }}.zip + tag: ${{ github.ref }} + overwrite: true + body: "Executable binaries" \ No newline at end of file From 8d756c86c14540adcefdb6bd11ce84d1a6c26d61 Mon Sep 17 00:00:00 2001 From: Marc Foley Date: Fri, 19 Nov 2021 12:36:11 +0000 Subject: [PATCH 8/8] fix --- .github/workflows/publish-release.yml | 171 +++++++++++++------------- 1 file changed, 84 insertions(+), 87 deletions(-) diff --git a/.github/workflows/publish-release.yml b/.github/workflows/publish-release.yml index 8fc32df65..02930d212 100644 --- a/.github/workflows/publish-release.yml +++ b/.github/workflows/publish-release.yml @@ -13,34 +13,39 @@ jobs: python-version: [3.9] platform: [ubuntu-latest, windows-latest] steps: - - uses: actions/checkout@v2 - with: - submodules: recursive - fetch-depth: 0 - - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@v2 - with: - python-version: ${{ matrix.python-version }} - - name: Install packages - run: | - pip install .[qa] - pip install pyinstaller - - name: Build executables - run: | - pyinstaller gftools.spec - - name: zip filename - id: zip-name - shell: bash - run: | - run: echo "ZIP_NAME=$(echo '${{ RUNNER_OS }}'-binaries" >> $GITHUB_ENV + - uses: actions/checkout@v2 + with: + submodules: recursive + fetch-depth: 0 + - name: Set up Python ${{ matrix.python-version }} + uses: actions/setup-python@v2 + with: + python-version: ${{ matrix.python-version }} + - name: Install packages + run: | + pip install .[qa] + pip install pyinstaller + - name: Build executables + run: | + pyinstaller gftools.spec + - name: gen zip file name + id: zip-name + shell: bash + # Set the archive name to repo name + "-assets" e.g "MavenPro-assets" + run: echo "ZIP_NAME=$(echo $RUNNER_OS)-binaries" >> $GITHUB_ENV + # If a new release is cut, use the release tag to auto-bump the source files + + # foo bar - name: Archive artifacts uses: actions/upload-artifact@v2 with: name: ${{ env.ZIP_NAME }} path: | dist/* - outputs: - zip_name: ${{ env.ZIP_NAME }} + outputs: + zip_name: ${{ env.ZIP_NAME }} + + build: name: Create and Publish Release runs-on: ubuntu-latest @@ -48,77 +53,69 @@ jobs: - apps steps: - - uses: actions/checkout@v2 - with: - submodules: recursive - fetch-depth: 0 - - name: Set up Python - uses: actions/setup-python@v2 - with: - python-version: '3.x' + - uses: actions/checkout@v2 + with: + submodules: recursive + fetch-depth: 0 + - name: Set up Python + uses: actions/setup-python@v2 + with: + python-version: '3.x' - - name: Install release dependencies - run: | - python -m pip install --upgrade pip - pip install --upgrade setuptools wheel twine + - name: Install release dependencies + run: | + python -m pip install --upgrade pip + pip install --upgrade setuptools wheel twine - - name: Get release notes - id: release_notes - run: | - # By default, GH Actions checkout will only fetch a single commit. - # For us to extract the release notes, we need to fetch the tags - # and tag annotations as well. - # https://github.com/actions/checkout/issues/290 - git fetch --tags --force - TAG_NAME=${GITHUB_REF/refs\/tags\//} - echo "$(git tag -l --format='%(contents)' $TAG_NAME)" > "${{ runner.temp }}/CHANGELOG.md" + - name: Get release notes + id: release_notes + run: | + # By default, GH Actions checkout will only fetch a single commit. + # For us to extract the release notes, we need to fetch the tags + # and tag annotations as well. + # https://github.com/actions/checkout/issues/290 + git fetch --tags --force + TAG_NAME=${GITHUB_REF/refs\/tags\//} + echo "$(git tag -l --format='%(contents)' $TAG_NAME)" > "${{ runner.temp }}/CHANGELOG.md" - - name: Create GitHub release - id: create_release - uses: actions/create-release@v1 - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - with: - tag_name: ${{ github.ref }} - release_name: ${{ github.ref }} - body_path: "${{ runner.temp }}/CHANGELOG.md" - draft: false - prerelease: false + - name: Create GitHub release + id: create_release + uses: actions/create-release@v1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + tag_name: ${{ github.ref }} + release_name: ${{ github.ref }} + body_path: "${{ runner.temp }}/CHANGELOG.md" + draft: false + prerelease: false - - 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/gftools* - outputs: - zip_name: ${{ env.ZIP_NAME }} +# - 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/gftools* +# outputs: +# zip_name: ${{ env.ZIP_NAME }} +# attach: - # only run if the commit is tagged... - if: github.event_name == 'release' - # ... and it builds successfully - needs: - - build + needs: [apps, build] runs-on: ubuntu-latest env: - ZIP_NAME: ${{ needs.build.outputs.zip_name }} + ZIP_NAME: ${{ needs.apps.outputs.zip_name }} steps: - - uses: actions/checkout@v2 - - name: Download artefact files - uses: actions/download-artifact@v2 - with: - name: ${{ env.ZIP_NAME }} - path: ${{ env.ZIP_NAME }} - - name: Zip files - run: zip -r ${{ env.ZIP_NAME }}.zip ${{ env.ZIP_NAME }} - - name: Upload binaries to release - uses: svenstaro/upload-release-action@v2 - with: - repo_token: ${{ secrets.GITHUB_TOKEN }} - file: ${{ env.ZIP_NAME }}.zip - asset_name: ${{ env.ZIP_NAME }}.zip - tag: ${{ github.ref }} - overwrite: true - body: "Executable binaries" \ No newline at end of file + - uses: actions/checkout@v2 + - name: Download all artefact files + uses: actions/download-artifact@v2 + - name: Zip files + run: | + for d in *-binaries; do zip -r $d $d; done + - name: Upload binaries to release + uses: alexellis/upload-assets@0.2.2 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + asset_paths: '[" *-binaries.zip "]' \ No newline at end of file