Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
175 changes: 2 additions & 173 deletions .github/workflows/create-release.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
name: Create Release/Upload Asset

on:
workflow_dispatch:
push:
# Sequence of patterns matched against refs/tags
tags:
Expand All @@ -21,7 +20,7 @@ env:
jobs:
build_on_windows:
name: Create/Upload Release Asset (Windows)
runs-on: windows-latest
runs-on: windows-2025-vs2026
steps:
- name: Checkout code
uses: actions/checkout@v4
Expand Down Expand Up @@ -346,178 +345,8 @@ jobs:
path: tsc.tar.gz
retention-days: 1

build_on_linux_ub20:
name: Create/Upload Release Asset (Ubuntu 20.04)

# The CMake configure and build commands are platform agnostic and should work equally
# well on Windows or Mac. You can convert this to a matrix build if you need
# cross-platform coverage.
# See: https://docs.github.com/en/free-pro-team@latest/actions/learn-github-actions/managing-complex-workflows#using-a-build-matrix
runs-on: ubuntu-20.04

steps:
- uses: actions/checkout@v4

- name: Cache Build 3rd Party
id: cache-3rd-party
uses: actions/cache@v4
with:
path: __build/llvm/ninja
key: ${{ runner.os }}-build-llvm-${{ env.LLVM_VERSION }}-ub20-${{ env.CACHE_VERSION }}

- name: Cache 3rd Party binaries
id: cache-3rd-party-binary
uses: actions/cache@v4
with:
path: 3rdParty
key: ${{ runner.os }}-3rd-party-${{ env.LLVM_VERSION }}-ub20-${{ env.CACHE_VERSION }}

- name: Cache 3rd Party binaries - LLVM ${{ env.LLVM_VERSION }} Release
id: cache-3rd-party-binary-llvm-release
uses: actions/cache@v4
with:
path: llvm_${{ env.LLVM_VERSION }}_release_UB20.tgz
key: ${{ runner.os }}-3rd-party-llvm-${{ env.LLVM_VERSION }}-release-ub20-${{ env.CACHE_VERSION }}

- name: Retrieve version
run: echo "TAG_NAME=$(git describe --abbrev=0 --tags)" >> $GITHUB_OUTPUT
id: version

- name: Delete __Build TS folders
continue-on-error: true
run: rm -R ./__build/tsc/ninja/release
shell: sh

- name: Create __Build Folders
run: mkdir -p ./__build/tsc/ninja/release; mkdir -p ./__build/gc/ninja/release
shell: sh

- name: Download 3rd party - LLVM
continue-on-error: true
shell: sh
run: |
if test ! -f "llvm_${{ env.LLVM_VERSION }}_release_UB20.tgz"; then
curl --insecure -L "${{ env.LLVM_UB20_TARGZFILE }}" --output llvm_${{ env.LLVM_VERSION }}_release_UB20.tgz
fi

- name: UnZip 3rd party - LLVM
continue-on-error: false
shell: sh
run: |
if test -f "llvm_${{ env.LLVM_VERSION }}_release_UB20.tgz"; then
file llvm_${{ env.LLVM_VERSION }}_release_UB20.tgz; mkdir -p ./3rdParty/llvm; tar -xf llvm_${{ env.LLVM_VERSION }}_release_UB20.tgz -C ./3rdParty/llvm/
fi

- name: Download 3rd party source - GC
continue-on-error: true
shell: sh
run: curl --insecure -L https://github.com/bdwgc/bdwgc/releases/download/v${{ env.GC_VERSION }}/gc-${{ env.GC_VERSION }}.tar.gz --output gc-${{ env.GC_VERSION }}.tar.gz

- name: Download 3rd party source - GC:Atomic_ops
continue-on-error: true
shell: sh
run: curl --insecure -L https://github.com/bdwgc/libatomic_ops/releases/download/v${{ env.LIBATOMIC_OPS_VERSION }}/libatomic_ops-${{ env.LIBATOMIC_OPS_VERSION }}.tar.gz --output libatomic_ops-${{ env.LIBATOMIC_OPS_VERSION }}.tar.gz

- name: UnZip 3rd party source - GC
continue-on-error: false
shell: sh
run: tar -xvzf gc-${{ env.GC_VERSION }}.tar.gz -C ./3rdParty/

- name: UnZip 3rd party source - GC:Atomic_ops
continue-on-error: false
shell: sh
run: tar -xvzf libatomic_ops-${{ env.LIBATOMIC_OPS_VERSION }}.tar.gz -C ./3rdParty/

- name: Copy Atomic_ops to GC
continue-on-error: false
shell: sh
run: cp -a ./3rdParty/libatomic_ops-${{ env.LIBATOMIC_OPS_VERSION }}/ ./3rdParty/gc-${{ env.GC_VERSION }}/libatomic_ops/

- name: Install Ninja
continue-on-error: false
shell: sh
run: sudo apt install ninja-build

# - name: Install Clang 12
# continue-on-error: false
# shell: sh
# run: sudo apt install clang-12

- name: Configure GC
continue-on-error: false
working-directory: ${{github.workspace}}/__build/gc/ninja/release
shell: sh
run: cmake ../../../../3rdParty/gc-${{ env.GC_VERSION }} -G "Ninja" -DCMAKE_BUILD_TYPE=${{ env.BUILD_TYPE }} -Wno-dev -DCMAKE_POSITION_INDEPENDENT_CODE=ON -DCMAKE_INSTALL_PREFIX=${{github.workspace}}/3rdParty/gc/release -DBUILD_SHARED_LIBS=OFF -Denable_threads=ON -Denable_cplusplus=OFF -Denable_docs=OFF

