From 78d15a9787e0220b046ff39324da5af950e2c17f Mon Sep 17 00:00:00 2001 From: jeandemanged Date: Mon, 11 Nov 2024 00:01:52 +0100 Subject: [PATCH] Release CI (#2) Signed-off-by: Damien Jeandemange --- .github/workflows/ci.yml | 9 +++++++++ yagat.spec | 6 +++++- 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index c9e3bbf..9d083b4 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -9,6 +9,9 @@ on: required: true default: false type: boolean + release: + types: + - published permissions: { } @@ -67,3 +70,9 @@ jobs: with: name: yagat-${{ matrix.os }} path: dist/yagat* + + - name: Upload release package + if: ${{ github.event_name == 'release' }} + uses: softprops/action-gh-release@v2.0.9 + with: + files: yagat_*_.zip diff --git a/yagat.spec b/yagat.spec index 6c541ec..e75b16b 100644 --- a/yagat.spec +++ b/yagat.spec @@ -7,6 +7,7 @@ # SPDX-License-Identifier: MPL-2.0 # import platform +import shutil import sys sys.path.append('./') @@ -52,6 +53,7 @@ exe = EXE( codesign_identity=None, entitlements_file=None, ) +release_name=f'yagat_{__version__}_{platform.system()}' coll = COLLECT( exe, a.binaries, @@ -59,5 +61,7 @@ coll = COLLECT( strip=False, upx=True, upx_exclude=[], - name=f'yagat_{__version__}_{platform.system()}', + name=release_name, ) +print(f'Zipping release into {release_name}.zip') +shutil.make_archive(f'{release_name}', 'zip', f'dist/{release_name}')