Skip to content

Release

Release #25

Workflow file for this run

name: Release
on:
push:
tags:
- "v*"
workflow_dispatch:
permissions:
contents: write # Grant write access to repository contents
jobs:
build-docker-images:
if: false
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: Upload Release Assets
run: |
find artifacts -type f | while read artifact; do
asset_name=$(basename "$artifact")
echo "Uploading $asset_name"
gh release upload "${{ github.ref_name }}" "$artifact" --clobber --repo "${{ github.repository }}"
done
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}