feat: 更新发布工作流以支持大于2GB的文件分割上传,调整Dockerfile以注释掉numpy安装,修改App组件背景色,修复Ele… #31
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 | |
| on: | |
| push: | |
| tags: | |
| - "v*" | |
| workflow_dispatch: | |
| permissions: | |
| contents: write # Grant write access to repository contents | |
| jobs: | |
| build-docker-images: | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| include: | |
| - arch: amd64 | |
| runner: ubuntu-22.04 | |
| - arch: arm64 | |
| runner: ubuntu-22.04-arm | |
| runs-on: ${{ matrix.runner }} | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Set up Docker Buildx | |
| uses: docker/setup-buildx-action@v3 | |
| - name: Build sandbox Docker image for ${{ matrix.arch }} | |
| run: | | |
| cd sandbox | |
| docker buildx build \ | |
| --platform linux/${{ matrix.arch }} \ | |
| --tag e2b-sandbox:latest \ | |
| --load \ | |
| . | |
| - name: Clean up disk space | |
| run: | | |
| df -h | |
| docker image prune -f | |
| docker container prune -f | |
| docker volume prune -f | |
| sudo rm -rf /usr/share/dotnet | |
| sudo rm -rf "$AGENT_TOOLSDIRECTORY" | |
| df -h | |
| - name: Save Docker image to tar.gz | |
| run: | | |
| docker save e2b-sandbox:latest | gzip -1 > e2b-sandbox-${{ matrix.arch }}.tar.gz | |
| ls -lh e2b-sandbox-${{ matrix.arch }}.tar.gz | |
| - name: Cache Docker image | |
| uses: actions/cache/save@v4 | |
| with: | |
| path: e2b-sandbox-${{ matrix.arch }}.tar.gz | |
| key: docker-image-${{ matrix.arch }}-${{ github.run_id }} | |
| enableCrossOsArchive: true | |
| release: | |
| needs: build-docker-images | |
| continue-on-error: true | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| include: | |
| # macOS (Intel & Apple Silicon) | |
| - runner: macos-13 | |
| artifact_name: EdgeBox-macos-x64 | |
| artifact_path: | | |
| out/make/**/*.dmg | |
| out/make/**/*.zip | |
| arch: amd64 | |
| - runner: macos-14 | |
| artifact_name: EdgeBox-macos-arm64 | |
| artifact_path: | | |
| out/make/**/*.dmg | |
| out/make/**/*.zip | |
| arch: arm64 | |
| # Windows (x64 & ARM64) | |
| - runner: windows-latest | |
| artifact_name: EdgeBox-windows-x64 | |
| artifact_path: | | |
| out/make/**/*.exe | |
| out/make/**/*.msi | |
| arch: amd64 | |
| # - runner: windows-11-arm | |
| # artifact_name: EdgeBox-windows-arm64 | |
| # artifact_path: | | |
| # out/make/**/*.exe | |
| # out/make/**/*.msi | |
| # arch: arm64 | |
| # Linux (x64 & ARM64) | |
| - runner: ubuntu-22.04 | |
| artifact_name: EdgeBox-linux-x64 | |
| artifact_path: | | |
| out/make/**/*.AppImage | |
| out/make/**/*.deb | |
| out/make/**/*.rpm | |
| arch: amd64 | |
| - runner: ubuntu-22.04-arm | |
| artifact_name: EdgeBox-linux-arm64 | |
| artifact_path: | | |
| out/make/**/*.AppImage | |
| out/make/**/*.deb | |
| out/make/**/*.rpm | |
| arch: arm64 | |
| runs-on: ${{ matrix.runner }} | |
| steps: | |
| - name: Clean up disk space | |
| if: runner.os == 'Linux' | |
| run: | | |
| df -h | |
| docker image prune -f | |
| docker container prune -f | |
| docker volume prune -f | |
| sudo rm -rf /usr/share/dotnet | |
| sudo rm -rf "$AGENT_TOOLSDIRECTORY" | |
| df -h | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Install pnpm | |
| uses: pnpm/action-setup@v4 | |
| with: | |
| version: latest | |
| - name: Setup Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: "22" | |
| cache: "pnpm" | |
| - name: Install dependencies | |
| run: pnpm install --frozen-lockfile | |
| - name: Restore Docker image from cache | |
| uses: actions/cache/restore@v4 | |
| with: | |
| path: e2b-sandbox-${{ matrix.arch }}.tar.gz | |
| key: docker-image-${{ matrix.arch }}-${{ github.run_id }} | |
| enableCrossOsArchive: true | |
| - name: Create sandbox_images directory and rename Docker image | |
| shell: bash | |
| run: | | |
| mkdir -p sandbox_images | |
| mv e2b-sandbox-${{ matrix.arch }}.tar.gz sandbox_images/e2b-sandbox-latest.tar.gz | |
| - name: Make application | |
| run: pnpm run make | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Upload artifacts | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: ${{ matrix.artifact_name }} | |
| path: ${{ matrix.artifact_path }} | |
| create-release: | |
| needs: release | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Download application artifacts only | |
| uses: actions/download-artifact@v4 | |
| with: | |
| pattern: EdgeBox-* | |
| path: artifacts | |
| - name: Create Release | |
| id: create_release | |
| uses: actions/create-release@v1 | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| with: | |
| tag_name: ${{ github.ref_name }} | |
| release_name: Release ${{ github.ref_name }} | |
| draft: false | |
| prerelease: false | |
| - name: Prepare release assets with 7zip split | |
| run: | | |
| # Create release_assets directory | |
| mkdir -p release_assets | |
| # Find all files and process each one | |
| find artifacts -type f | while read artifact; do | |
| asset_name=$(basename "$artifact") | |
| echo "Processing: $asset_name" | |
| # Check file size in GB | |
| file_size_gb=$(($(stat -c%s "$artifact") / 1024 / 1024 / 1024)) | |
| if [ $file_size_gb -ge 2 ]; then | |
| echo "File larger than 2GB, splitting into volumes..." | |
| # Split into 1.9GB parts (1900MB) to stay well under 2GB limit | |
| 7z a -tzip -v1900m "release_assets/${asset_name%.*}" "$artifact" > /dev/null | |
| echo "Created parts:" | |
| ls -la "release_assets/${asset_name%.*}".* | |
| else | |
| echo "File is under 2GB, copying directly" | |
| cp "$artifact" "release_assets/" | |
| fi | |
| done | |
| - name: Upload Release Assets | |
| run: | | |
| find release_assets -type f | while read asset; do | |
| echo "Uploading $(basename "$asset")" | |
| gh release upload "${{ github.ref_name }}" "$asset" --clobber --repo "${{ github.repository }}" | |
| done | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |