|
| 1 | +name: goreleaser |
| 2 | + |
| 3 | +on: |
| 4 | + push: |
| 5 | + tags: |
| 6 | + - '*' |
| 7 | + |
| 8 | +jobs: |
| 9 | + goreleaser: |
| 10 | + runs-on: ubuntu-latest |
| 11 | + container: fedora:latest |
| 12 | + |
| 13 | + steps: |
| 14 | + - 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} |
| 16 | + |
| 17 | + - name: Setup cross compile environment for Linux ARMv7 |
| 18 | + env: |
| 19 | + CC: arm-linux-gnueabihf-gcc |
| 20 | + CXX: arm-linux-gnueabihf-c++ |
| 21 | + CFLAGS: -fPIC |
| 22 | + run: | |
| 23 | + dnf -y install 'dnf-command(copr)' |
| 24 | + dnf -y copr enable lantw44/arm-linux-gnueabihf-toolchain |
| 25 | + dnf -y install arm-linux-gnueabihf-{binutils,gcc,glibc} |
| 26 | + dnf -y install autoconf gettext-devel libtool po4a wget |
| 27 | + mkdir /linux-armv7-buildroot |
| 28 | + 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 |
| 32 | + ./autogen.sh |
| 33 | + ./configure --host=armv7 --prefix=/linux-armv7-buildroot/sys-root |
| 34 | + make -j$(nproc) install |
| 35 | + popd |
| 36 | + popd |
| 37 | +
|
| 38 | + - name: Setup cross compile environment for Linux AArch64 |
| 39 | + env: |
| 40 | + CC: aarch64-linux-gnu-gcc |
| 41 | + CXX: aarch64-linux-gnu-c++ |
| 42 | + run: | |
| 43 | + dnf -y copr enable lantw44/aarch64-linux-gnu-toolchain |
| 44 | + dnf -y install aarch64-linux-gnu-{binutils,gcc,glibc} |
| 45 | + mkdir /linux-aarch64-buildroot |
| 46 | + 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 |
| 50 | + ./autogen.sh |
| 51 | + ./configure --host=aarch64 --prefix=/linux-aarch64-buildroot/sys-root |
| 52 | + make -j$(nproc) install |
| 53 | + popd |
| 54 | + popd |
| 55 | +
|
| 56 | + - id: osxcross-cache |
| 57 | + uses: actions/cache@v2 |
| 58 | + with: |
| 59 | + path: /osxcross |
| 60 | + key: ${{ runner.os }}-osxcross |
| 61 | + |
| 62 | + - 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 |
| 71 | +
|
| 72 | + - name: Setup cross compile environment for Darwin AMD64 |
| 73 | + env: |
| 74 | + CC: o64-clang |
| 75 | + CXX: o64-clang++ |
| 76 | + run: | |
| 77 | + mkdir /darwin-amd64-buildroot |
| 78 | + 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 |
| 82 | + 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 |
| 84 | + PATH=/osxcross/target/bin:$PATH make -j$(nproc) install |
| 85 | + popd |
| 86 | + popd |
| 87 | +
|
| 88 | + - uses: actions/checkout@v2 |
| 89 | + |
| 90 | + - uses: goreleaser/goreleaser-action@v2 |
| 91 | + with: |
| 92 | + version: latest |
| 93 | + args: release --rm-dist |
| 94 | + env: |
| 95 | + GITHUB_TOKEN: '${{ secrets.GITHUB_TOKEN }}' |
0 commit comments