Skip to content

Update keep-alive.yml #29

Update keep-alive.yml

Update keep-alive.yml #29

name: Cross-Compile TCC for Windows
on:
push:
branches:
- main
pull_request:
branches:
- main
jobs:
build:
runs-on: ubuntu-latest
steps:
# Step 1: Checkout the repository
- name: Checkout Repository
uses: actions/checkout@v2
# Step 2: Download the mob.zip
- name: Download TCC Mirror Repository
run: |
echo "Downloading TCC Mirror Repository..."
curl -L -o tcc_mob.zip https://github.com/Tiny-C-Compiler/mirror-repository/archive/refs/heads/mob.zip
unzip -q tcc_mob.zip
mv mirror-repository-mob tcc_source
echo "Download and extraction complete."
# Step 3: Install cross-compilation tools (MinGW for Windows)
- name: Install MinGW and Dependencies
run: |
echo "Installing MinGW for cross-compilation..."
sudo apt-get update
sudo apt-get install -y mingw-w64 build-essential
echo "MinGW and dependencies installed."
# Step 4: Build TCC for Windows (Cross-compiling)
- name: Build TCC for Windows
run: |
echo "Navigating to TCC source directory..."
cd tcc_source
echo "Starting the cross-compilation process for Windows..."
# Debug: Show the contents of the directory
ls -l
# Set up the cross-compilation environment
export CC=x86_64-w64-mingw32-gcc
export CXX=x86_64-w64-mingw32-g++
export AR=x86_64-w64-mingw32-ar
export RANLIB=x86_64-w64-mingw32-ranlib
# Debug: Check environment variables
echo "Using cross-compiler: $CC"
echo "Starting to compile TCC..."
# Configure and make with debugging output
./configure --host=x86_64-w64-mingw32 --prefix=$PWD/mingw-windows
make clean
make -j$(nproc)
# Debug: Show make result
echo "Compilation finished. Checking for errors in the build..."
make check
echo "TCC for Windows cross-compilation completed."
# Step 5: Archive the Windows binaries
- name: Archive Windows Binaries
run: |
echo "Archiving Windows binaries..."
tar -czf tcc-windows.tar.gz -C tcc_source mingw-windows
echo "Windows binaries archived."
# Step 6: Upload the Windows binaries
- name: Upload Windows Binaries
uses: actions/upload-artifact@v2
with:
name: tcc-windows
path: tcc-windows.tar.gz