- name: Build GC
continue-on-error: false
working-directory: ${{github.workspace}}/__build/gc/ninja/release
shell: sh
run: cmake --build . --config ${{ env.BUILD_TYPE }} -j 8

- name: Install GC
continue-on-error: false
working-directory: ${{github.workspace}}/__build/gc/ninja/release
shell: sh
# Generates the BDWgc CMake package files (lib/cmake/bdwgc/BDWgcConfig.cmake)
# that the tsc build looks up via find_package(BDWgc CONFIG).
run: cmake --install . --config ${{ env.BUILD_TYPE }}

- name: Configure
continue-on-error: false
working-directory: ${{github.workspace}}/__build/tsc/ninja/release
shell: sh
run: cmake ../../../../tsc -G "Ninja" -DCMAKE_BUILD_TYPE=${{ env.BUILD_TYPE }} -DTSC_PACKAGE_VERSION:STRING="${{ steps.version.outputs.TAG_NAME }}" -Wno-dev

- name: Build
continue-on-error: false
working-directory: ${{github.workspace}}/__build/tsc/ninja/release
shell: sh
run: cmake --build . --config ${{ env.BUILD_TYPE }} -j 4

- name: Test
continue-on-error: false
working-directory: ${{github.workspace}}/__build/tsc/ninja/release
shell: sh
# Execute tests defined by the CMake configuration.
# See https://cmake.org/cmake/help/latest/manual/ctest.1.html for more detail
run: ctest -j1 -C ${{ env.BUILD_TYPE }} -T test --output-on-failure -T test --output-on-failure
env:
LLVM_SYMBOLIZER_PATH: ${{github.workspace}}/3rdParty/llvm/release/bin

# Replicates installDefaultLib() from tsc/defaultlib.cpp: clone the default
# library sources and build them against the tsc/gc/llvm/runtime we just built.
- name: Clone Default Library
continue-on-error: false
working-directory: ${{github.workspace}}
shell: sh
run: if [ ! -d "./TypeScriptCompilerDefaultLib" ]; then git clone https://github.com/ASDAlexander77/TypeScriptCompilerDefaultLib.git; fi

- name: Build Default Library
continue-on-error: false
working-directory: ${{github.workspace}}/TypeScriptCompilerDefaultLib
shell: sh
env:
TOOL_PATH: ${{github.workspace}}/__build/tsc/ninja/release/bin
GC_LIB_PATH: ${{github.workspace}}/__build/gc/ninja/release
LLVM_LIB_PATH: ${{github.workspace}}/3rdParty/llvm/release/lib
TSC_LIB_PATH: ${{github.workspace}}/__build/tsc/ninja/release/lib
run: chmod +x ./build.sh ./scripts/*.sh; ./build.sh release

- name: Create Tar.GZ of Linux Asset
working-directory: ${{github.workspace}}/__build
shell: sh
run: tar -czvhf ../tsc-ub20.tar.gz ./tsc/ninja/release/bin/tsc ./tsc/ninja/release/lib/libTypeScriptRuntime.so ./gc/ninja/release/libgc.a ./tsc/ninja/release/lib/libTypeScriptAsyncRuntime.a ../3rdParty/llvm/release/bin/wasm-ld ../3rdParty/llvm/release/lib/libLLVMSupport.a ../3rdParty/llvm/release/lib/libLLVMDemangle.a -C ../TypeScriptCompilerDefaultLib/__build/release .

- name: Archive Tar.GZ of Linux Asset
uses: actions/upload-artifact@v4
with:
name: tsc-linux-asset-ub20
path: tsc-ub20.tar.gz
retention-days: 1

create_release:
needs: [build_on_windows, build_on_linux, build_on_linux_ub20]
needs: [build_on_windows, build_on_linux]
name: Create Release
runs-on: ubuntu-latest
steps:
Expand Down
11 changes: 0 additions & 11 deletions tsc/tsc/defaultlib.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -213,15 +213,6 @@ int buildWin32(const SmallVectorImpl<char>& appPath, SmallVectorImpl<char>& buil

auto cmdPath = fromPath.get();

fromPath = llvm::sys::findProgramByName("vswhere");
if (!fromPath)
{
llvm::WithColor::error(llvm::errs(), "tsc") << "'vswhere' not found on PATH" << "\n";
return -1;
}

auto vswherePath = fromPath.get();

std::optional<StringRef> redirects[] = {
std::nullopt, // Stdin
std::nullopt, // Stdout
Expand All @@ -242,14 +233,12 @@ int buildWin32(const SmallVectorImpl<char>& appPath, SmallVectorImpl<char>& buil
std::string llvmLibPathVar = llvm::formatv("{0}={1}", "LLVM_LIB_PATH", llvmLibPath);
std::string tscLibPathVar = llvm::formatv("{0}={1}", "TSC_LIB_PATH", tscLibPath);
std::string defaultLibPathVar = llvm::formatv("{0}={1}", "DEFAULT_LIB_PATH", defaultLibPath);
std::string vswherePathVar = llvm::formatv("{0}={1}", "VSWHERE_PATH", vswherePath);

PUTENV(appPathVar.data());
PUTENV(gcLibPathVar.data());
PUTENV(llvmLibPathVar.data());
PUTENV(tscLibPathVar.data());
PUTENV(defaultLibPathVar.data());
PUTENV(vswherePathVar.data());

std::string errMsg;
auto returnCode = sys::ExecuteAndWait(
Expand Down
Loading