Skip to content

Commit b4acd5a

Browse files
authored
Update release-crosscompile.yml
1 parent f6d0997 commit b4acd5a

File tree

1 file changed

+56
-34
lines changed

1 file changed

+56
-34
lines changed
Lines changed: 56 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -1,62 +1,84 @@
1-
name: Cross-Compile TinyCC
1+
name: Cross-Compile TCC for Windows & Linux
22

33
on:
44
push:
55
branches:
6-
- main # Change to the branch you want to trigger on
6+
- mob
7+
pull_request:
8+
branches:
9+
- mob
10+
workflow_dispatch:
711

812
jobs:
913
build:
1014
runs-on: ubuntu-latest
11-
strategy:
12-
matrix:
13-
target: [linux, windows]
14-
15+
1516
steps:
16-
- name: Checkout Source
17+
- name: Checkout source code
1718
uses: actions/checkout@v4
18-
19-
- name: Install Dependencies
19+
with:
20+
repository: Tiny-C-Compiler/mirror-repository
21+
ref: mob
22+
fetch-depth: 0
23+
24+
- name: Install dependencies
2025
run: |
26+
echo "Installing dependencies..."
2127
sudo apt update
22-
sudo apt install -y mingw-w64 build-essential
28+
sudo apt install -y mingw-w64 build-essential make autoconf
29+
30+
- name: Debug: Verify installed compilers
31+
run: |
32+
echo "GCC version:"
33+
gcc --version
34+
echo "MinGW-w64 version:"
35+
x86_64-w64-mingw32-gcc --version
36+
37+
- name: Extract version info
38+
run: |
39+
echo "Extracting version info..."
40+
TCC_VERSION=$(head -n 1 VERSION)
41+
echo "TCC Version: $TCC_VERSION"
42+
echo "TCC_VERSION=$TCC_VERSION" >> $GITHUB_ENV
2343
24-
- name: Build for Linux
25-
if: matrix.target == 'linux'
44+
- name: Compile for Linux
2645
run: |
46+
echo "Compiling for Linux..."
2747
./configure
2848
make -j$(nproc)
29-
tar -czvf tinycc-linux.tar.gz tcc
49+
strip tcc
50+
mv tcc tcc-linux
3051
31-
- name: Build for Windows
32-
if: matrix.target == 'windows'
52+
- name: Compile for Windows (Cross-Compile)
3353
run: |
54+
echo "Compiling for Windows..."
3455
./configure --cross-prefix=x86_64-w64-mingw32-
3556
make -j$(nproc)
36-
zip -r tinycc-windows.zip tcc.exe
57+
strip tcc.exe
58+
mv tcc.exe tcc-windows.exe
3759
38-
- name: Upload Artifacts
39-
uses: actions/upload-artifact@v4
40-
with:
41-
name: tinycc-${{ matrix.target }}
42-
path: tinycc-*.*
43-
44-
release:
45-
needs: build
46-
runs-on: ubuntu-latest
60+
- name: Debug: List built binaries
61+
run: ls -lh tcc-linux tcc-windows.exe
4762

48-
steps:
49-
- name: Download Artifacts
50-
uses: actions/download-artifact@v4
51-
with:
52-
path: artifacts
63+
- name: Create Release Assets
64+
run: |
65+
mkdir release
66+
mv tcc-linux release/tcc-linux
67+
mv tcc-windows.exe release/tcc-windows.exe
68+
tar -czvf tcc-linux.tar.gz -C release tcc-linux
69+
zip -r tcc-windows.zip release/tcc-windows.exe
70+
ls -lh tcc-linux.tar.gz tcc-windows.zip
5371
54-
- name: Create GitHub Release
72+
- name: Upload to GitHub Releases
5573
uses: softprops/action-gh-release@v2
5674
with:
75+
token: ${{ secrets.GITHUB_TOKEN }}
5776
tag_name: latest
5877
repository: Tiny-C-Compiler/mirror-repository
59-
files: artifacts/tinycc-*/tinycc-*
60-
token: ${{ secrets.GITHUB_TOKEN }}
61-
prerelease: true
78+
name: "Latest TinyCC Build"
79+
body: "Automated build for TinyCC (Linux & Windows)."
6280
draft: false
81+
prerelease: false
82+
files: |
83+
tcc-linux.tar.gz
84+
tcc-windows.zip

0 commit comments

Comments
 (0)