v2.3.9 #135
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: Release | |
| permissions: | |
| contents: write | |
| packages: write | |
| on: | |
| push: | |
| tags: | |
| - 'v*' | |
| jobs: | |
| pre-clean: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Delete existing release by tag | |
| uses: actions/github-script@v7 | |
| env: | |
| TAG_NAME: ${{ github.ref_name }} | |
| with: | |
| script: | | |
| const tag = process.env.TAG_NAME | |
| const { owner, repo } = context.repo | |
| try { | |
| const release = await github.rest.repos.getReleaseByTag({ owner, repo, tag }) | |
| await github.rest.repos.deleteRelease({ owner, repo, release_id: release.data.id }) | |
| } catch (e) { | |
| core.info(`skip delete: ${e.message}`) | |
| } | |
| build-and-release: | |
| needs: pre-clean | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| os: [ubuntu-latest, windows-latest, macos-latest] | |
| runs-on: ${{ matrix.os }} | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Setup Node | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: '16' | |
| cache: 'npm' | |
| - name: Install dependencies | |
| run: npm install --legacy-peer-deps | |
| - name: Install fpm (Linux) | |
| if: matrix.os == 'ubuntu-latest' | |
| run: | | |
| sudo apt-get update | |
| sudo apt-get install -y ruby ruby-dev rubygems build-essential | |
| sudo gem install fpm | |
| - name: Build webpack bundles | |
| run: npm run build:github | |
| env: | |
| NODE_ENV: 'production' | |
| - name: Verify build output | |
| shell: bash | |
| run: | | |
| echo "Checking dist/electron directory..." | |
| ls -la dist/electron/ 2>/dev/null || dir dist\\electron\\ || echo "Directory listing failed" | |
| echo "" | |
| echo "Checking for main.js..." | |
| if [ -f "dist/electron/main.js" ]; then | |
| SIZE=$(stat -f%z dist/electron/main.js 2>/dev/null || stat -c%s dist/electron/main.js 2>/dev/null || echo "unknown") | |
| echo "✓ main.js found ($SIZE bytes)" | |
| else | |
| echo "✗ main.js not found" | |
| echo "Contents of dist directory:" | |
| find dist -type f 2>/dev/null || echo "find command failed" | |
| exit 1 | |
| fi | |
| echo "" | |
| echo "Checking for index.js (renderer)..." | |
| if [ -f "dist/electron/index.js" ]; then | |
| SIZE=$(stat -f%z dist/electron/index.js 2>/dev/null || stat -c%s dist/electron/index.js 2>/dev/null || echo "unknown") | |
| echo "✓ index.js found ($SIZE bytes)" | |
| else | |
| echo "✗ index.js not found" | |
| echo "Contents of dist/electron directory:" | |
| find dist/electron -type f 2>/dev/null || echo "find command failed" | |
| exit 1 | |
| fi | |
| echo "" | |
| echo "✓ Build verification passed!" | |
| - name: Build and publish with electron-builder | |
| env: | |
| GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| CSC_IDENTITY_AUTO_DISCOVERY: 'false' | |
| SKIP_NOTARIZE: 'true' | |
| DEBUG: 'electron-builder' | |
| run: | | |
| echo "Starting electron-builder..." | |
| npx electron-builder --publish onTagOrDraft 2>&1 | tee electron-builder.log | |
| EXIT_CODE=${PIPESTATUS[0]} | |
| if [ $EXIT_CODE -ne 0 ]; then | |
| echo "" | |
| echo "❌ electron-builder failed with exit code $EXIT_CODE" | |
| echo "" | |
| echo "Checking if app.asar was created..." | |
| if [ -f "release/mac/LinkCore Download Manager.app/Contents/Resources/app.asar" ]; then | |
| echo "app.asar exists, checking contents..." | |
| npx asar list "release/mac/LinkCore Download Manager.app/Contents/Resources/app.asar" | head -50 | |
| elif [ -f "release/win-unpacked/resources/app.asar" ]; then | |
| echo "app.asar exists (Windows), checking contents..." | |
| npx asar list "release/win-unpacked/resources/app.asar" | head -50 | |
| elif [ -f "release/linux-unpacked/resources/app.asar" ]; then | |
| echo "app.asar exists (Linux), checking contents..." | |
| npx asar list "release/linux-unpacked/resources/app.asar" | head -50 | |
| else | |
| echo "app.asar not found" | |
| fi | |
| echo "" | |
| echo "Last 50 lines of output:" | |
| tail -n 50 electron-builder.log | |
| exit $EXIT_CODE | |
| fi | |
| shell: bash | |
| - name: Upload build logs on failure | |
| if: failure() | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: build-logs-${{ matrix.os }} | |
| path: | | |
| electron-builder.log | |
| *.log | |
| retention-days: 7 |