From 97023cd0e4733eb66a40aac7460f3986b72fa140 Mon Sep 17 00:00:00 2001 From: kokodev Date: Thu, 28 Nov 2024 18:31:41 -0800 Subject: [PATCH] Update main.yml --- .github/workflows/main.yml | 61 ++++++++++++++++++++++---------------- 1 file changed, 35 insertions(+), 26 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index ea66f55..c41bdf5 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -25,13 +25,19 @@ jobs: run: | pyinstaller --onefile commitify.py + - name: List files after build (Linux) + run: | + ls dist/ + - name: Move Linux executable run: | mv dist/commitify ./commitify-linux - - name: List files after build (Linux) - run: | - ls -al + - name: Upload Linux artifact + uses: actions/upload-artifact@v4 # Updated to v4 + with: + name: linux-executable + path: commitify-linux # Ensure this matches the moved file's name build-windows: runs-on: windows-latest @@ -51,13 +57,19 @@ jobs: run: | pyinstaller --onefile commitify.py + - name: List files after build (Windows) + run: | + dir dist + - name: Move Windows executable run: | move dist\commitify.exe commitify.exe # Just rename to commitify.exe - - name: List files after build (Windows) - run: | - dir + - name: Upload Windows artifact + uses: actions/upload-artifact@v4 # Updated to v4 + with: + name: windows-executable + path: commitify.exe # Ensure this matches the moved file's name build-macos: runs-on: macos-latest @@ -77,13 +89,19 @@ jobs: run: | pyinstaller --onefile commitify.py + - name: List files after build (macOS) + run: | + ls dist/ + - name: Move macOS executable run: | mv dist/commitify ./commitify # No suffix for macOS - - name: List files after build (macOS) - run: | - ls -al + - name: Upload macOS artifact + uses: actions/upload-artifact@v4 # Updated to v4 + with: + name: macos-executable + path: commitify # Ensure this matches the moved file's name release: needs: [build-linux, build-windows, build-macos] @@ -92,23 +110,14 @@ jobs: - name: Checkout code for release job uses: actions/checkout@v3 - # Install GitHub CLI - - name: Install GitHub CLI - run: sudo apt-get install gh # For Ubuntu; adjust for other OS if needed. - - # Authenticate with GITHUB_TOKEN - - name: Authenticate with GitHub CLI - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - run: gh auth login --with-token <<< "$GITHUB_TOKEN" - - # Upload Release Assets using GitHub CLI + # Debugging step to list all files before release upload. + - name: List files before release upload + run: ls -al + - name: Upload Release Assets + uses: softprops/action-gh-release@v1 # GitHub Action to create a release. + with: + tag_name: ${{ github.event.release.tag_name }} + files: linux-executable, windows-executable, macos-executable # Ensure these names match exactly. env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - run: | - gh release upload ${{ github.event.release.tag_name }} \ - commitify-linux \ - commitify.exe \ - commitify \ - --clobber # Use --clobber to overwrite existing files if necessary.