gcc-papermario/.github/workflows/build.yml
2021-10-26 01:01:01 +09:00

71 lines
2.4 KiB
YAML

name: Compile gcc
on: [push]
jobs:
build:
runs-on: ${{ matrix.TARGET.OS }}
strategy:
fail-fast: false
matrix:
TARGET:
- {
OS: 'ubuntu-latest',
CFLAGS: '-std=gnu89 -m32 -static',
HOST: 'i386-pc-linux',
ARCHIVE_NAME: 'linux.tar'
}
- {
OS: 'macos-latest',
CFLAGS: '-std=gnu89 -Wno-return-type -Wno-error -Wno-implicit-function-declaration',
HOST: 'i386-apple-darwin',
ARCHIVE_NAME: 'mac.tar'
}
name: Building gcc for ${{ matrix.TARGET.OS }}
steps:
- uses: actions/checkout@v2
- 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 file gperf
echo "deb http://old-releases.ubuntu.com/ubuntu zesty main" | sudo tee /etc/apt/sources.list.d/zesty.list
sudo apt-add-repository -r universe
sudo apt update
sudo apt install -y gcc-6 gcc-6-multilib
sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-6 1
- name: Configure for mips-nintendo-nu64
shell: bash
run: |
./configure --target=mips-nintendo-nu64 --prefix=/opt/cross --with-gnu-as --disable-gprof --disable-gdb --disable-werror --host=${{ matrix.TARGET.HOST }} --build=${{ matrix.TARGET.HOST }}
- name: Make everything except cpp
continue-on-error: true
shell: bash
run: |
make cpp cc1 xgcc cc1plus g++ CFLAGS="${{ matrix.TARGET.CFLAGS }}"
- name: Test for file
shell: bash
run: |
test -f cc1
file cc1
- name: Start release archive
shell: bash
run: |
cp xgcc gcc
tar -czf ${{ matrix.TARGET.ARCHIVE_NAME }} cc1 gcc cc1plus g++ cpp
- name: Upload archive
uses: actions/upload-artifact@v2
with:
name: gcc-2.8.1-${{ matrix.TARGET.OS }}
path: |
${{ matrix.TARGET.ARCHIVE_NAME }}.gz
- name: Update release
uses: johnwbyrd/update-release@v1.0.0
if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/master' }}
with:
token: ${{ secrets.GITHUB_TOKEN }}
files: ${{ matrix.TARGET.ARCHIVE_NAME }}.gz