Skip to content

[ci] include license files #25

[ci] include license files

[ci] include license files #25

Workflow file for this run

name: Win/Mac/Linux
on:
push:
branches:
- binutils-2_45_1-cedev
workflow_dispatch:
jobs:
build:
strategy:
fail-fast: false
matrix:
runs-on: [ubuntu-22.04, macos-15-intel, macos-14, windows-latest]
include:
- runs-on: ubuntu-22.04
install-output-ext: "tar.gz"
- runs-on: macos-15-intel
arch-suffix: "-intel"
install-output-ext: "tar.gz"
- runs-on: macos-14
arch-suffix: "-arm"
install-output-ext: "tar.gz"
- runs-on: windows-latest
install-output-ext: "tar.gz"
runs-on: ${{ matrix.runs-on }}
steps:
- name: Checkout binutils
uses: actions/checkout@v4
with:
submodules: recursive
- name: "[Linux] Install dependencies"
if: runner.os == 'Linux'
run: sudo apt-get update && sudo apt-get install -y texinfo
- name: "[macOS] Install dependencies"
if: runner.os == 'macOS'
run: brew install texinfo
- name: Setup MSYS2
if: runner.os == 'Windows'
uses: msys2/setup-msys2@v2
with:
msystem: MINGW64
update: false
cache: true
install: >-
mingw-w64-x86_64-toolchain
mingw-w64-x86_64-autotools
mingw-w64-x86_64-gettext-tools
make
texinfo
bison
flex
- name: "[Linux] Build binutils"
if: runner.os == 'Linux'
shell: bash
run: |
./configure --target=z80-none-elf --with-zstd=no --disable-gdb --disable-sim --disable-readline --disable-nls --prefix="${{ runner.temp }}/binutils"
make -j4 && make install-strip -j4
- name: "[macOS] Build binutils"
if: runner.os == 'macOS'
shell: bash
run: |
./configure --target=z80-none-elf --with-zstd=no --disable-gdb --disable-sim --disable-readline --disable-nls --with-system-zlib --prefix="${{ runner.temp }}/binutils"
make -j4 && make install-strip -j4
- name: "[Windows] Build binutils"
if: runner.os == 'Windows'
shell: msys2 {0}
run: |
PREFIX=$(cygpath -m "${{ runner.temp }}/binutils")
./configure --target=z80-none-elf --with-zstd=no --disable-gdb --disable-sim --disable-readline --disable-nls --disable-shared --enable-static --prefix="$PREFIX"
make configure-host && make -j4 LDFLAGS="-all-static" MAKEINFO=true && make install-strip -j4 MAKEINFO=true
- name: "[Unix] Install License Files"
if: runner.os != 'Windows'
shell: bash
run: |
mkdir -p "${{ runner.temp }}/binutils/license"
cp COPYING3 "${{ runner.temp }}/binutils/license/"
cp COPYING3.LIB "${{ runner.temp }}/binutils/license/"
cat > "${{ runner.temp }}/binutils/readme.txt" <<EOF
This is a pre-built distribution of GNU binutils for z80-none-elf.
Source: https://github.com/CE-Programming/binutils-gdb.git
Original Source: https://sourceware.org/git/binutils-gdb.git
This software is licensed under the GNU General Public License v3.
See the license directory for full license texts.
Source code is available at the URLs above.
No modifications have been made to the original source.
EOF
- name: "[Windows] Install License Files"
if: runner.os == 'Windows'
shell: msys2 {0}
run: |
INSTALL_DIR=$(cygpath -u "${{ runner.temp }}/binutils")
mkdir -p "$INSTALL_DIR/license"
cp COPYING3 "$INSTALL_DIR/license/"
cp COPYING3.LIB "$INSTALL_DIR/license/"
cat > "$INSTALL_DIR/readme.txt" <<EOF
This is a pre-built distribution of GNU binutils for z80-none-elf.
Source: https://github.com/CE-Programming/binutils-gdb.git
Original Source: https://sourceware.org/git/binutils-gdb.git
This software is licensed under the GNU General Public License v3.
See the license directory for full license texts.
Source code is available at the URLs above.
No modifications have been made to the original source.
EOF
- name: "[Unix] Tar install"
if: runner.os != 'Windows'
shell: bash
run: |
cd ${{ runner.temp }} && tar -chzvf binutils-${{ runner.os }}.${{ matrix.install-output-ext }} --exclude='z80-none-elf' binutils
mv ${{ runner.temp }}/binutils-${{ runner.os }}.${{ matrix.install-output-ext }} ${{github.workspace}}
- name: "[Windows] Tar install"
if: runner.os == 'Windows'
shell: msys2 {0}
run: |
cd ${{ runner.temp }} && tar -chzvf binutils-${{ runner.os }}.${{ matrix.install-output-ext }} --exclude='z80-none-elf' binutils
mv ${{ runner.temp }}/binutils-${{ runner.os }}.${{ matrix.install-output-ext }} ${{github.workspace}}
- name: Upload binutils
uses: actions/upload-artifact@v4
with:
name: binutils-${{ runner.os }}${{ matrix.arch-suffix }}
path: binutils-${{ runner.os }}.${{ matrix.install-output-ext }}
nightly:
runs-on: ubuntu-latest
needs: [build]
if: github.event_name != 'pull_request'
steps:
- name: Download Ubuntu binutils
uses: actions/download-artifact@v4
with:
name: binutils-Linux
path: ${{github.workspace}}/ubuntu
- name: Download macOS Intel binutils
uses: actions/download-artifact@v4
with:
name: binutils-macOS-intel
path: ${{github.workspace}}/macos-intel
- name: Download macOS ARM binutils
uses: actions/download-artifact@v4
with:
name: binutils-macOS-arm
path: ${{github.workspace}}/macos-arm
- name: Download Windows binutils
uses: actions/download-artifact@v4
with:
name: binutils-Windows
path: ${{github.workspace}}/windows
- name: Create Ubunutu Nightly
run: |
cd ubuntu
mv binutils-Linux.tar.gz ../binutils_ubuntu_nightly.tar.gz
- name: Create macOS Intel Nightly
run: |
cd macos-intel
mv binutils-macOS.tar.gz ../binutils_macos_intel_nightly.tar.gz
- name: Create macOS ARM Nightly
run: |
cd macos-arm
mv binutils-macOS.tar.gz ../binutils_macos_arm_nightly.tar.gz
- name: Create Windows Nightly
run: |
cd windows
tar -xzvf binutils-Windows.tar.gz
zip -r9 ../binutils_windows_nightly.zip binutils
- name: Create Nightly Release
uses: softprops/action-gh-release@5122b4edc95f85501a71628a57dc180a03ec7588
with:
tag_name: nightly
name: Nightly Build
prerelease: true
files: |
binutils_ubuntu_nightly.tar.gz
binutils_macos_intel_nightly.tar.gz
binutils_macos_arm_nightly.tar.gz
binutils_windows_nightly.zip