Simplify release creation: remove gh CLI check #6
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Build Release | |
| on: | |
| push: | |
| tags: | |
| - 'v*' # Триггер на теги вида v1.0.0, v1.2.3 и т.д. | |
| jobs: | |
| build: | |
| runs-on: ${{ matrix.os }} | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| os: [macos-latest, windows-latest, ubuntu-latest] | |
| include: | |
| - os: macos-latest | |
| platform: mac | |
| - os: windows-latest | |
| platform: win | |
| - os: ubuntu-latest | |
| platform: linux | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Setup Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: '20' | |
| cache: 'npm' | |
| - name: Install system dependencies (Linux) | |
| if: matrix.os == 'ubuntu-latest' | |
| run: | | |
| sudo apt-get update | |
| sudo apt-get install -y libnss3-dev libatk-bridge2.0-dev libdrm2 libxkbcommon-dev libxcomposite-dev libxdamage-dev libxrandr-dev libgbm-dev libxss1 libasound2-dev | |
| - name: Install dependencies | |
| run: npm ci | |
| - name: Build extensions | |
| run: npm run build:extensions || echo "build-extensions.js not found, skipping" | |
| - name: Build renderer | |
| run: npm run build:renderer | |
| - name: Build application | |
| continue-on-error: false | |
| run: npm run build:${{ matrix.platform }} | |
| env: | |
| # Для macOS подпись (если нужна) | |
| CSC_IDENTITY_AUTO_DISCOVERY: false | |
| # Отключаем автоматическую публикацию electron-builder | |
| GH_TOKEN: "" | |
| # Для Windows подпись (если нужна) | |
| # CSC_LINK: ${{ secrets.WINDOWS_CERT }} | |
| # CSC_KEY_PASSWORD: ${{ secrets.WINDOWS_CERT_PASSWORD }} | |
| - name: List release files (Unix) | |
| if: matrix.os != 'windows-latest' | |
| shell: bash | |
| run: | | |
| echo "=== Release directory structure ===" | |
| find release -type f \( -name "*.dmg" -o -name "*.exe" -o -name "*.AppImage" -o -name "*.deb" -o -name "*.zip" \) 2>/dev/null | head -20 || echo "No files found" | |
| echo "=== All files in release ===" | |
| ls -la release/ 2>/dev/null || echo "Directory not found or empty" | |
| - name: List release files (Windows) | |
| if: matrix.os == 'windows-latest' | |
| shell: pwsh | |
| run: | | |
| Write-Host "=== Release directory structure ===" | |
| Get-ChildItem -Path release -Recurse -File -Include *.dmg,*.exe,*.AppImage,*.deb,*.zip -ErrorAction SilentlyContinue | Select-Object -First 20 | ForEach-Object { $_.FullName } | |
| Write-Host "=== All files in release ===" | |
| Get-ChildItem -Path release -ErrorAction SilentlyContinue | Format-Table Name, Length, LastWriteTime | |
| - name: Upload artifacts | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: ${{ matrix.platform }}-builds | |
| path: | | |
| release/*.dmg | |
| release/*.exe | |
| release/*.AppImage | |
| release/*.deb | |
| release/*.zip | |
| release/**/*.dmg | |
| release/**/*.exe | |
| release/**/*.AppImage | |
| release/**/*.deb | |
| release/**/*.zip | |
| if-no-files-found: warn | |
| retention-days: 30 | |
| release: | |
| needs: build | |
| runs-on: ubuntu-latest | |
| if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v') | |
| continue-on-error: true | |
| permissions: | |
| contents: write | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Download all artifacts | |
| uses: actions/download-artifact@v4 | |
| with: | |
| path: release-artifacts | |
| - name: Extract version from tag | |
| id: tag_version | |
| run: echo "VERSION=${GITHUB_REF#refs/tags/v}" >> $GITHUB_OUTPUT | |
| - name: List downloaded artifacts | |
| run: | | |
| echo "=== Downloaded artifacts structure ===" | |
| find release-artifacts -type f | head -20 | |
| - name: Prepare release files | |
| run: | | |
| # Создаем директорию для финальных файлов | |
| mkdir -p release-files | |
| # Копируем все найденные файлы в корень | |
| find release-artifacts -type f \( -name "*.dmg" -o -name "*.exe" -o -name "*.AppImage" -o -name "*.deb" -o -name "*.zip" \) -exec cp {} release-files/ \; | |
| # Показываем что нашли | |
| echo "=== Files prepared for release ===" | |
| ls -lh release-files/ || echo "No files found" | |
| - name: Create Release | |
| uses: softprops/action-gh-release@v1 | |
| with: | |
| tag_name: ${{ github.ref_name }} | |
| name: Release ${{ steps.tag_version.outputs.VERSION }} | |
| body: | | |
| ## LinkShelf ${{ steps.tag_version.outputs.VERSION }} | |
| ### Downloads | |
| - **macOS**: DMG installer | |
| - **Windows**: NSIS installer and portable version | |
| - **Linux**: AppImage and DEB package | |
| ### Changes | |
| See [commits](https://github.com/${{ github.repository }}/compare/${{ github.event.before }}...${{ github.sha }}) | |
| files: | | |
| release-files/* | |
| draft: false | |
| prerelease: false | |
| fail_on_unmatched_files: false | |
| generate_release_notes: false | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |