66 - ' *'
77
88jobs :
9+ macos-sdk :
10+ runs-on : macos-latest
11+ steps :
12+ - id : osxcross-macos-sdk
13+ uses : actions/cache@v2
14+ with :
15+ path : osxcross/tarballs
16+ key : ${{ runner.os }}-osxcross-macos-sdk
17+
18+ - name : Package MacOSX SDK
19+ if : steps.osxcross-macos-sdk.outputs.cache-hit != 'true'
20+ run : |
21+ git clone https://github.com/tpoechtrager/osxcross osxcross
22+ pushd osxcross
23+ XCODEDIR=/Applications/Xcode_12.4.app tools/gen_sdk_package.sh
24+ mv MacOSX*.sdk.tar.xz tarballs/
25+ popd
26+
27+ - uses : actions/upload-artifact@master
28+ with :
29+ name : osxcross-tarballs
30+ path : osxcross/tarballs
31+
932 goreleaser :
1033 runs-on : ubuntu-latest
11- container : fedora:33
34+ container : fedora:34
35+ needs : macos-sdk
1236
1337 steps :
1438 - name : Install dependencies
15- run : dnf -y install git golang mingw{32,64}-gcc{-c++,} mingw{32,64}-{winpthreads,xz-libs}-static glibc-{devel,static}.{i686,x86_64} xz-{devel,static}.{i686,x86_64}
39+ run : |
40+ dnf -y install autoconf bash clang cmake gettext-devel git glibc-{devel,static}.{i686,x86_64} golang libstdc++-static libtool libuuid-devel libxml2-devel llvm-devel make mingw{32,64}-{winpthreads,xz-libs}-static mingw{32,64}-gcc{-c++,} openssl-devel patch po4a xz-{devel,static}.{i686,x86_64}
41+ dnf -y install 'dnf-command(download)'
42+ dnf download --source xz-devel
43+ rpm -ivh *.src.rpm
44+ rm -f *.src.rpm
1645
1746 - name : Setup cross compile environment for Linux ARMv7
1847 env :
1948 CC : arm-linux-gnueabihf-gcc
2049 CXX : arm-linux-gnueabihf-c++
2150 CFLAGS : -fPIC
2251 run : |
23- dnf -y install 'dnf-command(copr)'
2452 dnf -y copr enable lantw44/arm-linux-gnueabihf-toolchain
2553 dnf -y install arm-linux-gnueabihf-{binutils,gcc,glibc}
26- dnf -y install autoconf gettext-devel libtool po4a wget
2754 mkdir /linux-armv7-buildroot
2855 pushd /linux-armv7-buildroot
29- wget https://tukaani.org/xz/xz-5.2.5.tar.gz
30- tar -xvf xz-5.2.5.tar.gz
31- pushd xz-5.2.5
56+ tar -xvf $HOME/rpmbuild/SOURCES/xz-*.tar.xz
57+ pushd $(basename $HOME/rpmbuild/SOURCES/xz-*.tar.xz .tar.xz)
3258 ./autogen.sh
3359 ./configure --host=armv7 --prefix=/linux-armv7-buildroot/sys-root
3460 make -j$(nproc) install
@@ -44,30 +70,37 @@ jobs:
4470 dnf -y install aarch64-linux-gnu-{binutils,gcc,glibc}
4571 mkdir /linux-aarch64-buildroot
4672 pushd /linux-aarch64-buildroot
47- wget https://tukaani.org/xz/xz-5.2.5.tar.gz
48- tar -xvf xz-5.2.5.tar.gz
49- pushd xz-5.2.5
73+ tar -xvf $HOME/rpmbuild/SOURCES/xz-*.tar.xz
74+ pushd $(basename $HOME/rpmbuild/SOURCES/xz-*.tar.xz .tar.xz)
5075 ./autogen.sh
5176 ./configure --host=aarch64 --prefix=/linux-aarch64-buildroot/sys-root
5277 make -j$(nproc) install
5378 popd
5479 popd
5580
56- - id : osxcross-cache
81+ - name : Download osxcross
82+ run : git clone https://github.com/tpoechtrager/osxcross /osxcross
83+
84+ - id : osxcross-target
5785 uses : actions/cache@v2
5886 with :
59- path : /osxcross
60- key : ${{ runner.os }}-osxcross
87+ path : /osxcross/target
88+ key : ${{ runner.os }}-osxcross-target
89+
90+ - uses : actions/download-artifact@master
91+ if : steps.osxcross-target.outputs.cache-hit != 'true'
92+ with :
93+ name : osxcross-tarballs
94+ path : /osxcross/tarballs
95+
96+ - uses : geekyeggo/delete-artifact@v1
97+ with :
98+ name : osxcross-tarballs
6199
62100 - name : Build osxcross
63- if : steps.osxcross-cache.outputs.cache-hit != 'true'
64- run : |
65- git clone https://github.com/tpoechtrager/osxcross /osxcross
66- pushd /osxcross
67- dnf -y install clang llvm-devel libxml2-devel libuuid-devel openssl-devel bash patch libstdc++-static make cmake
68- wget https://s3.dockerproject.org/darwin/v2/MacOSX10.11.sdk.tar.xz -O tarballs/MacOSX10.11.sdk.tar.xz
69- UNATTENDED=1 ./build.sh
70- popd
101+ if : steps.osxcross-target.outputs.cache-hit != 'true'
102+ run : UNATTENDED=1 ./build.sh
103+ working-directory : /osxcross
71104
72105 - name : Setup cross compile environment for Darwin AMD64
73106 env :
@@ -76,11 +109,25 @@ jobs:
76109 run : |
77110 mkdir /darwin-amd64-buildroot
78111 pushd /darwin-amd64-buildroot
79- wget https://tukaani.org/xz/xz-5.2.5.tar.gz
80- tar -xvf xz-5.2.5.tar.gz
81- pushd xz-5.2.5
112+ tar -xvf $HOME/rpmbuild/SOURCES/xz-*.tar.xz
113+ pushd $(basename $HOME/rpmbuild/SOURCES/xz-*.tar.xz .tar.xz)
114+ PATH=/osxcross/target/bin:$PATH ./autogen.sh
115+ PATH=/osxcross/target/bin:$PATH ./configure --host=x86_64-apple-darwin20.2 --prefix=/darwin-amd64-buildroot/sys-root --enable-shared=no
116+ PATH=/osxcross/target/bin:$PATH make -j$(nproc) install
117+ popd
118+ popd
119+
120+ - name : Setup cross compile environment for Darwin AArch64
121+ env :
122+ CC : oa64-clang
123+ CXX : oa64-clang++
124+ run : |
125+ mkdir /darwin-aarch64-buildroot
126+ pushd /darwin-aarch64-buildroot
127+ tar -xvf $HOME/rpmbuild/SOURCES/xz-*.tar.xz
128+ pushd $(basename $HOME/rpmbuild/SOURCES/xz-*.tar.xz .tar.xz)
82129 PATH=/osxcross/target/bin:$PATH ./autogen.sh
83- PATH=/osxcross/target/bin:$PATH ./configure --host=x86_64 -apple-darwin15 --prefix=/darwin-amd64 -buildroot/sys-root --enable-shared=no
130+ PATH=/osxcross/target/bin:$PATH ./configure --host=aarch64 -apple-darwin20.2 --prefix=/darwin-aarch64 -buildroot/sys-root --enable-shared=no
84131 PATH=/osxcross/target/bin:$PATH make -j$(nproc) install
85132 popd
86133 popd
0 commit comments