Skip to content

fix(ci): temporarily disable macOS Intel build due to billing limits #75

fix(ci): temporarily disable macOS Intel build due to billing limits

fix(ci): temporarily disable macOS Intel build due to billing limits #75

Workflow file for this run

name: Desktop Builds
on:
push:
branches: [ main ]
tags:
- 'v*.*.*'
paths-ignore:
- '**.md'
- 'docs/**'
pull_request:
paths:
- 'frontend/**'
- 'cmd/network-debugger/**'
- 'cmd/network-debugger-web/**'
- 'internal/**'
- 'scripts/package-*.sh'
- 'scripts/package-*.ps1'
- '.github/workflows/build-desktop.yml'
workflow_dispatch:
permissions:
contents: write
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
build-macos:
strategy:
matrix:
include:
# Temporarily disabled x86_64 build due to GitHub Actions billing limits
# - arch: x86_64
# runner: macos-15-large # Intel runner (macos-13 is deprecated)
- arch: arm64
runner: macos-latest # Apple Silicon runner
runs-on: ${{ matrix.runner }}
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Go
uses: actions/setup-go@v5
with:
go-version: '1.22.x'
- name: Setup Flutter
uses: subosito/flutter-action@v2
with:
flutter-version: '3.x'
channel: 'stable'
- name: Install create-dmg
run: brew install create-dmg
- name: Cache Flutter dependencies
uses: actions/cache@v4
with:
path: |
~/.pub-cache
frontend/.dart_tool
key: ${{ runner.os }}-${{ matrix.arch }}-flutter-${{ hashFiles('frontend/pubspec.lock') }}
restore-keys: |
${{ runner.os }}-${{ matrix.arch }}-flutter-
- name: Cache Go modules
uses: actions/cache@v4
with:
path: ~/go/pkg/mod
key: ${{ runner.os }}-${{ matrix.arch }}-go-${{ hashFiles('go.sum') }}
restore-keys: |
${{ runner.os }}-${{ matrix.arch }}-go-
- name: Flutter pub get
working-directory: frontend
run: flutter pub get
- name: Enable macOS desktop
working-directory: frontend
run: |
flutter config --enable-macos-desktop
flutter create --platforms=macos .
- name: Set version
id: version
run: |
if [[ "${{ github.ref }}" == refs/tags/v* ]]; then
echo "VERSION=${GITHUB_REF#refs/tags/v}" >> $GITHUB_OUTPUT
else
echo "VERSION=dev-${GITHUB_SHA::7}" >> $GITHUB_OUTPUT
fi
- name: Build macOS DMG
env:
VERSION: ${{ steps.version.outputs.VERSION }}
run: |
chmod +x scripts/package-macos.sh
./scripts/package-macos.sh
- name: Upload DMG artifact
uses: actions/upload-artifact@v4
with:
name: macos-${{ matrix.arch }}-dmg
path: dist/*.dmg
retention-days: 7
# Временно отключили windows-сборку
# Windows builds moved to separate workflow: build-windows.yml
# This allows independent execution and better CI/CD organization
build-linux:
runs-on: ubuntu-latest
strategy:
matrix:
arch: [amd64]
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Go
uses: actions/setup-go@v5
with:
go-version: '1.22.x'
- name: Setup Flutter
uses: subosito/flutter-action@v2
with:
flutter-version: '3.x'
channel: 'stable'
- name: Install Linux dependencies
run: |
sudo apt-get update
sudo apt-get install -y \
clang cmake ninja-build pkg-config \
libgtk-3-dev liblzma-dev \
libstdc++-12-dev libsecret-1-dev
- name: Cache Flutter dependencies
uses: actions/cache@v4
with:
path: |
~/.pub-cache
frontend/.dart_tool
key: ${{ runner.os }}-flutter-${{ hashFiles('frontend/pubspec.lock') }}
restore-keys: |
${{ runner.os }}-flutter-
- name: Cache Go modules
uses: actions/cache@v4
with:
path: ~/go/pkg/mod
key: ${{ runner.os }}-go-${{ hashFiles('go.sum') }}
restore-keys: |
${{ runner.os }}-go-
- name: Flutter pub get
working-directory: frontend
run: flutter pub get
- name: Enable Linux desktop
working-directory: frontend
run: |
flutter config --enable-linux-desktop
flutter create --platforms=linux .
- name: Set version
id: version
run: |
if [[ "${{ github.ref }}" == refs/tags/v* ]]; then
echo "VERSION=${GITHUB_REF#refs/tags/v}" >> $GITHUB_OUTPUT
else
echo "VERSION=dev-${GITHUB_SHA::7}" >> $GITHUB_OUTPUT
fi
- name: Build Linux packages
env:
VERSION: ${{ steps.version.outputs.VERSION }}
ARCH: ${{ matrix.arch }}
run: |
chmod +x scripts/package-linux.sh
./scripts/package-linux.sh
- name: Upload tar.gz artifact
uses: actions/upload-artifact@v4
with:
name: linux-${{ matrix.arch }}-tar
path: dist/*.tar.gz
retention-days: 7
- name: Upload deb artifact
uses: actions/upload-artifact@v4
if: hashFiles('dist/*.deb') != ''
with:
name: linux-${{ matrix.arch }}-deb
path: dist/*.deb
retention-days: 7
build-web:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Go
uses: actions/setup-go@v5
with:
go-version: '1.22.x'
- name: Setup Flutter
uses: subosito/flutter-action@v2
with:
flutter-version: '3.x'
channel: 'stable'
- name: Cache Flutter dependencies
uses: actions/cache@v4
with:
path: |
~/.pub-cache
frontend/.dart_tool
key: ${{ runner.os }}-flutter-${{ hashFiles('frontend/pubspec.lock') }}
restore-keys: |
${{ runner.os }}-flutter-
- name: Cache Go modules
uses: actions/cache@v4
with:
path: ~/go/pkg/mod
key: ${{ runner.os }}-go-${{ hashFiles('go.sum') }}
restore-keys: |
${{ runner.os }}-go-
- name: Flutter pub get
working-directory: frontend
run: flutter pub get
- name: Set version
id: version
run: |
if [[ "${{ github.ref }}" == refs/tags/v* ]]; then
echo "VERSION=${GITHUB_REF#refs/tags/v}" >> $GITHUB_OUTPUT
else
echo "VERSION=dev-${GITHUB_SHA::7}" >> $GITHUB_OUTPUT
fi
- name: Build Flutter web
working-directory: frontend
run: flutter build web --release --no-tree-shake-icons --no-wasm-dry-run
- name: Copy web files to embed directory
run: |
rm -rf cmd/network-debugger-web/_web
mkdir -p cmd/network-debugger-web/_web
cp -R frontend/build/web/* cmd/network-debugger-web/_web/
- name: Build Go binaries with embedded web
env:
VERSION: ${{ steps.version.outputs.VERSION }}
run: |
mkdir -p dist
# Build for all platforms
echo "Building for darwin/amd64..."
GOOS=darwin GOARCH=amd64 go build -ldflags="-s -w" \
-o dist/network-debugger-web_darwin_amd64 ./cmd/network-debugger-web
echo "Building for darwin/arm64..."
GOOS=darwin GOARCH=arm64 go build -ldflags="-s -w" \
-o dist/network-debugger-web_darwin_arm64 ./cmd/network-debugger-web
echo "Building for linux/amd64..."
GOOS=linux GOARCH=amd64 go build -ldflags="-s -w" \
-o dist/network-debugger-web_linux_amd64 ./cmd/network-debugger-web
echo "Building for linux/arm64..."
GOOS=linux GOARCH=arm64 go build -ldflags="-s -w" \
-o dist/network-debugger-web_linux_arm64 ./cmd/network-debugger-web
echo "Building for windows/amd64..."
GOOS=windows GOARCH=amd64 go build -ldflags="-s -w" \
-o dist/network-debugger-web_windows_amd64.exe ./cmd/network-debugger-web
echo "Building for windows/386..."
GOOS=windows GOARCH=386 go build -ldflags="-s -w" \
-o dist/network-debugger-web_windows_386.exe ./cmd/network-debugger-web
echo "Building for windows/arm64..."
GOOS=windows GOARCH=arm64 go build -ldflags="-s -w" \
-o dist/network-debugger-web_windows_arm64.exe ./cmd/network-debugger-web
- name: Create archives
working-directory: dist
run: |
# Create tar.gz for unix platforms
tar -czf network-debugger-web_darwin_amd64.tar.gz network-debugger-web_darwin_amd64
tar -czf network-debugger-web_darwin_arm64.tar.gz network-debugger-web_darwin_arm64
tar -czf network-debugger-web_linux_amd64.tar.gz network-debugger-web_linux_amd64
tar -czf network-debugger-web_linux_arm64.tar.gz network-debugger-web_linux_arm64
# Create zip for Windows
zip network-debugger-web_windows_amd64.zip network-debugger-web_windows_amd64.exe
zip network-debugger-web_windows_386.zip network-debugger-web_windows_386.exe
zip network-debugger-web_windows_arm64.zip network-debugger-web_windows_arm64.exe
# List all archives
ls -lah *.tar.gz *.zip
- name: Upload web artifacts
uses: actions/upload-artifact@v4
with:
name: web-binaries
path: |
dist/*.tar.gz
dist/*.zip
retention-days: 7
# Windows desktop build - calls separate workflow
build-windows:
uses: ./.github/workflows/build-windows.yml
# Release job - only runs on version tags
release:
needs: [build-macos, build-linux, build-web, build-windows]
runs-on: ubuntu-latest
if: startsWith(github.ref, 'refs/tags/v')
permissions:
contents: write
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Download all artifacts
uses: actions/download-artifact@v4
with:
path: artifacts
- name: Prepare release files
run: |
mkdir -p release
find artifacts -type f \( -name "*.dmg" -o -name "*.zip" -o -name "*.tar.gz" -o -name "*.deb" \) -exec cp {} release/ \;
ls -lah release/
- name: Extract version
id: version
run: echo "VERSION=${GITHUB_REF#refs/tags/v}" >> $GITHUB_OUTPUT
- name: Generate changelog
id: changelog
run: |
echo "## What's Changed" > CHANGELOG.md
echo "" >> CHANGELOG.md
git log $(git describe --tags --abbrev=0 HEAD^)..HEAD --pretty=format:"- %s (%h)" >> CHANGELOG.md || echo "- Initial release" >> CHANGELOG.md
- name: Create GitHub Release
uses: softprops/action-gh-release@v2
with:
files: release/*
body_path: CHANGELOG.md
draft: false
prerelease: false
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# Summary job
summary:
needs: [build-macos, build-linux, build-web, build-windows]
runs-on: ubuntu-latest
if: always()
steps:
- name: Build Summary
run: |
echo "## Desktop Build Summary" >> $GITHUB_STEP_SUMMARY
echo "" >> $GITHUB_STEP_SUMMARY
echo "| Platform | Status |" >> $GITHUB_STEP_SUMMARY
echo "|----------|--------|" >> $GITHUB_STEP_SUMMARY
echo "| macOS Desktop | ${{ needs.build-macos.result }} |" >> $GITHUB_STEP_SUMMARY
echo "| Linux Desktop | ${{ needs.build-linux.result }} |" >> $GITHUB_STEP_SUMMARY
echo "| Windows Desktop | ${{ needs.build-windows.result }} |" >> $GITHUB_STEP_SUMMARY
echo "| Web Binaries | ${{ needs.build-web.result }} |" >> $GITHUB_STEP_SUMMARY