From bb433e5b2bd0d81ac1e1b168e4c785712f6cb158 Mon Sep 17 00:00:00 2001 From: jziolkowski Date: Tue, 17 Sep 2024 02:51:37 +0200 Subject: [PATCH] update CI --- .github/workflows/release.yml | 140 +++++++++++++++------------------- 1 file changed, 63 insertions(+), 77 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index c46904a..7b7bc77 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -1,90 +1,76 @@ name: GitHub release on: - workflow_dispatch: - push: - branches: - - master - - develop - paths-ignore: - - '.github/**' - - '**.md' + workflow_dispatch: + push: + branches: + - master + - develop + paths-ignore: + - '.github/**' + - '**.md' jobs: - Binaries: - runs-on: ${{ matrix.os }} - outputs: - version-tag: ${{ steps.version_tag.outputs.VERSION_TAG }} - strategy: - fail-fast: false - matrix: - include: - - os: windows-2019 - arch: x86 - - os: windows-2019 - arch: x64 - - os: macos-13 - arch: x64 + Binaries: + runs-on: ${{ matrix.os }} + outputs: + version-tag: ${{ steps.version_tag.outputs.VERSION_TAG }} + strategy: + fail-fast: false + matrix: + include: + - os: windows-2019 + arch: x86 + - os: windows-2019 + arch: x64 + - os: macos-13 + arch: x64 - steps: - - uses: actions/checkout@v3 - with: - fetch-depth: 0 - - name: Set up Python 3.8 - uses: actions/setup-python@v4 - with: - python-version: '3.8' - architecture: ${{ matrix.arch }} + steps: + - uses: actions/checkout@v3 + with: + fetch-depth: 0 + - name: Set up Python 3.8 + uses: actions/setup-python@v4 + with: + python-version: '3.8' + architecture: ${{ matrix.arch }} - - name: Install PyInstaller - run: pip install -r requirements_build.txt + - name: Install PyInstaller + run: pip install -r requirements_build.txt - - name: Retrieve version tag - id: version_tag - shell: bash - run: echo "VERSION_TAG=$(python -m setuptools_scm)" >> $GITHUB_OUTPUT + - name: Retrieve version tag + id: version_tag + shell: bash + run: echo "VERSION_TAG=$(python -m setuptools_scm)" >> $GITHUB_OUTPUT - - name: Build with PyInstaller - run: pyinstaller --noconfirm --clean tdmgr.spec + - name: Build with PyInstaller + run: pyinstaller --noconfirm --clean tdmgr.spec - - name: Upload binaries artifact to workflow - uses: actions/upload-artifact@v3 - with: - name: tdmgr - path: dist/* + - name: Upload binaries artifact to workflow + uses: actions/upload-artifact@v3 + with: + name: tdmgr + path: dist/* - Draft-Release: - runs-on: ubuntu-latest - needs: Binaries - env: - VERSION_TAG: ${{ needs.Binaries.outputs.version-tag }} - steps: - - uses: actions/checkout@v3 - - # Create a draft release - - name: Create Draft Release - id: create_release - uses: actions/create-release@v1 + Draft-Release: + runs-on: ubuntu-latest + needs: Binaries env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - with: - tag_name: ${{ env.VERSION_TAG }} - release_name: TDM ${{ env.VERSION_TAG }} - draft: ${{ github.ref_name != 'refs/heads/develop'}} - prerelease: ${{ github.ref_name == 'refs/heads/develop'}} - + VERSION_TAG: ${{ needs.Binaries.outputs.version-tag }} + steps: + - name: Download artifacts from build + uses: actions/download-artifact@v3 - - name: Download artifacts from build - uses: actions/download-artifact@v3 - with: - path: dist - - # Upload release assets: each file in `dist/` to the GitHub Release - - name: Upload Release Assets - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - run: | - for asset in dist/tdmgr/*; do - echo "Uploading asset: $asset" - gh release upload ${{ env.VERSION_TAG }} "$asset" --clobber - done + - name: Create Draft Release + id: create_release + uses: softprops/action-gh-release@v2 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + tag_name: ${{ env.VERSION_TAG }} + name: TDM ${{ env.VERSION_TAG }} + draft: true + prerelease: ${{ github.ref_name == 'refs/heads/develop'}} + generate_release_notes: true + files: tdmgr/*