Update release-crosscompile.yml #23
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: Cross-Compile TCC for Windows & Linux | ||
| on: | ||
| push: | ||
| branches: | ||
| - mob | ||
| pull_request: | ||
| branches: | ||
| - mob | ||
| workflow_dispatch: | ||
| jobs: | ||
| build: | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - name: Checkout source code | ||
| uses: actions/checkout@v4 | ||
| with: | ||
| repository: Tiny-C-Compiler/mirror-repository | ||
| ref: mob | ||
| fetch-depth: 0 | ||
| - name: Install dependencies | ||
| run: | | ||
| echo "Installing dependencies..." | ||
| sudo apt update | ||
| sudo apt install -y mingw-w64 build-essential make autoconf | ||
| - name: Debug: Verify installed compilers | ||
| run: | | ||
| echo "GCC version:" | ||
| gcc --version | ||
| echo "MinGW-w64 version:" | ||
| x86_64-w64-mingw32-gcc --version | ||
| - name: Extract version info | ||
| run: | | ||
| echo "Extracting version info..." | ||
| TCC_VERSION=$(head -n 1 VERSION) | ||
| echo "TCC Version: $TCC_VERSION" | ||
| echo "TCC_VERSION=$TCC_VERSION" >> $GITHUB_ENV | ||
| - name: Compile for Linux | ||
| run: | | ||
| echo "Compiling for Linux..." | ||
| ./configure | ||
| make -j$(nproc) | ||
| strip tcc | ||
| mv tcc tcc-linux | ||
| - name: Compile for Windows (Cross-Compile) | ||
| run: | | ||
| echo "Compiling for Windows..." | ||
| ./configure --cross-prefix=x86_64-w64-mingw32- | ||
| make -j$(nproc) | ||
| strip tcc.exe | ||
| mv tcc.exe tcc-windows.exe | ||
| - name: Debug: List built binaries | ||
| run: ls -lh tcc-linux tcc-windows.exe | ||
| - name: Create Release Assets | ||
| run: | | ||
| mkdir release | ||
| mv tcc-linux release/tcc-linux | ||
| mv tcc-windows.exe release/tcc-windows.exe | ||
| tar -czvf tcc-linux.tar.gz -C release tcc-linux | ||
| zip -r tcc-windows.zip release/tcc-windows.exe | ||
| ls -lh tcc-linux.tar.gz tcc-windows.zip | ||
| - name: Upload to GitHub Releases | ||
| uses: softprops/action-gh-release@v2 | ||
| with: | ||
| token: ${{ secrets.GITHUB_TOKEN }} | ||
| tag_name: latest | ||
| repository: Tiny-C-Compiler/mirror-repository | ||
| name: "Latest TinyCC Build" | ||
| body: "Automated build for TinyCC (Linux & Windows)." | ||
| draft: false | ||
| prerelease: false | ||
| files: | | ||
| tcc-linux.tar.gz | ||
| tcc-windows.zip | ||