diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml new file mode 100644 index 00000000000..d8ea0d996e8 --- /dev/null +++ b/.github/workflows/build.yml @@ -0,0 +1,83 @@ +name: Build + +on: [push, pull_request] + +jobs: + build: + runs-on: ${{ matrix.TARGET.OS }} + strategy: + fail-fast: false + matrix: + TARGET: + - { + OS: 'ubuntu-latest', + CFLAGS: '-static -fno-stack-protector -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=0', + HOST: 'i386-pc-linux', + ARCHIVE_NAME: 'binutils-mips-ps2-decompals-linux-x86-64.tar.gz' + } + + name: Building binutils for ${{ matrix.TARGET.OS }} ${{ matrix.TARGET.HOST }} + steps: + - uses: actions/checkout@v3 + + - name: Install dependencies (Ubuntu) + shell: bash + if: matrix.TARGET.OS == 'ubuntu-latest' + run: | + sudo apt-get update + sudo apt-get install -y build-essential bison + + - name: Configure for mips + shell: bash + run: | + ./configure --target=mips --prefix=/opt/cross --disable-gprofng --disable-gdb --disable-werror --host=${{ matrix.TARGET.HOST }} --build=${{ matrix.TARGET.HOST }} + + - name: Make + shell: bash + run: | + make CFLAGS="${{ matrix.TARGET.CFLAGS }}" + + - name: Test for file + shell: bash + run: | + test -f binutils/ar + file binutils/ar + + - name: Create release archive + shell: bash + run: | + cp binutils/ar mips-ps2-decompals-ar + cp gas/as-new mips-ps2-decompals-as + cp binutils/strip-new mips-ps2-decompals-strip + cp binutils/objcopy mips-ps2-decompals-objcopy + cp binutils/objdump mips-ps2-decompals-objdump + cp binutils/cxxfilt mips-ps2-decompals-c++filt + cp binutils/nm-new mips-ps2-decompals-nm + strip mips-ps2-decompals-ar + strip mips-ps2-decompals-as + strip mips-ps2-decompals-strip + strip mips-ps2-decompals-objcopy + strip mips-ps2-decompals-objdump + strip mips-ps2-decompals-c++filt + strip mips-ps2-decompals-nm + chmod +x mips-ps2-decompals-ar + chmod +x mips-ps2-decompals-as + chmod +x mips-ps2-decompals-strip + chmod +x mips-ps2-decompals-objcopy + chmod +x mips-ps2-decompals-objdump + chmod +x mips-ps2-decompals-c++filt + chmod +x mips-ps2-decompals-nm + tar -czf ${{ matrix.TARGET.ARCHIVE_NAME }} mips-ps2-decompals-ar mips-ps2-decompals-as mips-ps2-decompals-strip mips-ps2-decompals-objcopy mips-ps2-decompals-objdump mips-ps2-decompals-c++filt mips-ps2-decompals-nm + + - name: Upload archive + uses: actions/upload-artifact@v2 + with: + name: binutils-mips-ps2-decompals-${{ matrix.TARGET.OS }}-${{ matrix.TARGET.HOST }} + path: | + ${{ matrix.TARGET.ARCHIVE_NAME }} + + - name: Publish release + uses: softprops/action-gh-release@v1 + if: startsWith(github.ref, 'refs/tags/') + with: + files: ${{ matrix.TARGET.ARCHIVE_NAME }}