-
Notifications
You must be signed in to change notification settings - Fork 0
139 lines (135 loc) · 4.04 KB
/
build.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
name: CI
on:
push:
branches: [ "main" ]
workflow_dispatch:
jobs:
gen_tag:
runs-on: ubuntu-latest
outputs:
TAG: ${{ steps.gen.outputs.TAG }}
TIME: ${{ steps.gen.outputs.TIME }}
steps:
- name: gen
id: gen
run: |
echo "TAG=$(dd if=/dev/urandom bs=32 count=1 2>/dev/null | hexdump -n 4 -e '4/1 "%02x " "\n"' | tr -d ' \n' )" >> "$GITHUB_OUTPUT"
echo "TIME=$(date +%Y%m%d%H%M%S)" >> "$GITHUB_OUTPUT"
build:
runs-on: ubuntu-latest
needs: gen_tag
container:
image: ghcr.io/eebssk1/bbk/debian-bookworm:latest
volumes:
- /root:/user
env:
TAG: ${{ needs.gen_tag.outputs.TAG }}
TIME: ${{ needs.gen_tag.outputs.TIME }}
strategy:
matrix:
target: [linux-native, mingw64-win, mingw64-cross, mingw64-legacy-cross, arm64-cross, arm32-cross, mingw64-legacy-super-cross, musl-cross]
steps:
- name: checkout repo
uses: actions/checkout@v4
- name: swap
run: exec ./swap.sh
- name: checkout binutils
uses: actions/checkout@v4
with:
repository: "eebssk1/m_binutils"
path: "./m_binutils"
- name: checkout gcc
uses: actions/checkout@v4
with:
repository: "eebssk1/m_gcc"
path: "./m_gcc"
- name: enable ccache
uses: hendrikmuhs/[email protected]
with:
verbose: 1
max-size: "1872M"
key: t_${{ matrix.target }}
- name: build
run: exec stdbuf -oL ./exec.sh ${{ matrix.target }}
- name: log rename
run: mv out.log stdout_${{ matrix.target }}.log || true
- name: collect config log
if: (!cancelled())
run: exec ./logtar.sh
- name: upload result
uses: actions/upload-artifact@v4
with:
name: result_${{ matrix.target }}
path: |
./*native.tb2
./*cross*.tb2
- name: upload debug output
if: (!cancelled())
uses: actions/upload-artifact@v4
with:
name: debug_${{ matrix.target }}
path: |
./conflogs*.tgz
./curouts*.tgz
./stdout_*.log
- name: release
uses: ncipollo/[email protected]
with:
allowUpdates: true
artifacts: "*native.tb2,*cross*.tb2,conflogs*.tgz,onelog.txt,stdout_*.log"
commit: main
makeLatest: true
tag: ${{ env.TAG }}
name: ${{ env.TAG }}_${{ env.TIME }}
bodyFile: notes.txt
build-msys:
runs-on: windows-latest
needs: gen_tag
env:
TAG: ${{ needs.gen_tag.outputs.TAG }}
TIME: ${{ needs.gen_tag.outputs.TIME }}
NO_TC_DOWN: 1
defaults:
run:
shell: msys2 {0}
steps:
- name: setup msys2
uses: msys2/setup-msys2@v2
with:
msystem: UCRT64
install: mingw-w64-ucrt-x86_64-toolchain python git gmp-devel mpfr-devel mpc-devel isl-devel zlib-devel libzstd-devel bison flex diffutils make
update: true
location: C:\
- run: git config --global core.autocrlf input
- name: checkout
uses: actions/checkout@v4
- name: build
run: exec ./exec.sh mingw64-msys2
- name: upload result
uses: actions/upload-artifact@v4
with:
name: result_mingw64-msys2
path: |
./*native.tb2
./*cross*.tb2
- name: collect config log
if: (!cancelled())
run: exec ./logtar.sh
- name: upload debug output
if: (!cancelled())
uses: actions/upload-artifact@v4
with:
name: debug_mingw64-msys2
path: |
./conflogs*.tgz
./curouts*.tgz
./stdout_*.log
- name: release
uses: ncipollo/[email protected]
with:
allowUpdates: true
artifacts: "*native.tb2,*cross*.tb2,conflogs*.tgz,onelog.txt,stdout_*.log"
commit: main
makeLatest: true
tag: ${{ env.TAG }}
name: ${{ env.TAG }}_${{ env.TIME }}