From 6e4ee41514ab4fd437c1e35e02385713e95b97b8 Mon Sep 17 00:00:00 2001 From: kokodev Date: Thu, 28 Nov 2024 21:44:24 -0800 Subject: [PATCH] Update main.yml --- .github/workflows/main.yml | 61 ++++++++++++++++---------------------- 1 file changed, 26 insertions(+), 35 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 3671cc8..ea66f55 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -25,19 +25,13 @@ 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: 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 + - name: List files after build (Linux) + run: | + ls -al build-windows: runs-on: windows-latest @@ -57,19 +51,13 @@ 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: 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 + - name: List files after build (Windows) + run: | + dir build-macos: runs-on: macos-latest @@ -89,19 +77,13 @@ 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: 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 + - name: List files after build (macOS) + run: | + ls -al release: needs: [build-linux, build-windows, build-macos] @@ -110,14 +92,23 @@ jobs: - name: Checkout code for release job uses: actions/checkout@v3 - # Debugging step to list all files before release upload. - - name: List files before release upload - run: ls -al - + # 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 - 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: commitify-linux, commitify.exe, commitify # 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.