Skip to content

Commit

Permalink
Create build.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
Gillou68310 committed Mar 26, 2024
1 parent 62c37f1 commit f046a63
Showing 1 changed file with 83 additions and 0 deletions.
83 changes: 83 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -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 }}

0 comments on commit f046a63

Please sign in to comment.