2021-12-20 16:52:37 +00:00
|
|
|
#
|
2021-12-29 14:40:55 +00:00
|
|
|
# build.yml - GitHub build action for AVRDUDE
|
2021-12-20 16:52:37 +00:00
|
|
|
# Copyright (C) 2021 Marius Greuel
|
|
|
|
#
|
|
|
|
# This program is free software; you can redistribute it and/or modify
|
|
|
|
# it under the terms of the GNU General Public License as published by
|
|
|
|
# the Free Software Foundation; either version 2 of the License, or
|
|
|
|
# (at your option) any later version.
|
|
|
|
#
|
|
|
|
# This program is distributed in the hope that it will be useful,
|
|
|
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
# GNU General Public License for more details.
|
|
|
|
#
|
|
|
|
# You should have received a copy of the GNU General Public License
|
|
|
|
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
|
|
#
|
|
|
|
|
2021-12-29 21:27:36 +00:00
|
|
|
name: Build
|
2021-12-20 16:52:37 +00:00
|
|
|
|
|
|
|
on:
|
|
|
|
push:
|
2022-04-26 19:29:46 +00:00
|
|
|
branches-ignore:
|
|
|
|
- 'onlinedocs'
|
2021-12-20 16:52:37 +00:00
|
|
|
pull_request:
|
2022-04-26 19:29:46 +00:00
|
|
|
branches-ignore:
|
|
|
|
- 'onlinedocs'
|
2021-12-20 16:52:37 +00:00
|
|
|
workflow_call:
|
|
|
|
|
|
|
|
env:
|
|
|
|
BUILD_TYPE: RelWithDebInfo
|
|
|
|
|
|
|
|
jobs:
|
2021-12-29 21:27:36 +00:00
|
|
|
linux-x86_64:
|
2021-12-20 16:52:37 +00:00
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@v2
|
|
|
|
- name: Install prerequisites
|
|
|
|
run: >-
|
2022-09-29 20:02:04 +00:00
|
|
|
sudo apt-get update
|
|
|
|
|
2021-12-20 16:52:37 +00:00
|
|
|
sudo apt-get install -y
|
|
|
|
build-essential
|
|
|
|
cmake
|
|
|
|
flex
|
|
|
|
bison
|
|
|
|
libelf-dev
|
|
|
|
libusb-dev
|
2021-12-29 14:40:55 +00:00
|
|
|
libusb-1.0-0-dev
|
2021-12-20 16:52:37 +00:00
|
|
|
libhidapi-dev
|
2021-12-29 14:40:55 +00:00
|
|
|
libftdi1-dev
|
2022-10-23 06:03:33 +00:00
|
|
|
libreadline-dev
|
2022-05-11 21:27:55 +00:00
|
|
|
texinfo
|
|
|
|
texlive
|
|
|
|
texi2html
|
2021-12-20 16:52:37 +00:00
|
|
|
- name: Configure
|
2021-12-29 21:27:36 +00:00
|
|
|
run: >-
|
|
|
|
cmake
|
2022-05-11 21:27:55 +00:00
|
|
|
-D BUILD_DOC=1
|
2021-12-29 21:27:36 +00:00
|
|
|
-D DEBUG_CMAKE=1
|
2022-01-12 16:25:00 +00:00
|
|
|
-D HAVE_LINUXGPIO=1
|
|
|
|
-D HAVE_LINUXSPI=1
|
2021-12-29 21:27:36 +00:00
|
|
|
-D CMAKE_BUILD_TYPE=${{env.BUILD_TYPE}}
|
2022-01-23 16:13:42 +00:00
|
|
|
-B build
|
2021-12-20 16:52:37 +00:00
|
|
|
- name: Build
|
2022-01-23 16:13:42 +00:00
|
|
|
run: cmake --build build
|
2021-12-20 16:52:37 +00:00
|
|
|
- name: Archive build artifacts
|
2021-12-29 21:27:36 +00:00
|
|
|
if: always()
|
2021-12-20 16:52:37 +00:00
|
|
|
uses: actions/upload-artifact@v2
|
|
|
|
with:
|
2022-01-12 16:25:00 +00:00
|
|
|
name: build-linux-x86_64
|
2021-12-20 16:52:37 +00:00
|
|
|
path: |
|
2021-12-29 14:40:55 +00:00
|
|
|
build/
|
|
|
|
!**/*.d
|
|
|
|
!**/*.o
|
2022-01-12 16:25:00 +00:00
|
|
|
- name: Archive executables
|
|
|
|
uses: actions/upload-artifact@v2
|
|
|
|
with:
|
|
|
|
name: avrdude-linux-x86_64
|
|
|
|
path: |
|
2022-01-23 16:13:42 +00:00
|
|
|
build/src/avrdude
|
|
|
|
build/src/avrdude.conf
|
2021-12-29 14:40:55 +00:00
|
|
|
|
|
|
|
linux:
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
container: debian:11
|
|
|
|
strategy:
|
|
|
|
matrix:
|
|
|
|
include:
|
|
|
|
- { arch: i386, processor: i686, prefix: i686-linux-gnu, inc-lib: i386-linux-gnu }
|
|
|
|
- { arch: armhf, processor: armhf, prefix: arm-linux-gnueabihf, inc-lib: arm-linux-gnueabihf }
|
|
|
|
- { arch: arm64, processor: aarch64, prefix: aarch64-linux-gnu, inc-lib: aarch64-linux-gnu }
|
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@v2
|
|
|
|
- name: Add architecture
|
|
|
|
run: |
|
|
|
|
dpkg --add-architecture ${{matrix.arch}}
|
|
|
|
apt-get update
|
|
|
|
- name: Install prerequisites
|
|
|
|
run: >-
|
2022-09-29 20:02:04 +00:00
|
|
|
apt-get update
|
|
|
|
|
2021-12-29 14:40:55 +00:00
|
|
|
apt-get install -y
|
|
|
|
git
|
|
|
|
cmake
|
|
|
|
flex
|
|
|
|
bison
|
|
|
|
crossbuild-essential-${{matrix.arch}}
|
|
|
|
libelf-dev:${{matrix.arch}}
|
|
|
|
libusb-dev:${{matrix.arch}}
|
|
|
|
libusb-1.0-0-dev:${{matrix.arch}}
|
|
|
|
libhidapi-dev:${{matrix.arch}}
|
|
|
|
libftdi1-dev:${{matrix.arch}}
|
2022-10-23 06:03:33 +00:00
|
|
|
libreadline-dev:${{matrix.arch}}
|
2021-12-29 14:40:55 +00:00
|
|
|
- name: Configure
|
|
|
|
run: >-
|
|
|
|
cmake
|
|
|
|
-D DEBUG_CMAKE=1
|
2022-01-12 16:25:00 +00:00
|
|
|
-D HAVE_LINUXGPIO=1
|
|
|
|
-D HAVE_LINUXSPI=1
|
2021-12-29 14:40:55 +00:00
|
|
|
-D CMAKE_BUILD_TYPE=${{env.BUILD_TYPE}}
|
|
|
|
-D CMAKE_SYSTEM_NAME=Linux
|
|
|
|
-D CMAKE_SYSTEM_PROCESSOR=${{matrix.processor}}
|
|
|
|
-D CMAKE_C_COMPILER=${{matrix.prefix}}-gcc
|
|
|
|
-D CMAKE_FIND_ROOT_PATH=/usr/${{matrix.prefix}}
|
|
|
|
-D CMAKE_INCLUDE_PATH=/usr/include/${{matrix.inc-lib}}
|
|
|
|
-D CMAKE_LIBRARY_PATH=/usr/lib/${{matrix.inc-lib}}
|
2022-01-23 16:13:42 +00:00
|
|
|
-B build
|
2021-12-29 14:40:55 +00:00
|
|
|
- name: Build
|
2022-01-23 16:13:42 +00:00
|
|
|
run: cmake --build build
|
2021-12-29 14:40:55 +00:00
|
|
|
- name: Archive build artifacts
|
|
|
|
if: always()
|
|
|
|
uses: actions/upload-artifact@v2
|
|
|
|
with:
|
2022-01-12 16:25:00 +00:00
|
|
|
name: build-linux-${{matrix.processor}}
|
2021-12-29 14:40:55 +00:00
|
|
|
path: |
|
|
|
|
build/
|
|
|
|
!**/*.d
|
|
|
|
!**/*.o
|
2022-01-12 16:25:00 +00:00
|
|
|
- name: Archive executables
|
|
|
|
uses: actions/upload-artifact@v2
|
|
|
|
with:
|
|
|
|
name: avrdude-linux-${{matrix.processor}}
|
|
|
|
path: |
|
2022-01-23 16:13:42 +00:00
|
|
|
build/src/avrdude
|
|
|
|
build/src/avrdude.conf
|
2021-12-29 21:27:36 +00:00
|
|
|
|
|
|
|
macos-x86_64:
|
2021-12-20 16:52:37 +00:00
|
|
|
runs-on: macos-latest
|
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@v2
|
|
|
|
- name: Install prerequisites
|
|
|
|
run: >-
|
2022-09-29 20:02:04 +00:00
|
|
|
brew update
|
|
|
|
|
2021-12-20 16:52:37 +00:00
|
|
|
brew install
|
|
|
|
cmake
|
|
|
|
flex
|
|
|
|
bison
|
|
|
|
libelf
|
|
|
|
libusb
|
|
|
|
hidapi
|
2021-12-29 14:40:55 +00:00
|
|
|
libftdi
|
2022-10-24 00:50:57 +00:00
|
|
|
readline
|
2021-12-20 16:52:37 +00:00
|
|
|
- name: Configure
|
2021-12-29 21:27:36 +00:00
|
|
|
run: >-
|
|
|
|
cmake
|
|
|
|
-D CMAKE_C_FLAGS=-I/usr/local/include
|
|
|
|
-D CMAKE_EXE_LINKER_FLAGS=-L/usr/local/Cellar
|
|
|
|
-D DEBUG_CMAKE=1
|
|
|
|
-D CMAKE_BUILD_TYPE=${{env.BUILD_TYPE}}
|
2022-01-23 16:13:42 +00:00
|
|
|
-B build
|
2021-12-20 16:52:37 +00:00
|
|
|
- name: Build
|
2022-01-23 16:13:42 +00:00
|
|
|
run: cmake --build build
|
2021-12-20 16:52:37 +00:00
|
|
|
- name: Archive build artifacts
|
2021-12-29 21:27:36 +00:00
|
|
|
if: always()
|
2021-12-20 16:52:37 +00:00
|
|
|
uses: actions/upload-artifact@v2
|
|
|
|
with:
|
2022-01-12 16:25:00 +00:00
|
|
|
name: build-macos-x86_64
|
2021-12-20 16:52:37 +00:00
|
|
|
path: |
|
2021-12-29 14:40:55 +00:00
|
|
|
build/
|
|
|
|
!**/*.d
|
|
|
|
!**/*.o
|
2022-01-12 16:25:00 +00:00
|
|
|
- name: Archive executables
|
|
|
|
uses: actions/upload-artifact@v2
|
|
|
|
with:
|
|
|
|
name: avrdude-macos-x86_64
|
|
|
|
path: |
|
2022-01-23 16:13:42 +00:00
|
|
|
build/src/avrdude
|
|
|
|
build/src/avrdude.conf
|
2021-12-29 14:40:55 +00:00
|
|
|
|
|
|
|
msvc:
|
2021-12-28 13:14:41 +00:00
|
|
|
runs-on: windows-latest
|
2021-12-29 14:40:55 +00:00
|
|
|
strategy:
|
|
|
|
matrix:
|
|
|
|
include:
|
|
|
|
- { arch: x86, platform: Win32 }
|
|
|
|
- { arch: x64, platform: x64 }
|
|
|
|
- { arch: arm64, platform: ARM64 }
|
2021-12-28 13:14:41 +00:00
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@v2
|
|
|
|
- name: Install prerequisites
|
2022-01-09 19:04:06 +00:00
|
|
|
# As Chocolatey is notoriously unreliable, install winflexbison3 directly from GitHub.
|
|
|
|
# run: choco install winflexbison3
|
|
|
|
run: |
|
|
|
|
curl https://github.com/lexxmark/winflexbison/releases/download/v2.5.24/win_flex_bison-2.5.24.zip --location --output winflexbison.zip
|
|
|
|
unzip winflexbison.zip -d ${{github.workspace}}\winflexbison
|
|
|
|
echo "${{github.workspace}}\winflexbison" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append
|
2021-12-28 13:14:41 +00:00
|
|
|
- name: Configure
|
|
|
|
run: >-
|
|
|
|
cmake
|
2021-12-29 14:40:55 +00:00
|
|
|
-A ${{matrix.platform}}
|
2021-12-28 13:14:41 +00:00
|
|
|
-D DEBUG_CMAKE=1
|
|
|
|
-D CMAKE_SYSTEM_VERSION=11
|
|
|
|
-D CMAKE_C_FLAGS_RELWITHDEBINFO="/MT /GL /Zi /O2 /Ob1 /DNDEBUG"
|
|
|
|
-D CMAKE_CXX_FLAGS_RELWITHDEBINFO="/MT /GL /Zi /O2 /Ob1 /DNDEBUG"
|
|
|
|
-D CMAKE_EXE_LINKER_FLAGS_RELWITHDEBINFO="/DEBUG /INCREMENTAL:NO /LTCG /OPT:REF /OPT:ICF"
|
2022-11-24 05:22:12 +00:00
|
|
|
-D HAVE_LIBREADLINE=HAVE_LIBREADLINE-NOTFOUND
|
2021-12-28 13:14:41 +00:00
|
|
|
-D CMAKE_BUILD_TYPE=${{env.BUILD_TYPE}}
|
|
|
|
-D USE_EXTERNAL=1
|
2022-01-23 16:13:42 +00:00
|
|
|
-B build
|
2021-12-28 13:14:41 +00:00
|
|
|
- name: Build
|
2022-01-23 16:13:42 +00:00
|
|
|
run: cmake --build build --config ${{env.BUILD_TYPE}}
|
2021-12-28 13:14:41 +00:00
|
|
|
- name: Archive build artifacts
|
2021-12-29 14:40:55 +00:00
|
|
|
if: always()
|
2021-12-28 13:14:41 +00:00
|
|
|
uses: actions/upload-artifact@v2
|
|
|
|
with:
|
2022-01-12 16:25:00 +00:00
|
|
|
name: build-msvc-${{matrix.arch}}
|
2021-12-28 13:14:41 +00:00
|
|
|
path: |
|
2021-12-29 14:40:55 +00:00
|
|
|
build/
|
|
|
|
!**/_deps/
|
|
|
|
!**/*.obj
|
2022-01-12 16:25:00 +00:00
|
|
|
- name: Move executables
|
|
|
|
run: |
|
2022-01-23 16:13:42 +00:00
|
|
|
mv build/src/RelWithDebInfo/avrdude.exe build/src
|
|
|
|
mv build/src/RelWithDebInfo/avrdude.pdb build/src
|
2022-01-12 16:25:00 +00:00
|
|
|
- name: Archive executables
|
|
|
|
uses: actions/upload-artifact@v2
|
|
|
|
with:
|
|
|
|
name: avrdude-msvc-${{matrix.arch}}
|
|
|
|
path: |
|
2022-01-23 16:13:42 +00:00
|
|
|
build/src/avrdude.exe
|
|
|
|
build/src/avrdude.pdb
|
|
|
|
build/src/avrdude.conf
|
2021-12-29 14:40:55 +00:00
|
|
|
|
2021-12-29 21:27:36 +00:00
|
|
|
mingw:
|
2021-12-20 16:52:37 +00:00
|
|
|
runs-on: windows-latest
|
|
|
|
defaults:
|
|
|
|
run:
|
|
|
|
shell: msys2 {0}
|
|
|
|
strategy:
|
|
|
|
matrix:
|
|
|
|
include:
|
|
|
|
- { sys: mingw32, env: i686 }
|
|
|
|
- { sys: mingw64, env: x86_64 }
|
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@v2
|
|
|
|
- uses: msys2/setup-msys2@v2
|
|
|
|
with:
|
|
|
|
msystem: ${{matrix.sys}}
|
|
|
|
update: true
|
|
|
|
install: >-
|
|
|
|
base-devel
|
|
|
|
mingw-w64-${{matrix.env}}-gcc
|
|
|
|
mingw-w64-${{matrix.env}}-cmake
|
|
|
|
mingw-w64-${{matrix.env}}-libelf
|
|
|
|
mingw-w64-${{matrix.env}}-libusb
|
|
|
|
mingw-w64-${{matrix.env}}-libusb-compat-git
|
|
|
|
mingw-w64-${{matrix.env}}-hidapi
|
|
|
|
mingw-w64-${{matrix.env}}-libftdi
|
|
|
|
- name: Configure
|
2021-12-29 21:27:36 +00:00
|
|
|
run: >-
|
|
|
|
cmake
|
|
|
|
-G"MSYS Makefiles"
|
|
|
|
-D DEBUG_CMAKE=1
|
|
|
|
-D CMAKE_BUILD_TYPE=${{env.BUILD_TYPE}}
|
2022-01-23 16:13:42 +00:00
|
|
|
-B build
|
2021-12-20 16:52:37 +00:00
|
|
|
- name: Build
|
2022-01-23 16:13:42 +00:00
|
|
|
run: cmake --build build
|
2021-12-20 16:52:37 +00:00
|
|
|
- name: Archive build artifacts
|
2021-12-29 21:27:36 +00:00
|
|
|
if: always()
|
2021-12-20 16:52:37 +00:00
|
|
|
uses: actions/upload-artifact@v2
|
|
|
|
with:
|
2022-01-12 16:25:00 +00:00
|
|
|
name: build-mingw-${{matrix.env}}
|
2021-12-20 16:52:37 +00:00
|
|
|
path: |
|
2022-01-09 19:04:06 +00:00
|
|
|
build/
|
2022-01-12 16:25:00 +00:00
|
|
|
- name: Archive executables
|
|
|
|
uses: actions/upload-artifact@v2
|
|
|
|
with:
|
|
|
|
name: avrdude-mingw-${{matrix.env}}
|
|
|
|
path: |
|
2022-01-23 16:13:42 +00:00
|
|
|
build/src/avrdude.exe
|
|
|
|
build/src/avrdude.conf
|