Skip to content

Commit 8f9d4c0

Browse files
authored
Create release-crosscompile.yml
1 parent 770072e commit 8f9d4c0

File tree

1 file changed

+75
-0
lines changed

1 file changed

+75
-0
lines changed
Lines changed: 75 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,75 @@
1+
# Your existing git-sync configuration
2+
on:
3+
schedule:
4+
- cron: '*/15 * * * *'
5+
workflow_dispatch:
6+
7+
jobs:
8+
git-sync:
9+
runs-on: ubuntu-latest
10+
steps:
11+
- name: git-sync
12+
uses: wei/git-sync@v3
13+
with:
14+
source_repo: "https://repo.or.cz/tinycc.git"
15+
source_branch: "mob"
16+
destination_repo: "git@github.com:Tiny-C-Compiler/mirror-repository"
17+
destination_branch: "mob"
18+
ssh_private_key: ${{ secrets.SSH_PRIVATE_KEY }}
19+
20+
build-binaries:
21+
needs: git-sync
22+
runs-on: ubuntu-latest
23+
steps:
24+
- name: Checkout mirror repository
25+
uses: actions/checkout@v3
26+
with:
27+
repository: Tiny-C-Compiler/mirror-repository
28+
ref: mob
29+
ssh-key: ${{ secrets.SSH_PRIVATE_KEY }}
30+
31+
- name: Install cross-compilation tools
32+
run: |
33+
sudo apt-get update
34+
sudo apt-get install -y gcc-mingw-w64-x86-64 build-essential
35+
36+
- name: Build Linux version
37+
run: |
38+
./configure
39+
make
40+
mv tcc tcc-linux
41+
42+
- name: Build Windows version
43+
run: |
44+
./configure --cross-prefix=x86_64-w64-mingw32-
45+
make
46+
mv tcc.exe tcc-windows.exe
47+
48+
- name: Upload artifacts
49+
uses: actions/upload-artifact@v3
50+
with:
51+
name: binaries
52+
path: |
53+
tcc-linux
54+
tcc-windows.exe
55+
56+
create-release:
57+
needs: build-binaries
58+
runs-on: ubuntu-latest
59+
steps:
60+
- name: Download artifacts
61+
uses: actions/download-artifact@v3
62+
with:
63+
name: binaries
64+
65+
- name: Create Release
66+
uses: softprops/action-gh-release@v1
67+
with:
68+
repository: Tiny-C-Compiler/mirror-repository
69+
token: ${{ secrets.MIRROR_REPO_TOKEN }}
70+
tag_name: latest
71+
overwrite: true
72+
files: |
73+
tcc-linux
74+
tcc-windows.exe
75+
body: "Latest cross-platform builds (automatically generated)"

0 commit comments

Comments
 (0)