diff options
-rw-r--r-- | .github/workflows/bun-linux-build.yml | 135 | ||||
-rw-r--r-- | .github/workflows/bun-mac-aarch64.yml | 332 | ||||
-rw-r--r-- | .github/workflows/bun-mac-x64-baseline.yml | 332 | ||||
-rw-r--r-- | .github/workflows/bun-mac-x64.yml | 332 | ||||
-rw-r--r-- | .github/workflows/bun.yml | 756 |
5 files changed, 1456 insertions, 431 deletions
diff --git a/.github/workflows/bun-linux-build.yml b/.github/workflows/bun-linux-build.yml new file mode 100644 index 000000000..2959c4ce9 --- /dev/null +++ b/.github/workflows/bun-linux-build.yml @@ -0,0 +1,135 @@ +name: bun-linux +env: + REGISTRY: ghcr.io + IMAGE_NAME: ${{ github.repository }} + TEST_TAG: bun-test' + +on: + push: + branches: [main, bun-actions] + paths: + - "src/**/*" + - "test/**/*" + - "build.zig" + - "Makefile" + - "Dockerfile" + pull_request: + branches: [main] + paths: + - "src/**/*" + - "test/**/*" + - "build.zig" + - "Makefile" + - "Dockerfile" + # Allows you to run this workflow manually from the Actions tab + workflow_dispatch: + +jobs: + linux: + name: ${{matrix.tag}} + runs-on: ${{matrix.runner}} + timeout-minutes: 90 + strategy: + matrix: + include: + - cpu: haswell + tag: linux-x64 + arch: x86_64 + build_arch: amd64 + runner: linux-amd64 + - cpu: sandybridge + tag: linux-x64-baseline + arch: x86_64 + build_arch: amd64 + runner: linux-amd64 + - cpu: native + tag: linux-aarch64 + arch: aarch64 + build_arch: arm64 + runner: linux-arm64 + + steps: + - uses: actions/checkout@v3 + - name: Checkout submodules + run: git -c submodule."src/bun.js/WebKit".update=none submodule update --init --recursive --depth=1 --progress -j $(nproc) + - uses: docker/setup-buildx-action@v2 + id: buildx + with: + install: true + - name: Run + run: | + rm -rf ${{runner.temp}}/release + - name: Login to GitHub Container Registry + uses: docker/login-action@v2 + with: + registry: ghcr.io + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + - name: Build and push + uses: docker/build-push-action@v3 + with: + context: . + push: false + tags: ghcr.io/oven-sh/bun:canary,ghcr.io/oven-sh/bun:${{github.sha}} + cache-from: type=registry,ref=ghcr.io/oven-sh/bun:buildcache-${{matrix.cpu}}-${{matrix.build_arch}} + cache-to: type=registry,ref=ghcr.io/oven-sh/bun:buildcache-${{matrix.cpu}}-${{matrix.build_arch}},mode=max + build-args: | + ARCH=${{matrix.arch}} + BUILDARCH=${{matrix.build_arch}} + CPU_TARGET=${{matrix.cpu}} + platforms: linux/${{matrix.build_arch}} + target: artifact + outputs: type=local,dest=${{runner.temp}}/release + - name: Zip + run: | + # if zip is not found + if [ ! -x "$(command -v zip)" ]; then + sudo apt-get update && sudo apt-get install -y zip --no-install-recommends + fi + + if [ ! -x "$(command -v strip)" ]; then + sudo apt-get update && sudo apt-get install -y binutils --no-install-recommends + fi + + cd ${{runner.temp}}/release + chmod +x bun-profile bun + + mkdir bun-${{matrix.tag}}-profile + mkdir bun-${{matrix.tag}} + + strip bun + + mv bun-profile bun-${{matrix.tag}}-profile/bun-profile + mv bun bun-${{matrix.tag}}/bun + + zip -r bun-${{matrix.tag}}-profile.zip bun-${{matrix.tag}}-profile + zip -r bun-${{matrix.tag}}.zip bun-${{matrix.tag}} + - uses: actions/upload-artifact@v3 + with: + name: bun-${{matrix.tag}}-profile + path: ${{runner.temp}}/release/bun-${{matrix.tag}}-profile.zip + - uses: actions/upload-artifact@v3 + with: + name: bun-${{matrix.tag}} + path: ${{runner.temp}}/release/bun-${{matrix.tag}}.zip + - name: Release + id: release + uses: softprops/action-gh-release@v1 + if: github.ref == 'refs/heads/main' + with: + prerelease: true + generate_release_notes: true + body: "This is the canary release of Bun that corresponds to the commit [${{ github.sha }}]" + name: "Canary (${{github.sha}})" + tag_name: "canary" + files: | + ${{runner.temp}}/release/bun-${{matrix.tag}}.zip + ${{runner.temp}}/release/bun-${{matrix.tag}}-profile.zip + - uses: actions/upload-artifact@v3 + with: + name: bun-obj-${{matrix.tag}} + path: ${{runner.temp}}/release/bun-obj + - uses: actions/upload-artifact@v3 + with: + name: ${{matrix.tag}}-dependencies + path: ${{runner.temp}}/release/bun-dependencies diff --git a/.github/workflows/bun-mac-aarch64.yml b/.github/workflows/bun-mac-aarch64.yml new file mode 100644 index 000000000..82f985401 --- /dev/null +++ b/.github/workflows/bun-mac-aarch64.yml @@ -0,0 +1,332 @@ +name: bun-macOS-aarch64 +env: + REGISTRY: ghcr.io + IMAGE_NAME: ${{ github.repository }} + TEST_TAG: bun-test' + +on: + push: + branches: [main, bun-actions] + paths: + - "src/**/*" + - "test/**/*" + - "build.zig" + - "Makefile" + - "Dockerfile" + pull_request: + branches: [main] + paths: + - "src/**/*" + - "test/**/*" + - "build.zig" + - "Makefile" + - "Dockerfile" + # Allows you to run this workflow manually from the Actions tab + workflow_dispatch: + +jobs: + macos-object-files: + name: macOS Object + runs-on: linux-amd64 + strategy: + matrix: + include: + # - cpu: sandybridge + # arch: x86_64 + # tag: bun-obj-darwin-x64-baseline + # - cpu: haswell + # arch: x86_64 + # tag: bun-obj-darwin-x64 + - cpu: native + arch: aarch64 + tag: bun-obj-darwin-aarch64 + steps: + - uses: actions/checkout@v3 + - name: Checkout submodules + run: git -c submodule."src/bun.js/WebKit".update=none submodule update --init --recursive --depth=1 --progress -j $(nproc) + - uses: docker/setup-buildx-action@v2 + id: buildx + with: + install: true + - name: Run + run: | + rm -rf ${{runner.temp}}/release + - name: Login to GitHub Container Registry + uses: docker/login-action@v2 + with: + registry: ghcr.io + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + - name: Build and push + uses: docker/build-push-action@v3 + with: + context: . + push: false + tags: ghcr.io/oven-sh/bun:canary,ghcr.io/oven-sh/bun:${{github.sha}} + cache-from: type=registry,ref=ghcr.io/oven-sh/bun:buildcache-${{matrix.cpu}}-${{matrix.arch}}-macos + cache-to: type=registry,ref=ghcr.io/oven-sh/bun:buildcache-${{matrix.cpu}}-${{matrix.arch}}-macos,mode=max + build-args: | + ARCH=${{ matrix.arch }} + BUILDARCH=amd64 + CPU_TARGET=${{ matrix.cpu }} + TRIPLET=${{matrix.arch}}-macos-none + platforms: linux/amd64 + target: build_release_obj + outputs: type=local,dest=${{runner.temp}}/release + - uses: actions/upload-artifact@v3 + with: + name: ${{ matrix.tag }} + path: ${{runner.temp}}/release/bun.o + macOS-cpp: + name: macOS C++ + runs-on: ${{ matrix.runner }} + timeout-minutes: 90 + strategy: + matrix: + include: + # - cpu: sandybridge + # arch: x86_64 + # tag: bun-darwin-x64-baseline + # obj: bun-obj-darwin-x64-baseline + # runner: macos-11 + # artifact: bun-obj-darwin-x64-baseline + # webkit_url: "https://github.com/oven-sh/WebKit/releases/download/latest/bun-webkit-macos-amd64-lto.tar.gz" + # dependencies: true + # compile_obj: false + # - cpu: haswell + # arch: x86_64 + # tag: bun-darwin-x64 + # obj: bun-obj-darwin-x64 + # runner: macos-11 + # artifact: bun-obj-darwin-x64 + # webkit_url: "https://github.com/oven-sh/WebKit/releases/download/latest/bun-webkit-macos-amd64-lto.tar.gz" + # dependencies: true + # compile_obj: false + # - cpu: sandybridge + # arch: x86_64 + # tag: bun-darwin-x64-baseline + # obj: bun-obj-darwin-x64-baseline + # runner: macos-11 + # artifact: bun-obj-darwin-x64-baseline + # webkit_url: "https://github.com/oven-sh/WebKit/releases/download/latest/bun-webkit-macos-amd64-lto.tar.gz" + # dependencies: false + # compile_obj: true + # - cpu: haswell + # arch: x86_64 + # tag: bun-darwin-x64 + # obj: bun-obj-darwin-x64 + # runner: macos-11 + # artifact: bun-obj-darwin-x64 + # webkit_url: "https://github.com/oven-sh/WebKit/releases/download/latest/bun-webkit-macos-amd64-lto.tar.gz" + # dependencies: false + # compile_obj: true + - cpu: native + arch: aarch64 + tag: bun-darwin-aarch64 + obj: bun-obj-darwin-aarch64 + artifact: bun-obj-darwin-aarch64 + webkit_url: "https://github.com/oven-sh/WebKit/releases/download/latest/bun-webkit-macos-arm64-lto.tar.gz" + runner: macos-arm64 + dependencies: true + compile_obj: true + steps: + - uses: actions/checkout@v3 + - name: Checkout submodules + run: git submodule update --init --recursive --depth=1 --progress -j $(sysctl -n hw.ncpu) + - name: Install dependencies + env: + CPU_TARGET: ${{ matrix.cpu }} + JSC_BASE_DIR: ${{ runner.temp }}/bun-webkit + JSC_LIB: ${{ runner.temp }}/bun-webkit/lib + HOMEBREW_NO_INSTALLED_DEPENDENTS_CHECK: 1 + HOMEBREW_NO_AUTO_UPDATE: 1 + HOMEBREW_NO_INSTALL_CLEANUP: 1 + BUN_DEPLOY_DIR: ${{ runner.temp }}/release/bun + OBJ_DIR: ${{ runner.temp }}/bun-cpp-obj + BUN_DEPS_OUT_DIR: ${{runner.temp}}/bun-deps + run: | + brew install rust llvm@13 pkg-config coreutils libtool cmake libiconv automake openssl@1.1 ninja gnu-sed pkg-config esbuild --force + echo "export PATH=$(brew --prefix coreutils)/libexec/gnubin:\$PATH" >> $GITHUB_ENV + echo "export PATH=$(brew --prefix llvm@13)/bin:\$PATH" >> $GITHUB_ENV + brew link --overwrite llvm@13 + - name: Download WebKit + if: matrix.compile_obj + env: + CPU_TARGET: ${{ matrix.cpu }} + JSC_BASE_DIR: ${{ runner.temp }}/bun-webkit + JSC_LIB: ${{ runner.temp }}/bun-webkit/lib + BUN_DEPLOY_DIR: ${{ runner.temp }}/release/bun + OBJ_DIR: ${{ runner.temp }}/bun-cpp-obj + BUN_DEPS_OUT_DIR: ${{runner.temp}}/bun-deps + run: | + rm -rf $JSC_BASE_DIR + mkdir -p $JSC_BASE_DIR + curl -L ${{ matrix.webkit_url }} | tar -xz -C $JSC_BASE_DIR --strip-components=1 + - name: Compile dependencies + if: matrix.dependencies + env: + CPU_TARGET: ${{ matrix.cpu }} + JSC_BASE_DIR: ${{ runner.temp }}/bun-webkit + JSC_LIB: ${{ runner.temp }}/bun-webkit/lib + BUN_DEPLOY_DIR: ${{ runner.temp }}/release/bun + OBJ_DIR: ${{ runner.temp }}/bun-cpp-obj + BUN_DEPS_OUT_DIR: ${{runner.temp}}/bun-deps + run: | + mkdir -p $BUN_DEPS_OUT_DIR + make vendor-without-check + - name: Compile C++ + if: matrix.compile_obj + env: + CPU_TARGET: ${{ matrix.cpu }} + JSC_BASE_DIR: ${{ runner.temp }}/bun-webkit + JSC_LIB: ${{ runner.temp }}/bun-webkit/lib + BUN_DEPLOY_DIR: ${{ runner.temp }}/release/bun + OBJ_DIR: ${{ runner.temp }}/bun-cpp-obj + BUN_DEPS_OUT_DIR: ${{runner.temp}}/bun-deps + run: | + mkdir -p $OBJ_DIR + make -j $(sysctl -n hw.ncpu) jsc-bindings-mac + - name: Upload C++ + if: matrix.compile_obj + uses: actions/upload-artifact@v3 + with: + name: ${{ matrix.tag }}-cpp + path: ${{ runner.temp }}/bun-cpp-obj + - name: Upload Dependencies + if: matrix.dependencies + uses: actions/upload-artifact@v3 + with: + name: ${{ matrix.tag }}-deps + path: ${{runner.temp}}/bun-deps + + macOS: + name: macOS Link + runs-on: ${{ matrix.runner }} + needs: [macOS-cpp, macos-object-files] + timeout-minutes: 90 + strategy: + matrix: + include: + # - cpu: sandybridge + # arch: x86_64 + # tag: bun-darwin-x64-baseline + # obj: bun-obj-darwin-x64-baseline + # package: bun-darwin-x64 + # runner: macos-11 + # artifact: bun-obj-darwin-x64-baseline + # webkit_url: "https://github.com/oven-sh/WebKit/releases/download/latest/bun-webkit-macos-amd64-lto.tar.gz" + # - cpu: haswell + # arch: x86_64 + # tag: bun-darwin-x64 + # obj: bun-obj-darwin-x64 + # package: bun-darwin-x64 + # runner: macos-11 + # artifact: bun-obj-darwin-x64 + # webkit_url: "https://github.com/oven-sh/WebKit/releases/download/latest/bun-webkit-macos-amd64-lto.tar.gz" + - cpu: native + arch: aarch64 + tag: bun-darwin-aarch64 + obj: bun-obj-darwin-aarch64 + package: bun-darwin-aarch64 + artifact: bun-obj-darwin-aarch64 + webkit_url: "https://github.com/oven-sh/WebKit/releases/download/latest/bun-webkit-macos-arm64-lto.tar.gz" + runner: macos-arm64 + steps: + - uses: actions/checkout@v3 + - name: Checkout submodules + run: git submodule update --init --recursive --depth=1 --progress -j $(sysctl -n hw.ncpu) + - name: Install dependencies + env: + CPU_TARGET: ${{ matrix.cpu }} + JSC_BASE_DIR: ${{ runner.temp }}/bun-webkit + JSC_LIB: ${{ runner.temp }}/bun-webkit/lib + HOMEBREW_NO_INSTALLED_DEPENDENTS_CHECK: 1 + HOMEBREW_NO_AUTO_UPDATE: 1 + HOMEBREW_NO_INSTALL_CLEANUP: 1 + BUN_DEPLOY_DIR: ${{ runner.temp }}/release/bun + OBJ_DIR: ${{ runner.temp }}/bun-cpp-obj + BUN_DEPS_OUT_DIR: ${{runner.temp}}/bun-deps + run: | + brew install rust llvm@13 pkg-config coreutils libtool cmake libiconv automake openssl@1.1 ninja gnu-sed pkg-config esbuild --force + echo "export PATH=$(brew --prefix coreutils)/libexec/gnubin:\$PATH" >> $GITHUB_ENV + echo "export PATH=$(brew --prefix llvm@13)/bin:\$PATH" >> $GITHUB_ENV + brew link --overwrite llvm@13 + - name: Download WebKit + env: + CPU_TARGET: ${{ matrix.cpu }} + JSC_BASE_DIR: ${{ runner.temp }}/bun-webkit + JSC_LIB: ${{ runner.temp }}/bun-webkit/lib + BUN_DEPLOY_DIR: ${{ runner.temp }}/release/bun + OBJ_DIR: ${{ runner.temp }}/bun-cpp-obj + BUN_DEPS_OUT_DIR: ${{runner.temp}}/bun-deps + run: | + rm -rf $JSC_BASE_DIR + mkdir -p $JSC_BASE_DIR + curl -L ${{ matrix.webkit_url }} | tar -xz -C $JSC_BASE_DIR --strip-components=1 + - name: Download C++ + uses: actions/download-artifact@v3 + with: + name: ${{ matrix.tag }}-cpp + path: ${{ runner.temp }}/bun-cpp-obj + - name: Download Dependencies + uses: actions/download-artifact@v3 + with: + name: ${{ matrix.tag }}-deps + path: ${{ runner.temp }}/bun-deps + - name: Download Object + uses: actions/download-artifact@v3 + with: + name: ${{ matrix.obj }} + path: ${{ runner.temp }}/release + - name: Link + env: + CPU_TARGET: ${{ matrix.cpu }} + JSC_BASE_DIR: ${{ runner.temp }}/bun-webkit + JSC_LIB: ${{ runner.temp }}/bun-webkit/lib + BUN_DEPLOY_DIR: ${{ runner.temp }}/release/bun + OBJ_DIR: ${{ runner.temp }}/bun-cpp-obj + BUN_DEPS_OUT_DIR: ${{runner.temp}}/bun-deps + BUN_RELEASE_DIR: ${{ runner.temp }}/release + run: | + rm -rf packages/${{ matrix.package }} + mkdir -p packages/${{ matrix.package }} + mv ${{ runner.temp }}/release/* packages/${{ matrix.package }}/ + make bun-link-lld-release copy-to-bun-release-dir-bin + - name: Zip + env: + CPU_TARGET: ${{ matrix.cpu }} + JSC_BASE_DIR: ${{ runner.temp }}/bun-webkit + JSC_LIB: ${{ runner.temp }}/bun-webkit/lib + BUN_DEPLOY_DIR: ${{ runner.temp }}/release/bun + OBJ_DIR: ${{ runner.temp }}/bun-cpp-obj + BUN_DEPS_OUT_DIR: ${{runner.temp}}/bun-deps + BUN_RELEASE_DIR: ${{ runner.temp }}/release + run: | + cd ${{runner.temp}}/release + chmod +x bun-profile bun + + mkdir ${{matrix.tag}}-profile + mkdir ${{matrix.tag}} + + /usr/bin/strip bun + + mv bun-profile ${{matrix.tag}}-profile/bun-profile + mv bun ${{matrix.tag}}/bun + + zip -r ${{matrix.tag}}-profile.zip ${{matrix.tag}}-profile + zip -r ${{matrix.tag}}.zip ${{matrix.tag}} + - uses: actions/upload-artifact@v3 + with: + name: ${{matrix.tag}}-profile + path: ${{runner.temp}}/release/${{matrix.tag}}-profile.zip + - uses: actions/upload-artifact@v3 + with: + name: ${{matrix.tag}} + path: ${{runner.temp}}/release/${{matrix.tag}}.zip + - name: Upload as Canary + if: github.ref == 'refs/heads/main' + run: | + echo "$GITHUB_TOKEN" > ${{runner.temp}}/token.txt + gh auth login --with-token < cat ${{runner.temp}}/token.txt + rm -f ${{runner.temp}}/token.txt + gh release upload canary ${{runner.temp}}/release/bun*.zip --clobber --repo $GITHUB_REPOSITORY diff --git a/.github/workflows/bun-mac-x64-baseline.yml b/.github/workflows/bun-mac-x64-baseline.yml new file mode 100644 index 000000000..4c80185ec --- /dev/null +++ b/.github/workflows/bun-mac-x64-baseline.yml @@ -0,0 +1,332 @@ +name: bun-macOS-x64-baseline +env: + REGISTRY: ghcr.io + IMAGE_NAME: ${{ github.repository }} + TEST_TAG: bun-test' + +on: + push: + branches: [main, bun-actions] + paths: + - "src/**/*" + - "test/**/*" + - "build.zig" + - "Makefile" + - "Dockerfile" + pull_request: + branches: [main] + paths: + - "src/**/*" + - "test/**/*" + - "build.zig" + - "Makefile" + - "Dockerfile" + # Allows you to run this workflow manually from the Actions tab + workflow_dispatch: + +jobs: + macos-object-files: + name: macOS Object + runs-on: linux-amd64 + strategy: + matrix: + include: + - cpu: sandybridge + arch: x86_64 + tag: bun-obj-darwin-x64-baseline + # - cpu: haswell + # arch: x86_64 + # tag: bun-obj-darwin-x64 + # - cpu: native + # arch: aarch64 + # tag: bun-obj-darwin-aarch64 + steps: + - uses: actions/checkout@v3 + - name: Checkout submodules + run: git -c submodule."src/bun.js/WebKit".update=none submodule update --init --recursive --depth=1 --progress -j $(nproc) + - uses: docker/setup-buildx-action@v2 + id: buildx + with: + install: true + - name: Run + run: | + rm -rf ${{runner.temp}}/release + - name: Login to GitHub Container Registry + uses: docker/login-action@v2 + with: + registry: ghcr.io + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + - name: Build and push + uses: docker/build-push-action@v3 + with: + context: . + push: false + tags: ghcr.io/oven-sh/bun:canary,ghcr.io/oven-sh/bun:${{github.sha}} + cache-from: type=registry,ref=ghcr.io/oven-sh/bun:buildcache-${{matrix.cpu}}-${{matrix.arch}}-macos + cache-to: type=registry,ref=ghcr.io/oven-sh/bun:buildcache-${{matrix.cpu}}-${{matrix.arch}}-macos,mode=max + build-args: | + ARCH=${{ matrix.arch }} + BUILDARCH=amd64 + CPU_TARGET=${{ matrix.cpu }} + TRIPLET=${{matrix.arch}}-macos-none + platforms: linux/amd64 + target: build_release_obj + outputs: type=local,dest=${{runner.temp}}/release + - uses: actions/upload-artifact@v3 + with: + name: ${{ matrix.tag }} + path: ${{runner.temp}}/release/bun.o + macOS-cpp: + name: macOS C++ + runs-on: ${{ matrix.runner }} + timeout-minutes: 90 + strategy: + matrix: + include: + - cpu: sandybridge + arch: x86_64 + tag: bun-darwin-x64-baseline + obj: bun-obj-darwin-x64-baseline + runner: macos-11 + artifact: bun-obj-darwin-x64-baseline + webkit_url: "https://github.com/oven-sh/WebKit/releases/download/latest/bun-webkit-macos-amd64-lto.tar.gz" + dependencies: true + compile_obj: false + # - cpu: haswell + # arch: x86_64 + # tag: bun-darwin-x64 + # obj: bun-obj-darwin-x64 + # runner: macos-11 + # artifact: bun-obj-darwin-x64 + # webkit_url: "https://github.com/oven-sh/WebKit/releases/download/latest/bun-webkit-macos-amd64-lto.tar.gz" + # dependencies: true + # compile_obj: false + - cpu: sandybridge + arch: x86_64 + tag: bun-darwin-x64-baseline + obj: bun-obj-darwin-x64-baseline + runner: macos-11 + artifact: bun-obj-darwin-x64-baseline + webkit_url: "https://github.com/oven-sh/WebKit/releases/download/latest/bun-webkit-macos-amd64-lto.tar.gz" + dependencies: false + compile_obj: true + # - cpu: haswell + # arch: x86_64 + # tag: bun-darwin-x64 + # obj: bun-obj-darwin-x64 + # runner: macos-11 + # artifact: bun-obj-darwin-x64 + # webkit_url: "https://github.com/oven-sh/WebKit/releases/download/latest/bun-webkit-macos-amd64-lto.tar.gz" + # dependencies: false + # compile_obj: true + # - cpu: native + # arch: aarch64 + # tag: bun-darwin-aarch64 + # obj: bun-obj-darwin-aarch64 + # artifact: bun-obj-darwin-aarch64 + # webkit_url: "https://github.com/oven-sh/WebKit/releases/download/latest/bun-webkit-macos-arm64-lto.tar.gz" + # runner: macos-arm64 + # dependencies: true + # compile_obj: true + steps: + - uses: actions/checkout@v3 + - name: Checkout submodules + run: git submodule update --init --recursive --depth=1 --progress -j $(sysctl -n hw.ncpu) + - name: Install dependencies + env: + CPU_TARGET: ${{ matrix.cpu }} + JSC_BASE_DIR: ${{ runner.temp }}/bun-webkit + JSC_LIB: ${{ runner.temp }}/bun-webkit/lib + HOMEBREW_NO_INSTALLED_DEPENDENTS_CHECK: 1 + HOMEBREW_NO_AUTO_UPDATE: 1 + HOMEBREW_NO_INSTALL_CLEANUP: 1 + BUN_DEPLOY_DIR: ${{ runner.temp }}/release/bun + OBJ_DIR: ${{ runner.temp }}/bun-cpp-obj + BUN_DEPS_OUT_DIR: ${{runner.temp}}/bun-deps + run: | + brew install rust llvm@13 pkg-config coreutils libtool cmake libiconv automake openssl@1.1 ninja gnu-sed pkg-config esbuild --force + echo "export PATH=$(brew --prefix coreutils)/libexec/gnubin:\$PATH" >> $GITHUB_ENV + echo "export PATH=$(brew --prefix llvm@13)/bin:\$PATH" >> $GITHUB_ENV + brew link --overwrite llvm@13 + - name: Download WebKit + if: matrix.compile_obj + env: + CPU_TARGET: ${{ matrix.cpu }} + JSC_BASE_DIR: ${{ runner.temp }}/bun-webkit + JSC_LIB: ${{ runner.temp }}/bun-webkit/lib + BUN_DEPLOY_DIR: ${{ runner.temp }}/release/bun + OBJ_DIR: ${{ runner.temp }}/bun-cpp-obj + BUN_DEPS_OUT_DIR: ${{runner.temp}}/bun-deps + run: | + rm -rf $JSC_BASE_DIR + mkdir -p $JSC_BASE_DIR + curl -L ${{ matrix.webkit_url }} | tar -xz -C $JSC_BASE_DIR --strip-components=1 + - name: Compile dependencies + if: matrix.dependencies + env: + CPU_TARGET: ${{ matrix.cpu }} + JSC_BASE_DIR: ${{ runner.temp }}/bun-webkit + JSC_LIB: ${{ runner.temp }}/bun-webkit/lib + BUN_DEPLOY_DIR: ${{ runner.temp }}/release/bun + OBJ_DIR: ${{ runner.temp }}/bun-cpp-obj + BUN_DEPS_OUT_DIR: ${{runner.temp}}/bun-deps + run: | + mkdir -p $BUN_DEPS_OUT_DIR + make vendor-without-check + - name: Compile C++ + if: matrix.compile_obj + env: + CPU_TARGET: ${{ matrix.cpu }} + JSC_BASE_DIR: ${{ runner.temp }}/bun-webkit + JSC_LIB: ${{ runner.temp }}/bun-webkit/lib + BUN_DEPLOY_DIR: ${{ runner.temp }}/release/bun + OBJ_DIR: ${{ runner.temp }}/bun-cpp-obj + BUN_DEPS_OUT_DIR: ${{runner.temp}}/bun-deps + run: | + mkdir -p $OBJ_DIR + make -j $(sysctl -n hw.ncpu) jsc-bindings-mac + - name: Upload C++ + if: matrix.compile_obj + uses: actions/upload-artifact@v3 + with: + name: ${{ matrix.tag }}-cpp + path: ${{ runner.temp }}/bun-cpp-obj + - name: Upload Dependencies + if: matrix.dependencies + uses: actions/upload-artifact@v3 + with: + name: ${{ matrix.tag }}-deps + path: ${{runner.temp}}/bun-deps + + macOS: + name: macOS Link + runs-on: ${{ matrix.runner }} + needs: [macOS-cpp, macos-object-files] + timeout-minutes: 90 + strategy: + matrix: + include: + - cpu: sandybridge + arch: x86_64 + tag: bun-darwin-x64-baseline + obj: bun-obj-darwin-x64-baseline + package: bun-darwin-x64 + runner: macos-11 + artifact: bun-obj-darwin-x64-baseline + webkit_url: "https://github.com/oven-sh/WebKit/releases/download/latest/bun-webkit-macos-amd64-lto.tar.gz" + # - cpu: haswell + # arch: x86_64 + # tag: bun-darwin-x64 + # obj: bun-obj-darwin-x64 + # package: bun-darwin-x64 + # runner: macos-11 + # artifact: bun-obj-darwin-x64 + # webkit_url: "https://github.com/oven-sh/WebKit/releases/download/latest/bun-webkit-macos-amd64-lto.tar.gz" + # - cpu: native + # arch: aarch64 + # tag: bun-darwin-aarch64 + # obj: bun-obj-darwin-aarch64 + # package: bun-darwin-aarch64 + # artifact: bun-obj-darwin-aarch64 + # webkit_url: "https://github.com/oven-sh/WebKit/releases/download/latest/bun-webkit-macos-arm64-lto.tar.gz" + # runner: macos-arm64 + steps: + - uses: actions/checkout@v3 + - name: Checkout submodules + run: git submodule update --init --recursive --depth=1 --progress -j $(sysctl -n hw.ncpu) + - name: Install dependencies + env: + CPU_TARGET: ${{ matrix.cpu }} + JSC_BASE_DIR: ${{ runner.temp }}/bun-webkit + JSC_LIB: ${{ runner.temp }}/bun-webkit/lib + HOMEBREW_NO_INSTALLED_DEPENDENTS_CHECK: 1 + HOMEBREW_NO_AUTO_UPDATE: 1 + HOMEBREW_NO_INSTALL_CLEANUP: 1 + BUN_DEPLOY_DIR: ${{ runner.temp }}/release/bun + OBJ_DIR: ${{ runner.temp }}/bun-cpp-obj + BUN_DEPS_OUT_DIR: ${{runner.temp}}/bun-deps + run: | + brew install rust llvm@13 pkg-config coreutils libtool cmake libiconv automake openssl@1.1 ninja gnu-sed pkg-config esbuild --force + echo "export PATH=$(brew --prefix coreutils)/libexec/gnubin:\$PATH" >> $GITHUB_ENV + echo "export PATH=$(brew --prefix llvm@13)/bin:\$PATH" >> $GITHUB_ENV + brew link --overwrite llvm@13 + - name: Download WebKit + env: + CPU_TARGET: ${{ matrix.cpu }} + JSC_BASE_DIR: ${{ runner.temp }}/bun-webkit + JSC_LIB: ${{ runner.temp }}/bun-webkit/lib + BUN_DEPLOY_DIR: ${{ runner.temp }}/release/bun + OBJ_DIR: ${{ runner.temp }}/bun-cpp-obj + BUN_DEPS_OUT_DIR: ${{runner.temp}}/bun-deps + run: | + rm -rf $JSC_BASE_DIR + mkdir -p $JSC_BASE_DIR + curl -L ${{ matrix.webkit_url }} | tar -xz -C $JSC_BASE_DIR --strip-components=1 + - name: Download C++ + uses: actions/download-artifact@v3 + with: + name: ${{ matrix.tag }}-cpp + path: ${{ runner.temp }}/bun-cpp-obj + - name: Download Dependencies + uses: actions/download-artifact@v3 + with: + name: ${{ matrix.tag }}-deps + path: ${{ runner.temp }}/bun-deps + - name: Download Object + uses: actions/download-artifact@v3 + with: + name: ${{ matrix.obj }} + path: ${{ runner.temp }}/release + - name: Link + env: + CPU_TARGET: ${{ matrix.cpu }} + JSC_BASE_DIR: ${{ runner.temp }}/bun-webkit + JSC_LIB: ${{ runner.temp }}/bun-webkit/lib + BUN_DEPLOY_DIR: ${{ runner.temp }}/release/bun + OBJ_DIR: ${{ runner.temp }}/bun-cpp-obj + BUN_DEPS_OUT_DIR: ${{runner.temp}}/bun-deps + BUN_RELEASE_DIR: ${{ runner.temp }}/release + run: | + rm -rf packages/${{ matrix.package }} + mkdir -p packages/${{ matrix.package }} + mv ${{ runner.temp }}/release/* packages/${{ matrix.package }}/ + make bun-link-lld-release copy-to-bun-release-dir-bin + - name: Zip + env: + CPU_TARGET: ${{ matrix.cpu }} + JSC_BASE_DIR: ${{ runner.temp }}/bun-webkit + JSC_LIB: ${{ runner.temp }}/bun-webkit/lib + BUN_DEPLOY_DIR: ${{ runner.temp }}/release/bun + OBJ_DIR: ${{ runner.temp }}/bun-cpp-obj + BUN_DEPS_OUT_DIR: ${{runner.temp}}/bun-deps + BUN_RELEASE_DIR: ${{ runner.temp }}/release + run: | + cd ${{runner.temp}}/release + chmod +x bun-profile bun + + mkdir ${{matrix.tag}}-profile + mkdir ${{matrix.tag}} + + /usr/bin/strip bun + + mv bun-profile ${{matrix.tag}}-profile/bun-profile + mv bun ${{matrix.tag}}/bun + + zip -r ${{matrix.tag}}-profile.zip ${{matrix.tag}}-profile + zip -r ${{matrix.tag}}.zip ${{matrix.tag}} + - uses: actions/upload-artifact@v3 + with: + name: ${{matrix.tag}}-profile + path: ${{runner.temp}}/release/${{matrix.tag}}-profile.zip + - uses: actions/upload-artifact@v3 + with: + name: ${{matrix.tag}} + path: ${{runner.temp}}/release/${{matrix.tag}}.zip + - name: Upload as Canary + if: github.ref == 'refs/heads/main' + run: | + echo "$GITHUB_TOKEN" > ${{runner.temp}}/token.txt + gh auth login --with-token < cat ${{runner.temp}}/token.txt + rm -f ${{runner.temp}}/token.txt + gh release upload canary ${{runner.temp}}/release/bun*.zip --clobber --repo $GITHUB_REPOSITORY diff --git a/.github/workflows/bun-mac-x64.yml b/.github/workflows/bun-mac-x64.yml new file mode 100644 index 000000000..951f6f4f8 --- /dev/null +++ b/.github/workflows/bun-mac-x64.yml @@ -0,0 +1,332 @@ +name: bun-macOS-x64 +env: + REGISTRY: ghcr.io + IMAGE_NAME: ${{ github.repository }} + TEST_TAG: bun-test' + +on: + push: + branches: [main, bun-actions] + paths: + - "src/**/*" + - "test/**/*" + - "build.zig" + - "Makefile" + - "Dockerfile" + pull_request: + branches: [main] + paths: + - "src/**/*" + - "test/**/*" + - "build.zig" + - "Makefile" + - "Dockerfile" + # Allows you to run this workflow manually from the Actions tab + workflow_dispatch: + +jobs: + macos-object-files: + name: macOS Object + runs-on: linux-amd64 + strategy: + matrix: + include: + # - cpu: sandybridge + # arch: x86_64 + # tag: bun-obj-darwin-x64-baseline + - cpu: haswell + arch: x86_64 + tag: bun-obj-darwin-x64 + # - cpu: native + # arch: aarch64 + # tag: bun-obj-darwin-aarch64 + steps: + - uses: actions/checkout@v3 + - name: Checkout submodules + run: git -c submodule."src/bun.js/WebKit".update=none submodule update --init --recursive --depth=1 --progress -j $(nproc) + - uses: docker/setup-buildx-action@v2 + id: buildx + with: + install: true + - name: Run + run: | + rm -rf ${{runner.temp}}/release + - name: Login to GitHub Container Registry + uses: docker/login-action@v2 + with: + registry: ghcr.io + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + - name: Build and push + uses: docker/build-push-action@v3 + with: + context: . + push: false + tags: ghcr.io/oven-sh/bun:canary,ghcr.io/oven-sh/bun:${{github.sha}} + cache-from: type=registry,ref=ghcr.io/oven-sh/bun:buildcache-${{matrix.cpu}}-${{matrix.arch}}-macos + cache-to: type=registry,ref=ghcr.io/oven-sh/bun:buildcache-${{matrix.cpu}}-${{matrix.arch}}-macos,mode=max + build-args: | + ARCH=${{ matrix.arch }} + BUILDARCH=amd64 + CPU_TARGET=${{ matrix.cpu }} + TRIPLET=${{matrix.arch}}-macos-none + platforms: linux/amd64 + target: build_release_obj + outputs: type=local,dest=${{runner.temp}}/release + - uses: actions/upload-artifact@v3 + with: + name: ${{ matrix.tag }} + path: ${{runner.temp}}/release/bun.o + macOS-cpp: + name: macOS C++ + runs-on: ${{ matrix.runner }} + timeout-minutes: 90 + strategy: + matrix: + include: + # - cpu: sandybridge + # arch: x86_64 + # tag: bun-darwin-x64-baseline + # obj: bun-obj-darwin-x64-baseline + # runner: macos-11 + # artifact: bun-obj-darwin-x64-baseline + # webkit_url: "https://github.com/oven-sh/WebKit/releases/download/latest/bun-webkit-macos-amd64-lto.tar.gz" + # dependencies: true + # compile_obj: false + - cpu: haswell + arch: x86_64 + tag: bun-darwin-x64 + obj: bun-obj-darwin-x64 + runner: macos-11 + artifact: bun-obj-darwin-x64 + webkit_url: "https://github.com/oven-sh/WebKit/releases/download/latest/bun-webkit-macos-amd64-lto.tar.gz" + dependencies: true + compile_obj: false + # - cpu: sandybridge + # arch: x86_64 + # tag: bun-darwin-x64-baseline + # obj: bun-obj-darwin-x64-baseline + # runner: macos-11 + # artifact: bun-obj-darwin-x64-baseline + # webkit_url: "https://github.com/oven-sh/WebKit/releases/download/latest/bun-webkit-macos-amd64-lto.tar.gz" + # dependencies: false + # compile_obj: true + - cpu: haswell + arch: x86_64 + tag: bun-darwin-x64 + obj: bun-obj-darwin-x64 + runner: macos-11 + artifact: bun-obj-darwin-x64 + webkit_url: "https://github.com/oven-sh/WebKit/releases/download/latest/bun-webkit-macos-amd64-lto.tar.gz" + dependencies: false + compile_obj: true + # - cpu: native + # arch: aarch64 + # tag: bun-darwin-aarch64 + # obj: bun-obj-darwin-aarch64 + # artifact: bun-obj-darwin-aarch64 + # webkit_url: "https://github.com/oven-sh/WebKit/releases/download/latest/bun-webkit-macos-arm64-lto.tar.gz" + # runner: macos-arm64 + # dependencies: true + # compile_obj: true + steps: + - uses: actions/checkout@v3 + - name: Checkout submodules + run: git submodule update --init --recursive --depth=1 --progress -j $(sysctl -n hw.ncpu) + - name: Install dependencies + env: + CPU_TARGET: ${{ matrix.cpu }} + JSC_BASE_DIR: ${{ runner.temp }}/bun-webkit + JSC_LIB: ${{ runner.temp }}/bun-webkit/lib + HOMEBREW_NO_INSTALLED_DEPENDENTS_CHECK: 1 + HOMEBREW_NO_AUTO_UPDATE: 1 + HOMEBREW_NO_INSTALL_CLEANUP: 1 + BUN_DEPLOY_DIR: ${{ runner.temp }}/release/bun + OBJ_DIR: ${{ runner.temp }}/bun-cpp-obj + BUN_DEPS_OUT_DIR: ${{runner.temp}}/bun-deps + run: | + brew install rust llvm@13 pkg-config coreutils libtool cmake libiconv automake openssl@1.1 ninja gnu-sed pkg-config esbuild --force + echo "export PATH=$(brew --prefix coreutils)/libexec/gnubin:\$PATH" >> $GITHUB_ENV + echo "export PATH=$(brew --prefix llvm@13)/bin:\$PATH" >> $GITHUB_ENV + brew link --overwrite llvm@13 + - name: Download WebKit + if: matrix.compile_obj + env: + CPU_TARGET: ${{ matrix.cpu }} + JSC_BASE_DIR: ${{ runner.temp }}/bun-webkit + JSC_LIB: ${{ runner.temp }}/bun-webkit/lib + BUN_DEPLOY_DIR: ${{ runner.temp }}/release/bun + OBJ_DIR: ${{ runner.temp }}/bun-cpp-obj + BUN_DEPS_OUT_DIR: ${{runner.temp}}/bun-deps + run: | + rm -rf $JSC_BASE_DIR + mkdir -p $JSC_BASE_DIR + curl -L ${{ matrix.webkit_url }} | tar -xz -C $JSC_BASE_DIR --strip-components=1 + - name: Compile dependencies + if: matrix.dependencies + env: + CPU_TARGET: ${{ matrix.cpu }} + JSC_BASE_DIR: ${{ runner.temp }}/bun-webkit + JSC_LIB: ${{ runner.temp }}/bun-webkit/lib + BUN_DEPLOY_DIR: ${{ runner.temp }}/release/bun + OBJ_DIR: ${{ runner.temp }}/bun-cpp-obj + BUN_DEPS_OUT_DIR: ${{runner.temp}}/bun-deps + run: | + mkdir -p $BUN_DEPS_OUT_DIR + make vendor-without-check + - name: Compile C++ + if: matrix.compile_obj + env: + CPU_TARGET: ${{ matrix.cpu }} + JSC_BASE_DIR: ${{ runner.temp }}/bun-webkit + JSC_LIB: ${{ runner.temp }}/bun-webkit/lib + BUN_DEPLOY_DIR: ${{ runner.temp }}/release/bun + OBJ_DIR: ${{ runner.temp }}/bun-cpp-obj + BUN_DEPS_OUT_DIR: ${{runner.temp}}/bun-deps + run: | + mkdir -p $OBJ_DIR + make -j $(sysctl -n hw.ncpu) jsc-bindings-mac + - name: Upload C++ + if: matrix.compile_obj + uses: actions/upload-artifact@v3 + with: + name: ${{ matrix.tag }}-cpp + path: ${{ runner.temp }}/bun-cpp-obj + - name: Upload Dependencies + if: matrix.dependencies + uses: actions/upload-artifact@v3 + with: + name: ${{ matrix.tag }}-deps + path: ${{runner.temp}}/bun-deps + + macOS: + name: macOS Link + runs-on: ${{ matrix.runner }} + needs: [macOS-cpp, macos-object-files] + timeout-minutes: 90 + strategy: + matrix: + include: + # - cpu: sandybridge + # arch: x86_64 + # tag: bun-darwin-x64-baseline + # obj: bun-obj-darwin-x64-baseline + # package: bun-darwin-x64 + # runner: macos-11 + # artifact: bun-obj-darwin-x64-baseline + # webkit_url: "https://github.com/oven-sh/WebKit/releases/download/latest/bun-webkit-macos-amd64-lto.tar.gz" + - cpu: haswell + arch: x86_64 + tag: bun-darwin-x64 + obj: bun-obj-darwin-x64 + package: bun-darwin-x64 + runner: macos-11 + artifact: bun-obj-darwin-x64 + webkit_url: "https://github.com/oven-sh/WebKit/releases/download/latest/bun-webkit-macos-amd64-lto.tar.gz" + # - cpu: native + # arch: aarch64 + # tag: bun-darwin-aarch64 + # obj: bun-obj-darwin-aarch64 + # package: bun-darwin-aarch64 + # artifact: bun-obj-darwin-aarch64 + # webkit_url: "https://github.com/oven-sh/WebKit/releases/download/latest/bun-webkit-macos-arm64-lto.tar.gz" + # runner: macos-arm64 + steps: + - uses: actions/checkout@v3 + - name: Checkout submodules + run: git submodule update --init --recursive --depth=1 --progress -j $(sysctl -n hw.ncpu) + - name: Install dependencies + env: + CPU_TARGET: ${{ matrix.cpu }} + JSC_BASE_DIR: ${{ runner.temp }}/bun-webkit + JSC_LIB: ${{ runner.temp }}/bun-webkit/lib + HOMEBREW_NO_INSTALLED_DEPENDENTS_CHECK: 1 + HOMEBREW_NO_AUTO_UPDATE: 1 + HOMEBREW_NO_INSTALL_CLEANUP: 1 + BUN_DEPLOY_DIR: ${{ runner.temp }}/release/bun + OBJ_DIR: ${{ runner.temp }}/bun-cpp-obj + BUN_DEPS_OUT_DIR: ${{runner.temp}}/bun-deps + run: | + brew install rust llvm@13 pkg-config coreutils libtool cmake libiconv automake openssl@1.1 ninja gnu-sed pkg-config esbuild --force + echo "export PATH=$(brew --prefix coreutils)/libexec/gnubin:\$PATH" >> $GITHUB_ENV + echo "export PATH=$(brew --prefix llvm@13)/bin:\$PATH" >> $GITHUB_ENV + brew link --overwrite llvm@13 + - name: Download WebKit + env: + CPU_TARGET: ${{ matrix.cpu }} + JSC_BASE_DIR: ${{ runner.temp }}/bun-webkit + JSC_LIB: ${{ runner.temp }}/bun-webkit/lib + BUN_DEPLOY_DIR: ${{ runner.temp }}/release/bun + OBJ_DIR: ${{ runner.temp }}/bun-cpp-obj + BUN_DEPS_OUT_DIR: ${{runner.temp}}/bun-deps + run: | + rm -rf $JSC_BASE_DIR + mkdir -p $JSC_BASE_DIR + curl -L ${{ matrix.webkit_url }} | tar -xz -C $JSC_BASE_DIR --strip-components=1 + - name: Download C++ + uses: actions/download-artifact@v3 + with: + name: ${{ matrix.tag }}-cpp + path: ${{ runner.temp }}/bun-cpp-obj + - name: Download Dependencies + uses: actions/download-artifact@v3 + with: + name: ${{ matrix.tag }}-deps + path: ${{ runner.temp }}/bun-deps + - name: Download Object + uses: actions/download-artifact@v3 + with: + name: ${{ matrix.obj }} + path: ${{ runner.temp }}/release + - name: Link + env: + CPU_TARGET: ${{ matrix.cpu }} + JSC_BASE_DIR: ${{ runner.temp }}/bun-webkit + JSC_LIB: ${{ runner.temp }}/bun-webkit/lib + BUN_DEPLOY_DIR: ${{ runner.temp }}/release/bun + OBJ_DIR: ${{ runner.temp }}/bun-cpp-obj + BUN_DEPS_OUT_DIR: ${{runner.temp}}/bun-deps + BUN_RELEASE_DIR: ${{ runner.temp }}/release + run: | + rm -rf packages/${{ matrix.package }} + mkdir -p packages/${{ matrix.package }} + mv ${{ runner.temp }}/release/* packages/${{ matrix.package }}/ + make bun-link-lld-release copy-to-bun-release-dir-bin + - name: Zip + env: + CPU_TARGET: ${{ matrix.cpu }} + JSC_BASE_DIR: ${{ runner.temp }}/bun-webkit + JSC_LIB: ${{ runner.temp }}/bun-webkit/lib + BUN_DEPLOY_DIR: ${{ runner.temp }}/release/bun + OBJ_DIR: ${{ runner.temp }}/bun-cpp-obj + BUN_DEPS_OUT_DIR: ${{runner.temp}}/bun-deps + BUN_RELEASE_DIR: ${{ runner.temp }}/release + run: | + cd ${{runner.temp}}/release + chmod +x bun-profile bun + + mkdir ${{matrix.tag}}-profile + mkdir ${{matrix.tag}} + + /usr/bin/strip bun + + mv bun-profile ${{matrix.tag}}-profile/bun-profile + mv bun ${{matrix.tag}}/bun + + zip -r ${{matrix.tag}}-profile.zip ${{matrix.tag}}-profile + zip -r ${{matrix.tag}}.zip ${{matrix.tag}} + - uses: actions/upload-artifact@v3 + with: + name: ${{matrix.tag}}-profile + path: ${{runner.temp}}/release/${{matrix.tag}}-profile.zip + - uses: actions/upload-artifact@v3 + with: + name: ${{matrix.tag}} + path: ${{runner.temp}}/release/${{matrix.tag}}.zip + - name: Upload as Canary + if: github.ref == 'refs/heads/main' + run: | + echo "$GITHUB_TOKEN" > ${{runner.temp}}/token.txt + gh auth login --with-token < cat ${{runner.temp}}/token.txt + rm -f ${{runner.temp}}/token.txt + gh release upload canary ${{runner.temp}}/release/bun*.zip --clobber --repo $GITHUB_REPOSITORY diff --git a/.github/workflows/bun.yml b/.github/workflows/bun.yml index 0a226479f..a447eee79 100644 --- a/.github/workflows/bun.yml +++ b/.github/workflows/bun.yml @@ -1,438 +1,332 @@ -name: bun -on: - push: - branches: [main, bun-actions] - paths: - - "src/**/*" - - "test/**/*" - - "build.zig" - - "Makefile" - - "Dockerfile" - pull_request: - branches: [main] - paths: - - "src/**/*" - - "test/**/*" - - "build.zig" - - "Makefile" - - "Dockerfile" - # Allows you to run this workflow manually from the Actions tab - workflow_dispatch: +# name: bun +# env: +# REGISTRY: ghcr.io +# IMAGE_NAME: ${{ github.repository }} +# TEST_TAG: bun-test' -env: - REGISTRY: ghcr.io - IMAGE_NAME: ${{ github.repository }} - TEST_TAG: bun-test' +# on: +# push: +# branches: [main, bun-actions] +# paths: +# - "src/**/*" +# - "test/**/*" +# - "build.zig" +# - "Makefile" +# - "Dockerfile" +# pull_request: +# branches: [main] +# paths: +# - "src/**/*" +# - "test/**/*" +# - "build.zig" +# - "Makefile" +# - "Dockerfile" +# # Allows you to run this workflow manually from the Actions tab +# workflow_dispatch: -jobs: - macos-object-files: - name: macOS Object - runs-on: linux-amd64 - strategy: - matrix: - include: - - cpu: sandybridge - arch: x86_64 - tag: bun-obj-darwin-x64-baseline - - cpu: haswell - arch: x86_64 - tag: bun-obj-darwin-x64 - - cpu: native - arch: aarch64 - tag: bun-obj-darwin-aarch64 - steps: - - uses: actions/checkout@v3 - - name: Checkout submodules - run: git -c submodule."src/bun.js/WebKit".update=none submodule update --init --recursive --depth=1 --progress -j $(nproc) - - uses: docker/setup-buildx-action@v2 - id: buildx - with: - install: true - - name: Run - run: | - rm -rf ${{runner.temp}}/release - - name: Login to GitHub Container Registry - uses: docker/login-action@v2 - with: - registry: ghcr.io - username: ${{ github.actor }} - password: ${{ secrets.GITHUB_TOKEN }} - - name: Build and push - uses: docker/build-push-action@v3 - with: - context: . - push: false - tags: ghcr.io/oven-sh/bun:canary,ghcr.io/oven-sh/bun:${{github.sha}} - cache-from: type=registry,ref=ghcr.io/oven-sh/bun:buildcache-${{matrix.cpu}}-${{matrix.arch}}-macos - cache-to: type=registry,ref=ghcr.io/oven-sh/bun:buildcache-${{matrix.cpu}}-${{matrix.arch}}-macos,mode=max - build-args: | - ARCH=${{ matrix.arch }} - BUILDARCH=amd64 - CPU_TARGET=${{ matrix.cpu }} - TRIPLET=${{matrix.arch}}-macos-none - platforms: linux/amd64 - target: build_release_obj - outputs: type=local,dest=${{runner.temp}}/release - - uses: actions/upload-artifact@v3 - with: - name: ${{ matrix.tag }} - path: ${{runner.temp}}/release/bun.o - macOS-cpp: - name: macOS C++ - runs-on: ${{ matrix.runner }} - timeout-minutes: 90 - strategy: - matrix: - include: - - cpu: sandybridge - arch: x86_64 - tag: bun-darwin-x64-baseline - obj: bun-obj-darwin-x64-baseline - runner: macos-11 - artifact: bun-obj-darwin-x64-baseline - webkit_url: "https://github.com/oven-sh/WebKit/releases/download/latest/bun-webkit-macos-amd64-lto.tar.gz" - dependencies: true - compile_obj: false - - cpu: haswell - arch: x86_64 - tag: bun-darwin-x64 - obj: bun-obj-darwin-x64 - runner: macos-11 - artifact: bun-obj-darwin-x64 - webkit_url: "https://github.com/oven-sh/WebKit/releases/download/latest/bun-webkit-macos-amd64-lto.tar.gz" - dependencies: true - compile_obj: false - - cpu: sandybridge - arch: x86_64 - tag: bun-darwin-x64-baseline - obj: bun-obj-darwin-x64-baseline - runner: macos-11 - artifact: bun-obj-darwin-x64-baseline - webkit_url: "https://github.com/oven-sh/WebKit/releases/download/latest/bun-webkit-macos-amd64-lto.tar.gz" - dependencies: false - compile_obj: true - - cpu: haswell - arch: x86_64 - tag: bun-darwin-x64 - obj: bun-obj-darwin-x64 - runner: macos-11 - artifact: bun-obj-darwin-x64 - webkit_url: "https://github.com/oven-sh/WebKit/releases/download/latest/bun-webkit-macos-amd64-lto.tar.gz" - dependencies: false - compile_obj: true - - cpu: native - arch: aarch64 - tag: bun-darwin-aarch64 - obj: bun-obj-darwin-aarch64 - artifact: bun-obj-darwin-aarch64 - webkit_url: "https://github.com/oven-sh/WebKit/releases/download/latest/bun-webkit-macos-arm64-lto.tar.gz" - runner: macos-arm64 - dependencies: true - compile_obj: true - steps: - - uses: actions/checkout@v3 - - name: Checkout submodules - run: git submodule update --init --recursive --depth=1 --progress -j $(sysctl -n hw.ncpu) - - name: Install dependencies - env: - CPU_TARGET: ${{ matrix.cpu }} - JSC_BASE_DIR: ${{ runner.temp }}/bun-webkit - JSC_LIB: ${{ runner.temp }}/bun-webkit/lib - HOMEBREW_NO_INSTALLED_DEPENDENTS_CHECK: 1 - HOMEBREW_NO_AUTO_UPDATE: 1 - HOMEBREW_NO_INSTALL_CLEANUP: 1 - BUN_DEPLOY_DIR: ${{ runner.temp }}/release/bun - OBJ_DIR: ${{ runner.temp }}/bun-cpp-obj - BUN_DEPS_OUT_DIR: ${{runner.temp}}/bun-deps - run: | - brew install rust llvm@13 pkg-config coreutils libtool cmake libiconv automake openssl@1.1 ninja gnu-sed pkg-config esbuild --force - echo "export PATH=$(brew --prefix coreutils)/libexec/gnubin:\$PATH" >> $GITHUB_ENV - echo "export PATH=$(brew --prefix llvm@13)/bin:\$PATH" >> $GITHUB_ENV - brew link --overwrite llvm@13 - - name: Download WebKit - if: matrix.compile_obj - env: - CPU_TARGET: ${{ matrix.cpu }} - JSC_BASE_DIR: ${{ runner.temp }}/bun-webkit - JSC_LIB: ${{ runner.temp }}/bun-webkit/lib - BUN_DEPLOY_DIR: ${{ runner.temp }}/release/bun - OBJ_DIR: ${{ runner.temp }}/bun-cpp-obj - BUN_DEPS_OUT_DIR: ${{runner.temp}}/bun-deps - run: | - rm -rf $JSC_BASE_DIR - mkdir -p $JSC_BASE_DIR - curl -L ${{ matrix.webkit_url }} | tar -xz -C $JSC_BASE_DIR --strip-components=1 - - name: Compile dependencies - if: matrix.dependencies - env: - CPU_TARGET: ${{ matrix.cpu }} - JSC_BASE_DIR: ${{ runner.temp }}/bun-webkit - JSC_LIB: ${{ runner.temp }}/bun-webkit/lib - BUN_DEPLOY_DIR: ${{ runner.temp }}/release/bun - OBJ_DIR: ${{ runner.temp }}/bun-cpp-obj - BUN_DEPS_OUT_DIR: ${{runner.temp}}/bun-deps - run: | - mkdir -p $BUN_DEPS_OUT_DIR - make vendor-without-check - - name: Compile C++ - if: matrix.compile_obj - env: - CPU_TARGET: ${{ matrix.cpu }} - JSC_BASE_DIR: ${{ runner.temp }}/bun-webkit - JSC_LIB: ${{ runner.temp }}/bun-webkit/lib - BUN_DEPLOY_DIR: ${{ runner.temp }}/release/bun - OBJ_DIR: ${{ runner.temp }}/bun-cpp-obj - BUN_DEPS_OUT_DIR: ${{runner.temp}}/bun-deps - run: | - mkdir -p $OBJ_DIR - make -j $(sysctl -n hw.ncpu) jsc-bindings-mac - - name: Upload C++ - if: matrix.compile_obj - uses: actions/upload-artifact@v3 - with: - name: ${{ matrix.tag }}-cpp - path: ${{ runner.temp }}/bun-cpp-obj - - name: Upload Dependencies - if: matrix.dependencies - uses: actions/upload-artifact@v3 - with: - name: ${{ matrix.tag }}-deps - path: ${{runner.temp}}/bun-deps +# jobs: +# macos-object-files: +# name: macOS Object +# runs-on: linux-amd64 +# strategy: +# matrix: +# include: +# - cpu: sandybridge +# arch: x86_64 +# tag: bun-obj-darwin-x64-baseline +# - cpu: haswell +# arch: x86_64 +# tag: bun-obj-darwin-x64 +# - cpu: native +# arch: aarch64 +# tag: bun-obj-darwin-aarch64 +# steps: +# - uses: actions/checkout@v3 +# - name: Checkout submodules +# run: git -c submodule."src/bun.js/WebKit".update=none submodule update --init --recursive --depth=1 --progress -j $(nproc) +# - uses: docker/setup-buildx-action@v2 +# id: buildx +# with: +# install: true +# - name: Run +# run: | +# rm -rf ${{runner.temp}}/release +# - name: Login to GitHub Container Registry +# uses: docker/login-action@v2 +# with: +# registry: ghcr.io +# username: ${{ github.actor }} +# password: ${{ secrets.GITHUB_TOKEN }} +# - name: Build and push +# uses: docker/build-push-action@v3 +# with: +# context: . +# push: false +# tags: ghcr.io/oven-sh/bun:canary,ghcr.io/oven-sh/bun:${{github.sha}} +# cache-from: type=registry,ref=ghcr.io/oven-sh/bun:buildcache-${{matrix.cpu}}-${{matrix.arch}}-macos +# cache-to: type=registry,ref=ghcr.io/oven-sh/bun:buildcache-${{matrix.cpu}}-${{matrix.arch}}-macos,mode=max +# build-args: | +# ARCH=${{ matrix.arch }} +# BUILDARCH=amd64 +# CPU_TARGET=${{ matrix.cpu }} +# TRIPLET=${{matrix.arch}}-macos-none +# platforms: linux/amd64 +# target: build_release_obj +# outputs: type=local,dest=${{runner.temp}}/release +# - uses: actions/upload-artifact@v3 +# with: +# name: ${{ matrix.tag }} +# path: ${{runner.temp}}/release/bun.o +# macOS-cpp: +# name: macOS C++ +# runs-on: ${{ matrix.runner }} +# timeout-minutes: 90 +# strategy: +# matrix: +# include: +# - cpu: sandybridge +# arch: x86_64 +# tag: bun-darwin-x64-baseline +# obj: bun-obj-darwin-x64-baseline +# runner: macos-11 +# artifact: bun-obj-darwin-x64-baseline +# webkit_url: "https://github.com/oven-sh/WebKit/releases/download/latest/bun-webkit-macos-amd64-lto.tar.gz" +# dependencies: true +# compile_obj: false +# - cpu: haswell +# arch: x86_64 +# tag: bun-darwin-x64 +# obj: bun-obj-darwin-x64 +# runner: macos-11 +# artifact: bun-obj-darwin-x64 +# webkit_url: "https://github.com/oven-sh/WebKit/releases/download/latest/bun-webkit-macos-amd64-lto.tar.gz" +# dependencies: true +# compile_obj: false +# - cpu: sandybridge +# arch: x86_64 +# tag: bun-darwin-x64-baseline +# obj: bun-obj-darwin-x64-baseline +# runner: macos-11 +# artifact: bun-obj-darwin-x64-baseline +# webkit_url: "https://github.com/oven-sh/WebKit/releases/download/latest/bun-webkit-macos-amd64-lto.tar.gz" +# dependencies: false +# compile_obj: true +# - cpu: haswell +# arch: x86_64 +# tag: bun-darwin-x64 +# obj: bun-obj-darwin-x64 +# runner: macos-11 +# artifact: bun-obj-darwin-x64 +# webkit_url: "https://github.com/oven-sh/WebKit/releases/download/latest/bun-webkit-macos-amd64-lto.tar.gz" +# dependencies: false +# compile_obj: true +# - cpu: native +# arch: aarch64 +# tag: bun-darwin-aarch64 +# obj: bun-obj-darwin-aarch64 +# artifact: bun-obj-darwin-aarch64 +# webkit_url: "https://github.com/oven-sh/WebKit/releases/download/latest/bun-webkit-macos-arm64-lto.tar.gz" +# runner: macos-arm64 +# dependencies: true +# compile_obj: true +# steps: +# - uses: actions/checkout@v3 +# - name: Checkout submodules +# run: git submodule update --init --recursive --depth=1 --progress -j $(sysctl -n hw.ncpu) +# - name: Install dependencies +# env: +# CPU_TARGET: ${{ matrix.cpu }} +# JSC_BASE_DIR: ${{ runner.temp }}/bun-webkit +# JSC_LIB: ${{ runner.temp }}/bun-webkit/lib +# HOMEBREW_NO_INSTALLED_DEPENDENTS_CHECK: 1 +# HOMEBREW_NO_AUTO_UPDATE: 1 +# HOMEBREW_NO_INSTALL_CLEANUP: 1 +# BUN_DEPLOY_DIR: ${{ runner.temp }}/release/bun +# OBJ_DIR: ${{ runner.temp }}/bun-cpp-obj +# BUN_DEPS_OUT_DIR: ${{runner.temp}}/bun-deps +# run: | +# brew install rust llvm@13 pkg-config coreutils libtool cmake libiconv automake openssl@1.1 ninja gnu-sed pkg-config esbuild --force +# echo "export PATH=$(brew --prefix coreutils)/libexec/gnubin:\$PATH" >> $GITHUB_ENV +# echo "export PATH=$(brew --prefix llvm@13)/bin:\$PATH" >> $GITHUB_ENV +# brew link --overwrite llvm@13 +# - name: Download WebKit +# if: matrix.compile_obj +# env: +# CPU_TARGET: ${{ matrix.cpu }} +# JSC_BASE_DIR: ${{ runner.temp }}/bun-webkit +# JSC_LIB: ${{ runner.temp }}/bun-webkit/lib +# BUN_DEPLOY_DIR: ${{ runner.temp }}/release/bun +# OBJ_DIR: ${{ runner.temp }}/bun-cpp-obj +# BUN_DEPS_OUT_DIR: ${{runner.temp}}/bun-deps +# run: | +# rm -rf $JSC_BASE_DIR +# mkdir -p $JSC_BASE_DIR +# curl -L ${{ matrix.webkit_url }} | tar -xz -C $JSC_BASE_DIR --strip-components=1 +# - name: Compile dependencies +# if: matrix.dependencies +# env: +# CPU_TARGET: ${{ matrix.cpu }} +# JSC_BASE_DIR: ${{ runner.temp }}/bun-webkit +# JSC_LIB: ${{ runner.temp }}/bun-webkit/lib +# BUN_DEPLOY_DIR: ${{ runner.temp }}/release/bun +# OBJ_DIR: ${{ runner.temp }}/bun-cpp-obj +# BUN_DEPS_OUT_DIR: ${{runner.temp}}/bun-deps +# run: | +# mkdir -p $BUN_DEPS_OUT_DIR +# make vendor-without-check +# - name: Compile C++ +# if: matrix.compile_obj +# env: +# CPU_TARGET: ${{ matrix.cpu }} +# JSC_BASE_DIR: ${{ runner.temp }}/bun-webkit +# JSC_LIB: ${{ runner.temp }}/bun-webkit/lib +# BUN_DEPLOY_DIR: ${{ runner.temp }}/release/bun +# OBJ_DIR: ${{ runner.temp }}/bun-cpp-obj +# BUN_DEPS_OUT_DIR: ${{runner.temp}}/bun-deps +# run: | +# mkdir -p $OBJ_DIR +# make -j $(sysctl -n hw.ncpu) jsc-bindings-mac +# - name: Upload C++ +# if: matrix.compile_obj +# uses: actions/upload-artifact@v3 +# with: +# name: ${{ matrix.tag }}-cpp +# path: ${{ runner.temp }}/bun-cpp-obj +# - name: Upload Dependencies +# if: matrix.dependencies +# uses: actions/upload-artifact@v3 +# with: +# name: ${{ matrix.tag }}-deps +# path: ${{runner.temp}}/bun-deps - macOS: - name: macOS Link - runs-on: ${{ matrix.runner }} - needs: [macOS-cpp, macos-object-files] - timeout-minutes: 90 - strategy: - matrix: - include: - - cpu: sandybridge - arch: x86_64 - tag: bun-darwin-x64-baseline - obj: bun-obj-darwin-x64-baseline - package: bun-darwin-x64 - runner: macos-11 - artifact: bun-obj-darwin-x64-baseline - webkit_url: "https://github.com/oven-sh/WebKit/releases/download/latest/bun-webkit-macos-amd64-lto.tar.gz" - - cpu: haswell - arch: x86_64 - tag: bun-darwin-x64 - obj: bun-obj-darwin-x64 - package: bun-darwin-x64 - runner: macos-11 - artifact: bun-obj-darwin-x64 - webkit_url: "https://github.com/oven-sh/WebKit/releases/download/latest/bun-webkit-macos-amd64-lto.tar.gz" - - cpu: native - arch: aarch64 - tag: bun-darwin-aarch64 - obj: bun-obj-darwin-aarch64 - package: bun-darwin-aarch64 - artifact: bun-obj-darwin-aarch64 - webkit_url: "https://github.com/oven-sh/WebKit/releases/download/latest/bun-webkit-macos-arm64-lto.tar.gz" - runner: macos-arm64 - steps: - - uses: actions/checkout@v3 - - name: Checkout submodules - run: git submodule update --init --recursive --depth=1 --progress -j $(sysctl -n hw.ncpu) - - name: Install dependencies - env: - CPU_TARGET: ${{ matrix.cpu }} - JSC_BASE_DIR: ${{ runner.temp }}/bun-webkit - JSC_LIB: ${{ runner.temp }}/bun-webkit/lib - HOMEBREW_NO_INSTALLED_DEPENDENTS_CHECK: 1 - HOMEBREW_NO_AUTO_UPDATE: 1 - HOMEBREW_NO_INSTALL_CLEANUP: 1 - BUN_DEPLOY_DIR: ${{ runner.temp }}/release/bun - OBJ_DIR: ${{ runner.temp }}/bun-cpp-obj - BUN_DEPS_OUT_DIR: ${{runner.temp}}/bun-deps - run: | - brew install rust llvm@13 pkg-config coreutils libtool cmake libiconv automake openssl@1.1 ninja gnu-sed pkg-config esbuild --force - echo "export PATH=$(brew --prefix coreutils)/libexec/gnubin:\$PATH" >> $GITHUB_ENV - echo "export PATH=$(brew --prefix llvm@13)/bin:\$PATH" >> $GITHUB_ENV - brew link --overwrite llvm@13 - - name: Download WebKit - env: - CPU_TARGET: ${{ matrix.cpu }} - JSC_BASE_DIR: ${{ runner.temp }}/bun-webkit - JSC_LIB: ${{ runner.temp }}/bun-webkit/lib - BUN_DEPLOY_DIR: ${{ runner.temp }}/release/bun - OBJ_DIR: ${{ runner.temp }}/bun-cpp-obj - BUN_DEPS_OUT_DIR: ${{runner.temp}}/bun-deps - run: | - rm -rf $JSC_BASE_DIR - mkdir -p $JSC_BASE_DIR - curl -L ${{ matrix.webkit_url }} | tar -xz -C $JSC_BASE_DIR --strip-components=1 - - name: Download C++ - uses: actions/download-artifact@v3 - with: - name: ${{ matrix.tag }}-cpp - path: ${{ runner.temp }}/bun-cpp-obj - - name: Download Dependencies - uses: actions/download-artifact@v3 - with: - name: ${{ matrix.tag }}-deps - path: ${{ runner.temp }}/bun-deps - - name: Download Object - uses: actions/download-artifact@v3 - with: - name: ${{ matrix.obj }} - path: ${{ runner.temp }}/release - - name: Link - env: - CPU_TARGET: ${{ matrix.cpu }} - JSC_BASE_DIR: ${{ runner.temp }}/bun-webkit - JSC_LIB: ${{ runner.temp }}/bun-webkit/lib - BUN_DEPLOY_DIR: ${{ runner.temp }}/release/bun - OBJ_DIR: ${{ runner.temp }}/bun-cpp-obj - BUN_DEPS_OUT_DIR: ${{runner.temp}}/bun-deps - BUN_RELEASE_DIR: ${{ runner.temp }}/release - run: | - rm -rf packages/${{ matrix.package }} - mkdir -p packages/${{ matrix.package }} - mv ${{ runner.temp }}/release/* packages/${{ matrix.package }}/ - make bun-link-lld-release copy-to-bun-release-dir-bin - - name: Zip - env: - CPU_TARGET: ${{ matrix.cpu }} - JSC_BASE_DIR: ${{ runner.temp }}/bun-webkit - JSC_LIB: ${{ runner.temp }}/bun-webkit/lib - BUN_DEPLOY_DIR: ${{ runner.temp }}/release/bun - OBJ_DIR: ${{ runner.temp }}/bun-cpp-obj - BUN_DEPS_OUT_DIR: ${{runner.temp}}/bun-deps - BUN_RELEASE_DIR: ${{ runner.temp }}/release - run: | - cd ${{runner.temp}}/release - chmod +x bun-profile bun +# macOS: +# name: macOS Link +# runs-on: ${{ matrix.runner }} +# needs: [macOS-cpp, macos-object-files] +# timeout-minutes: 90 +# strategy: +# matrix: +# include: +# - cpu: sandybridge +# arch: x86_64 +# tag: bun-darwin-x64-baseline +# obj: bun-obj-darwin-x64-baseline +# package: bun-darwin-x64 +# runner: macos-11 +# artifact: bun-obj-darwin-x64-baseline +# webkit_url: "https://github.com/oven-sh/WebKit/releases/download/latest/bun-webkit-macos-amd64-lto.tar.gz" +# - cpu: haswell +# arch: x86_64 +# tag: bun-darwin-x64 +# obj: bun-obj-darwin-x64 +# package: bun-darwin-x64 +# runner: macos-11 +# artifact: bun-obj-darwin-x64 +# webkit_url: "https://github.com/oven-sh/WebKit/releases/download/latest/bun-webkit-macos-amd64-lto.tar.gz" +# - cpu: native +# arch: aarch64 +# tag: bun-darwin-aarch64 +# obj: bun-obj-darwin-aarch64 +# package: bun-darwin-aarch64 +# artifact: bun-obj-darwin-aarch64 +# webkit_url: "https://github.com/oven-sh/WebKit/releases/download/latest/bun-webkit-macos-arm64-lto.tar.gz" +# runner: macos-arm64 +# steps: +# - uses: actions/checkout@v3 +# - name: Checkout submodules +# run: git submodule update --init --recursive --depth=1 --progress -j $(sysctl -n hw.ncpu) +# - name: Install dependencies +# env: +# CPU_TARGET: ${{ matrix.cpu }} +# JSC_BASE_DIR: ${{ runner.temp }}/bun-webkit +# JSC_LIB: ${{ runner.temp }}/bun-webkit/lib +# HOMEBREW_NO_INSTALLED_DEPENDENTS_CHECK: 1 +# HOMEBREW_NO_AUTO_UPDATE: 1 +# HOMEBREW_NO_INSTALL_CLEANUP: 1 +# BUN_DEPLOY_DIR: ${{ runner.temp }}/release/bun +# OBJ_DIR: ${{ runner.temp }}/bun-cpp-obj +# BUN_DEPS_OUT_DIR: ${{runner.temp}}/bun-deps +# run: | +# brew install rust llvm@13 pkg-config coreutils libtool cmake libiconv automake openssl@1.1 ninja gnu-sed pkg-config esbuild --force +# echo "export PATH=$(brew --prefix coreutils)/libexec/gnubin:\$PATH" >> $GITHUB_ENV +# echo "export PATH=$(brew --prefix llvm@13)/bin:\$PATH" >> $GITHUB_ENV +# brew link --overwrite llvm@13 +# - name: Download WebKit +# env: +# CPU_TARGET: ${{ matrix.cpu }} +# JSC_BASE_DIR: ${{ runner.temp }}/bun-webkit +# JSC_LIB: ${{ runner.temp }}/bun-webkit/lib +# BUN_DEPLOY_DIR: ${{ runner.temp }}/release/bun +# OBJ_DIR: ${{ runner.temp }}/bun-cpp-obj +# BUN_DEPS_OUT_DIR: ${{runner.temp}}/bun-deps +# run: | +# rm -rf $JSC_BASE_DIR +# mkdir -p $JSC_BASE_DIR +# curl -L ${{ matrix.webkit_url }} | tar -xz -C $JSC_BASE_DIR --strip-components=1 +# - name: Download C++ +# uses: actions/download-artifact@v3 +# with: +# name: ${{ matrix.tag }}-cpp +# path: ${{ runner.temp }}/bun-cpp-obj +# - name: Download Dependencies +# uses: actions/download-artifact@v3 +# with: +# name: ${{ matrix.tag }}-deps +# path: ${{ runner.temp }}/bun-deps +# - name: Download Object +# uses: actions/download-artifact@v3 +# with: +# name: ${{ matrix.obj }} +# path: ${{ runner.temp }}/release +# - name: Link +# env: +# CPU_TARGET: ${{ matrix.cpu }} +# JSC_BASE_DIR: ${{ runner.temp }}/bun-webkit +# JSC_LIB: ${{ runner.temp }}/bun-webkit/lib +# BUN_DEPLOY_DIR: ${{ runner.temp }}/release/bun +# OBJ_DIR: ${{ runner.temp }}/bun-cpp-obj +# BUN_DEPS_OUT_DIR: ${{runner.temp}}/bun-deps +# BUN_RELEASE_DIR: ${{ runner.temp }}/release +# run: | +# rm -rf packages/${{ matrix.package }} +# mkdir -p packages/${{ matrix.package }} +# mv ${{ runner.temp }}/release/* packages/${{ matrix.package }}/ +# make bun-link-lld-release copy-to-bun-release-dir-bin +# - name: Zip +# env: +# CPU_TARGET: ${{ matrix.cpu }} +# JSC_BASE_DIR: ${{ runner.temp }}/bun-webkit +# JSC_LIB: ${{ runner.temp }}/bun-webkit/lib +# BUN_DEPLOY_DIR: ${{ runner.temp }}/release/bun +# OBJ_DIR: ${{ runner.temp }}/bun-cpp-obj +# BUN_DEPS_OUT_DIR: ${{runner.temp}}/bun-deps +# BUN_RELEASE_DIR: ${{ runner.temp }}/release +# run: | +# cd ${{runner.temp}}/release +# chmod +x bun-profile bun - mkdir ${{matrix.tag}}-profile - mkdir ${{matrix.tag}} +# mkdir ${{matrix.tag}}-profile +# mkdir ${{matrix.tag}} - /usr/bin/strip bun +# /usr/bin/strip bun - mv bun-profile ${{matrix.tag}}-profile/bun-profile - mv bun ${{matrix.tag}}/bun +# mv bun-profile ${{matrix.tag}}-profile/bun-profile +# mv bun ${{matrix.tag}}/bun - zip -r ${{matrix.tag}}-profile.zip ${{matrix.tag}}-profile - zip -r ${{matrix.tag}}.zip ${{matrix.tag}} - - uses: actions/upload-artifact@v3 - with: - name: profile-${{matrix.tag}} - path: ${{runner.temp}}/release/profile-${{matrix.tag}}.zip - - uses: actions/upload-artifact@v3 - with: - name: ${{matrix.tag}} - path: ${{runner.temp}}/release/${{matrix.tag}}.zip - - name: Upload as Canary - if: github.ref == 'refs/heads/main' - run: | - gh auth login $GITHUB_TOKEN - gh release upload canary ${{runner.temp}}/release/bun*.zip --clobber --repo $GITHUB_REPOSITORY - linux: - name: ${{matrix.tag}} - runs-on: ${{matrix.runner}} - timeout-minutes: 90 - strategy: - matrix: - include: - - cpu: haswell - tag: linux-x64 - arch: x86_64 - build_arch: amd64 - runner: linux-amd64 - - cpu: sandybridge - tag: linux-x64-baseline - arch: x86_64 - build_arch: amd64 - runner: linux-amd64 - - cpu: native - tag: linux-aarch64 - arch: aarch64 - build_arch: arm64 - runner: linux-arm64 - - steps: - - uses: actions/checkout@v3 - - name: Checkout submodules - run: git -c submodule."src/bun.js/WebKit".update=none submodule update --init --recursive --depth=1 --progress -j $(nproc) - - uses: docker/setup-buildx-action@v2 - id: buildx - with: - install: true - - name: Run - run: | - rm -rf ${{runner.temp}}/release - - name: Login to GitHub Container Registry - uses: docker/login-action@v2 - with: - registry: ghcr.io - username: ${{ github.actor }} - password: ${{ secrets.GITHUB_TOKEN }} - - name: Build and push - uses: docker/build-push-action@v3 - with: - context: . - push: false - tags: ghcr.io/oven-sh/bun:canary,ghcr.io/oven-sh/bun:${{github.sha}} - cache-from: type=registry,ref=ghcr.io/oven-sh/bun:buildcache-${{matrix.cpu}}-${{matrix.build_arch}} - cache-to: type=registry,ref=ghcr.io/oven-sh/bun:buildcache-${{matrix.cpu}}-${{matrix.build_arch}},mode=max - build-args: | - ARCH=${{matrix.arch}} - BUILDARCH=${{matrix.build_arch}} - CPU_TARGET=${{matrix.cpu}} - platforms: linux/${{matrix.build_arch}} - target: artifact - outputs: type=local,dest=${{runner.temp}}/release - - name: Zip - run: | - # if zip is not found - if [ ! -x "$(command -v zip)" ]; then - sudo apt-get update && sudo apt-get install -y zip --no-install-recommends - fi - - if [ ! -x "$(command -v strip)" ]; then - sudo apt-get update && sudo apt-get install -y binutils --no-install-recommends - fi - - cd ${{runner.temp}}/release - chmod +x bun-profile bun - - mkdir bun-${{matrix.tag}}-profile - mkdir bun-${{matrix.tag}} - - strip bun - - mv bun-profile bun-${{matrix.tag}}-profile/bun-profile - mv bun bun-${{matrix.tag}}/bun - - zip -r bun-${{matrix.tag}}-profile.zip bun-${{matrix.tag}}-profile - zip -r bun-${{matrix.tag}}.zip bun-${{matrix.tag}} - - uses: actions/upload-artifact@v3 - with: - name: bun-${{matrix.tag}}-profile - path: ${{runner.temp}}/release/bun-${{matrix.tag}}-profile.zip - - uses: actions/upload-artifact@v3 - with: - name: bun-${{matrix.tag}} - path: ${{runner.temp}}/release/bun-${{matrix.tag}}.zip - - name: Release - id: release - uses: softprops/action-gh-release@v1 - if: github.ref == 'refs/heads/main' - with: - prerelease: true - generate_release_notes: true - body: "This is the canary release of Bun that corresponds to the commit [${{ github.sha }}]" - name: "Canary (${{github.sha}})" - tag_name: "canary" - files: | - ${{runner.temp}}/release/${{matrix.tag}}.zip - ${{runner.temp}}/release/${{matrix.tag}}-profile.zip - - uses: actions/upload-artifact@v3 - with: - name: bun-obj-${{matrix.tag}} - path: ${{runner.temp}}/release/bun-obj - - uses: actions/upload-artifact@v3 - with: - name: ${{matrix.tag}}-dependencies - path: ${{runner.temp}}/release/bun-dependencies +# zip -r ${{matrix.tag}}-profile.zip ${{matrix.tag}}-profile +# zip -r ${{matrix.tag}}.zip ${{matrix.tag}} +# - uses: actions/upload-artifact@v3 +# with: +# name: ${{matrix.tag}}-profile +# path: ${{runner.temp}}/release/${{matrix.tag}}-profile.zip +# - uses: actions/upload-artifact@v3 +# with: +# name: ${{matrix.tag}} +# path: ${{runner.temp}}/release/${{matrix.tag}}.zip +# - name: Upload as Canary +# if: github.ref == 'refs/heads/main' +# run: | +# echo "$GITHUB_TOKEN" > ${{runner.temp}}/token.txt +# gh auth login --with-token < cat ${{runner.temp}}/token.txt +# rm -f ${{runner.temp}}/token.txt +# gh release upload canary ${{runner.temp}}/release/bun*.zip --clobber --repo $GITHUB_REPOSITORY |