-
Notifications
You must be signed in to change notification settings - Fork 26
96 lines (86 loc) · 3.16 KB
/
ci.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
name: CI
on: [push, pull_request]
jobs:
build:
env:
BINUTILS_RELEASE: 2.28
GCC_RELEASE: 7.1.0
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v3
- name: Set environment variables
id: vars
run: |
echo "sha_short=$(git rev-parse --short HEAD)" >> $GITHUB_OUTPUT
- name: Dependency packages
run: |
sudo apt update
sudo apt install -y autoconf bison build-essential flex gettext git lhasa libgmp-dev libmpc-dev libmpfr-dev ncurses-dev rsync texinfo wget tzdata zopfli python3-pip
python3 -m pip install --user -U pip setuptools
python3 -m pip install --user crcmod cython
python3 -m pip install --user -U git+https://github.com/cnvogelg/amitools.git
- name: Cache toolchain
id: cache-toolchain
uses: actions/cache@v3
with:
path: ~/cross
key: ${{ runner.os }}-${{ env.BINUTILS_RELEASE }}-${{ env.GCC_RELEASE }}
- name: Build toolchain
if: steps.cache-toolchain.outputs.cache-hit != 'true'
env:
MAKE_OPTS: -j4
MAKE_DIR: cross
run: |
git config --global pull.rebase false
export MDIR=$HOME/${MAKE_DIR}
mkdir -p $MDIR/bin
export PATH=$PATH:$MDIR
mkdir ~/_tc && cd ~/_tc
wget https://ftp.gnu.org/gnu/binutils/binutils-${BINUTILS_RELEASE}.tar.bz2
wget https://ftp.gnu.org/gnu/gcc/gcc-${GCC_RELEASE}/gcc-${GCC_RELEASE}.tar.bz2
wget http://sun.hasenbraten.de/vasm/release/vasm.tar.gz
wget http://sun.hasenbraten.de/vlink/release/vlink.tar.gz
tar xf binutils-${BINUTILS_RELEASE}.tar.bz2
tar xf gcc-${GCC_RELEASE}.tar.bz2
tar xf vasm.tar.gz
tar xf vlink.tar.gz
cd binutils-${BINUTILS_RELEASE}
./configure --prefix=$MDIR --target=m68k-unknown-elf
make ${MAKE_OPTS}
make install
cd ../gcc-${GCC_RELEASE}
sed -i 's/--check/-c/g' contrib/download_prerequisites
./contrib/download_prerequisites
mkdir ../gcc-build && cd ../gcc-build
../gcc-${GCC_RELEASE}/configure --prefix=$MDIR --target=m68k-unknown-elf --enable-languages=c --disable-libssp
make ${MAKE_OPTS}
make install
cd ../vasm
make ${MAKE_OPTS} CPU=m68k SYNTAX=mot
cp vasmm68k_mot vobjdump $MDIR/bin/
cd ../vlink
make ${MAKE_OPTS}
cp vlink $MDIR/bin/
cd ..
git clone https://github.com/bebbo/amiga-gcc.git
cd amiga-gcc
make update
make all ${MAKE_OPTS} PREFIX=$MDIR
- name: Build dist
run: |
export PATH=$PATH:~/cross/bin
export VER=${{ steps.vars.outputs.sha_short }}
make all
cd testkit
make clean && make -j4 all VER=$VER
rm AmigaTestKit-$VER/RELEASE_NOTES
git rev-parse HEAD >AmigaTestKit-$VER/COMMIT
cd ..
mkdir -p _cidist/amiga-stuff.ci.$VER
mv testkit/AmigaTestKit-$VER _cidist/amiga-stuff.ci.$VER
cp -a host_tools inflate _cidist/amiga-stuff.ci.$VER
- name: Upload artifacts
uses: actions/upload-artifact@v3
with:
name: amiga-stuff.ci.${{ steps.vars.outputs.sha_short }}
path: _cidist