|
| 1 | +name: Win/Mac/Linux |
| 2 | + |
| 3 | +on:2_45_1 |
| 4 | + push: |
| 5 | + branches: |
| 6 | + - binutils-2_46-cedev |
| 7 | + workflow_dispatch: |
| 8 | + |
| 9 | +jobs: |
| 10 | + build: |
| 11 | + strategy: |
| 12 | + fail-fast: false |
| 13 | + matrix: |
| 14 | + runs-on: [ubuntu-22.04, macos-15-intel, macos-14, windows-latest] |
| 15 | + include: |
| 16 | + - runs-on: ubuntu-22.04 |
| 17 | + install-output-ext: "tar.gz" |
| 18 | + - runs-on: macos-15-intel |
| 19 | + arch-suffix: "-intel" |
| 20 | + install-output-ext: "tar.gz" |
| 21 | + - runs-on: macos-14 |
| 22 | + arch-suffix: "-arm" |
| 23 | + install-output-ext: "tar.gz" |
| 24 | + - runs-on: windows-latest |
| 25 | + install-output-ext: "tar.gz" |
| 26 | + runs-on: ${{ matrix.runs-on }} |
| 27 | + steps: |
| 28 | + - name: Checkout binutils |
| 29 | + uses: actions/checkout@v4 |
| 30 | + with: |
| 31 | + submodules: recursive |
| 32 | + |
| 33 | + - name: "[Linux] Install dependencies" |
| 34 | + if: runner.os == 'Linux' |
| 35 | + run: sudo apt-get update && sudo apt-get install -y texinfo libreadline-dev libgmp-dev libmpfr-dev |
| 36 | + |
| 37 | + - name: "[macOS] Install dependencies" |
| 38 | + if: runner.os == 'macOS' |
| 39 | + run: brew install texinfo gmp mpfr |
| 40 | + |
| 41 | + - name: Setup MSYS2 |
| 42 | + if: runner.os == 'Windows' |
| 43 | + uses: msys2/setup-msys2@v2 |
| 44 | + with: |
| 45 | + msystem: MINGW64 |
| 46 | + update: false |
| 47 | + cache: true |
| 48 | + install: >- |
| 49 | + mingw-w64-x86_64-toolchain |
| 50 | + mingw-w64-x86_64-autotools |
| 51 | + mingw-w64-x86_64-gettext-tools |
| 52 | + make |
| 53 | + texinfo |
| 54 | + bison |
| 55 | + flex |
| 56 | + gmp |
| 57 | + mpfr |
| 58 | +
|
| 59 | + - name: "[Linux] Build binutils" |
| 60 | + if: runner.os == 'Linux' |
| 61 | + shell: bash |
| 62 | + run: | |
| 63 | + ./configure --target=z80-none-elf --with-zstd=no --disable-sim --disable-nls --disable-plugins --without-python --prefix="${{ runner.temp }}/binutils" |
| 64 | + make -j4 && make install-strip -j4 |
| 65 | +
|
| 66 | + - name: "[macOS] Build binutils" |
| 67 | + if: runner.os == 'macOS' |
| 68 | + shell: bash |
| 69 | + run: | |
| 70 | + ./configure --target=z80-none-elf --with-zstd=no --disable-sim --disable-nls --disable-plugins --without-python --with-system-zlib --with-gmp=$(brew --prefix gmp) --with-mpfr=$(brew --prefix mpfr) --prefix="${{ runner.temp }}/binutils" |
| 71 | + make -j4 && make install-strip -j4 |
| 72 | +
|
| 73 | + - name: "[Windows] Build binutils" |
| 74 | + if: runner.os == 'Windows' |
| 75 | + shell: msys2 {0} |
| 76 | + run: | |
| 77 | + export ac_cv_header_term_h=no |
| 78 | + export ac_cv_header_ncurses_term_h=no |
| 79 | + export ac_cv_search_tgetent=no |
| 80 | + PREFIX=$(cygpath -m "${{ runner.temp }}/binutils") |
| 81 | + ./configure --target=z80-none-elf --disable-tui --without-curses --with-zstd=no --disable-sim --disable-nls --disable-plugins --disable-shared --enable-static --without-python --prefix="$PREFIX" |
| 82 | + make configure-host && make -j4 LDFLAGS="-all-static" MAKEINFO=true && make install-strip -j4 MAKEINFO=true |
| 83 | +
|
| 84 | + - name: "[Unix] Install License Files" |
| 85 | + if: runner.os != 'Windows' |
| 86 | + shell: bash |
| 87 | + run: | |
| 88 | + mkdir -p "${{ runner.temp }}/binutils/license" |
| 89 | + cp COPYING3 "${{ runner.temp }}/binutils/license" |
| 90 | + cp COPYING3.LIB "${{ runner.temp }}/binutils/license" |
| 91 | + cp readme.txt "${{ runner.temp }}/binutils" |
| 92 | + - name: "[Windows] Install License Files" |
| 93 | + if: runner.os == 'Windows' |
| 94 | + shell: pwsh |
| 95 | + run: | |
| 96 | + New-Item -ItemType Directory -Force -Path "${{ runner.temp }}\binutils\license" |
| 97 | + Copy-Item COPYING3 -Destination "${{ runner.temp }}\binutils\license" |
| 98 | + Copy-Item COPYING3.LIB -Destination "${{ runner.temp }}\binutils\license" |
| 99 | + Copy-Item readme.txt -Destination "${{ runner.temp }}\binutils" |
| 100 | +
|
| 101 | + - name: "[Unix] Tar install" |
| 102 | + if: runner.os != 'Windows' |
| 103 | + shell: bash |
| 104 | + run: | |
| 105 | + cd ${{ runner.temp }} && tar -chzvf binutils-${{ runner.os }}.${{ matrix.install-output-ext }} --exclude='z80-none-elf' --exclude='lib' binutils |
| 106 | + mv ${{ runner.temp }}/binutils-${{ runner.os }}.${{ matrix.install-output-ext }} ${{github.workspace}} |
| 107 | +
|
| 108 | + - name: "[Windows] Tar install" |
| 109 | + if: runner.os == 'Windows' |
| 110 | + shell: pwsh |
| 111 | + run: | |
| 112 | + Set-Location "${{ runner.temp }}" |
| 113 | + tar -chzvf "binutils-${{ runner.os }}.${{ matrix.install-output-ext }}" --exclude='z80-none-elf' --exclude='lib' binutils |
| 114 | + Move-Item "binutils-${{ runner.os }}.${{ matrix.install-output-ext }}" "${{ github.workspace }}" |
| 115 | +
|
| 116 | + - name: Upload binutils |
| 117 | + uses: actions/upload-artifact@v4 |
| 118 | + with: |
| 119 | + name: binutils-${{ runner.os }}${{ matrix.arch-suffix }} |
| 120 | + path: binutils-${{ runner.os }}.${{ matrix.install-output-ext }} |
| 121 | + |
| 122 | + |
| 123 | + nightly: |
| 124 | + runs-on: ubuntu-latest |
| 125 | + needs: [build] |
| 126 | + if: github.event_name != 'pull_request' |
| 127 | + |
| 128 | + steps: |
| 129 | + - name: Download Ubuntu binutils |
| 130 | + uses: actions/download-artifact@v4 |
| 131 | + with: |
| 132 | + name: binutils-Linux |
| 133 | + path: ${{github.workspace}}/ubuntu |
| 134 | + |
| 135 | + - name: Download macOS Intel binutils |
| 136 | + uses: actions/download-artifact@v4 |
| 137 | + with: |
| 138 | + name: binutils-macOS-intel |
| 139 | + path: ${{github.workspace}}/macos-intel |
| 140 | + |
| 141 | + - name: Download macOS ARM binutils |
| 142 | + uses: actions/download-artifact@v4 |
| 143 | + with: |
| 144 | + name: binutils-macOS-arm |
| 145 | + path: ${{github.workspace}}/macos-arm |
| 146 | + |
| 147 | + - name: Download Windows binutils |
| 148 | + uses: actions/download-artifact@v4 |
| 149 | + with: |
| 150 | + name: binutils-Windows |
| 151 | + path: ${{github.workspace}}/windows |
| 152 | + |
| 153 | + - name: Create Ubunutu Nightly |
| 154 | + run: | |
| 155 | + cd ubuntu |
| 156 | + mv binutils-Linux.tar.gz ../binutils_ubuntu_nightly.tar.gz |
| 157 | +
|
| 158 | + - name: Create macOS Intel Nightly |
| 159 | + run: | |
| 160 | + cd macos-intel |
| 161 | + mv binutils-macOS.tar.gz ../binutils_macos_intel_nightly.tar.gz |
| 162 | +
|
| 163 | + - name: Create macOS ARM Nightly |
| 164 | + run: | |
| 165 | + cd macos-arm |
| 166 | + mv binutils-macOS.tar.gz ../binutils_macos_arm_nightly.tar.gz |
| 167 | +
|
| 168 | + - name: Create Windows Nightly |
| 169 | + run: | |
| 170 | + cd windows |
| 171 | + tar -xzvf binutils-Windows.tar.gz |
| 172 | + zip -r9 ../binutils_windows_nightly.zip binutils |
| 173 | +
|
| 174 | + - name: Create Nightly Release |
| 175 | + uses: softprops/action-gh-release@5122b4edc95f85501a71628a57dc180a03ec7588 |
| 176 | + with: |
| 177 | + tag_name: nightly |
| 178 | + name: Nightly Build |
| 179 | + prerelease: true |
| 180 | + files: | |
| 181 | + binutils_ubuntu_nightly.tar.gz |
| 182 | + binutils_macos_intel_nightly.tar.gz |
| 183 | + binutils_macos_arm_nightly.tar.gz |
| 184 | + binutils_windows_nightly.zip |
0 commit comments