From bddb1d619e259c1043b09eae399e49af95a84c52 Mon Sep 17 00:00:00 2001 From: mcuee Date: Sat, 17 Feb 2024 12:17:30 +0800 Subject: [PATCH 01/11] Create arduino_packing_release.yml --- .github/workflows/arduino_packing_release.yml | 89 +++++++++++++++++++ 1 file changed, 89 insertions(+) create mode 100644 .github/workflows/arduino_packing_release.yml diff --git a/.github/workflows/arduino_packing_release.yml b/.github/workflows/arduino_packing_release.yml new file mode 100644 index 000000000..2b075d0cb --- /dev/null +++ b/.github/workflows/arduino_packing_release.yml @@ -0,0 +1,89 @@ +name: avrdude_packing + +env: + # The name of the project + PROJECT_NAME: avrdude + DIST_DIR: dist + ARTIFACT_NAME: dist + +on: + push: + tags: + - "v[0-9]+.[0-9]+*" + +jobs: + build: + name: build (${{ matrix.config.os }}, ${{ matrix.config.arch }}) + runs-on: + ubuntu-latest + strategy: + matrix: + config: + - os: Linux + arch: 64bit + cross_compile: x86_64-ubuntu16.04-linux-gnu + - os: Linux + arch: 32bit + cross_compile: i686-ubuntu16.04-linux-gnu + - os: Linux + arch: ARMv6 + cross_compile: arm-linux-gnueabihf + - os: Linux + arch: ARM64 + cross_compile: aarch64-linux-gnu + - os: macOS + arch: 64bit + cross_compile: x86_64-apple-darwin13 + cross_compiler: o64-clang + ar: /opt/osxcross/target/bin/x86_64-apple-darwin13-ar # we have to manually specify the full path otherwise it's not found for some reason + ld: /opt/osxcross/target/bin/x86_64-apple-darwin13-ld + - os: Windows + arch: 32bit + cross_compile: i686-w64-mingw32 + extension: .exe + + container: + image: ghcr.io/arduino/crossbuild:0.2.2 + + steps: + + - name: Checkout avrdude repository + uses: actions/checkout@v3 + with: + repository: avrdudes/avrdude + path: ${{ env.PROJECT_NAME }} + + - name: replace system ranlib with darwin one + # for some reason is not possible to override ranlib with env vars, so this is ugly but it's the only way I found + if: matrix.config.os == 'macOS' + run: | + mv /usr/bin/ranlib /usr/bin/ranlib.bk + ln -s /opt/osxcross/target/bin/${{ matrix.config.cross_compile }}-ranlib /usr/bin/ranlib + + - name: Build Avrdude + working-directory: ${{ env.PROJECT_NAME }} + run: | + if [ "${{ matrix.config.os }}" = "macOS" ]; then + # For darwin we disable the static flags (not supported by clang) and we make some adjustments + cmake -DCMAKE_C_COMPILER=${{ matrix.config.cross_compiler }} -DCMAKE_CXX_COMPILER=${{ matrix.config.cross_compiler }}++ -DCMAKE_AR=${{ matrix.config.ar }} -DCMAKE_LINKER=${{ matrix.config.ld}} -DCMAKE_EXE_LINKER_FLAGS="-L/opt/lib/${{ matrix.config.cross_compile }}/lib/" -DCMAKE_C_FLAGS="-I/opt/lib/${{ matrix.config.cross_compile }}/include -pthread -framework Foundation -framework IOKit -framework Cocoa -framework Security -DHAVE_USB_H" -DCMAKE_PREFIX_PATH=/opt/lib/${{ matrix.config.cross_compile }}/ -DHAVE_LIBFTDI="NO" -B build/ + else + cmake -DCMAKE_C_COMPILER=${{ matrix.config.cross_compile }}-gcc -DCMAKE_CXX_COMPILER=${{ matrix.config.cross_compile }}-g++ -DCMAKE_EXE_LINKER_FLAGS="-static-libgcc -static-libstdc++" -DCMAKE_C_FLAGS="-I/opt/lib/${{ matrix.config.cross_compile }}/include/libusb-1.0/ -I/opt/lib/${{ matrix.config.cross_compile }}/include -pthread" -DCMAKE_PREFIX_PATH=/opt/lib/${{ matrix.config.cross_compile }}/ -DHAVE_LIBFTDI="NO" -B build/ + fi + cmake --build build/ -v + + - name: Package + working-directory: ${{ env.PROJECT_NAME }} + run: | # we need to create the subdir where to place binaries + mkdir -p ${{ env.PROJECT_NAME }}_${{ matrix.config.os }}_${{ matrix.config.arch }}/bin ${{ env.PROJECT_NAME }}_${{ matrix.config.os }}_${{ matrix.config.arch }}/etc + chmod +x build/src/${{ env.PROJECT_NAME }}${{ matrix.config.extension }} + mv -v build/src/${{ env.PROJECT_NAME }}${{ matrix.config.extension }} ${{ env.PROJECT_NAME }}_${{ matrix.config.os }}_${{ matrix.config.arch }}/bin + mv -v build/src/${{ env.PROJECT_NAME }}.conf ${{ env.PROJECT_NAME }}_${{ matrix.config.os }}_${{ matrix.config.arch }}/etc + mv -v COPYING ${{ env.PROJECT_NAME }}_${{ matrix.config.os }}_${{ matrix.config.arch }}/LICENSE.txt + tar -czv ${{ env.PROJECT_NAME }}_${{ matrix.config.os }}_${{ matrix.config.arch }} -f ${{ env.PROJECT_NAME }}_${GITHUB_REF##*/}_${{ matrix.config.os }}_${{ matrix.config.arch }}.tar.gz + + - name: Upload artifacts + uses: actions/upload-artifact@v3 + with: + if-no-files-found: error + name: ${{ env.ARTIFACT_NAME }} + path: ${{ env.PROJECT_NAME }}/${{ env.PROJECT_NAME }}_* From ac3b81328dc02c7d13e9ab675729a66cad1738c2 Mon Sep 17 00:00:00 2001 From: mcuee Date: Wed, 20 Mar 2024 20:41:34 +0800 Subject: [PATCH 02/11] Update .github/workflows/arduino_packing_release.yml Co-authored-by: Umberto Baldi <34278123+umbynos@users.noreply.github.com> --- .github/workflows/arduino_packing_release.yml | 2 -- 1 file changed, 2 deletions(-) diff --git a/.github/workflows/arduino_packing_release.yml b/.github/workflows/arduino_packing_release.yml index 2b075d0cb..6fa5113d8 100644 --- a/.github/workflows/arduino_packing_release.yml +++ b/.github/workflows/arduino_packing_release.yml @@ -50,8 +50,6 @@ jobs: - name: Checkout avrdude repository uses: actions/checkout@v3 with: - repository: avrdudes/avrdude - path: ${{ env.PROJECT_NAME }} - name: replace system ranlib with darwin one # for some reason is not possible to override ranlib with env vars, so this is ugly but it's the only way I found From 017d49f2db37112cb9525ae14777df791367dd97 Mon Sep 17 00:00:00 2001 From: mcuee Date: Wed, 20 Mar 2024 20:42:09 +0800 Subject: [PATCH 03/11] Update .github/workflows/arduino_packing_release.yml Co-authored-by: Umberto Baldi <34278123+umbynos@users.noreply.github.com> --- .github/workflows/arduino_packing_release.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/arduino_packing_release.yml b/.github/workflows/arduino_packing_release.yml index 6fa5113d8..af3f8fc11 100644 --- a/.github/workflows/arduino_packing_release.yml +++ b/.github/workflows/arduino_packing_release.yml @@ -59,7 +59,6 @@ jobs: ln -s /opt/osxcross/target/bin/${{ matrix.config.cross_compile }}-ranlib /usr/bin/ranlib - name: Build Avrdude - working-directory: ${{ env.PROJECT_NAME }} run: | if [ "${{ matrix.config.os }}" = "macOS" ]; then # For darwin we disable the static flags (not supported by clang) and we make some adjustments From 4aeba984a830f1b236ec9f3457f90159c3a0f405 Mon Sep 17 00:00:00 2001 From: mcuee Date: Wed, 20 Mar 2024 20:42:18 +0800 Subject: [PATCH 04/11] Update .github/workflows/arduino_packing_release.yml Co-authored-by: Umberto Baldi <34278123+umbynos@users.noreply.github.com> --- .github/workflows/arduino_packing_release.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/arduino_packing_release.yml b/.github/workflows/arduino_packing_release.yml index af3f8fc11..21df7c7b8 100644 --- a/.github/workflows/arduino_packing_release.yml +++ b/.github/workflows/arduino_packing_release.yml @@ -69,7 +69,6 @@ jobs: cmake --build build/ -v - name: Package - working-directory: ${{ env.PROJECT_NAME }} run: | # we need to create the subdir where to place binaries mkdir -p ${{ env.PROJECT_NAME }}_${{ matrix.config.os }}_${{ matrix.config.arch }}/bin ${{ env.PROJECT_NAME }}_${{ matrix.config.os }}_${{ matrix.config.arch }}/etc chmod +x build/src/${{ env.PROJECT_NAME }}${{ matrix.config.extension }} From c7be5e1e676bc6a8a0b5f9f8f532b0571509916d Mon Sep 17 00:00:00 2001 From: mcuee Date: Wed, 20 Mar 2024 20:42:29 +0800 Subject: [PATCH 05/11] Update .github/workflows/arduino_packing_release.yml Co-authored-by: Umberto Baldi <34278123+umbynos@users.noreply.github.com> --- .github/workflows/arduino_packing_release.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/arduino_packing_release.yml b/.github/workflows/arduino_packing_release.yml index 21df7c7b8..36d8bd8dd 100644 --- a/.github/workflows/arduino_packing_release.yml +++ b/.github/workflows/arduino_packing_release.yml @@ -2,7 +2,6 @@ name: avrdude_packing env: # The name of the project - PROJECT_NAME: avrdude DIST_DIR: dist ARTIFACT_NAME: dist From 0ea1e0a5bf93241db886ce47d1e78865df9f18c4 Mon Sep 17 00:00:00 2001 From: mcuee Date: Wed, 20 Mar 2024 20:42:36 +0800 Subject: [PATCH 06/11] Update .github/workflows/arduino_packing_release.yml Co-authored-by: Umberto Baldi <34278123+umbynos@users.noreply.github.com> --- .github/workflows/arduino_packing_release.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/arduino_packing_release.yml b/.github/workflows/arduino_packing_release.yml index 36d8bd8dd..be9bc7ee1 100644 --- a/.github/workflows/arduino_packing_release.yml +++ b/.github/workflows/arduino_packing_release.yml @@ -81,4 +81,4 @@ jobs: with: if-no-files-found: error name: ${{ env.ARTIFACT_NAME }} - path: ${{ env.PROJECT_NAME }}/${{ env.PROJECT_NAME }}_* + path: avrdude_* From 9115a9997fd92f3a2677f8672baa86ec95cb15d7 Mon Sep 17 00:00:00 2001 From: mcuee Date: Fri, 29 Mar 2024 18:37:13 +0800 Subject: [PATCH 07/11] To useSTATIC_LIBS for macOS build --- .github/workflows/arduino_packing_release.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/arduino_packing_release.yml b/.github/workflows/arduino_packing_release.yml index be9bc7ee1..a73ad874c 100644 --- a/.github/workflows/arduino_packing_release.yml +++ b/.github/workflows/arduino_packing_release.yml @@ -61,7 +61,7 @@ jobs: run: | if [ "${{ matrix.config.os }}" = "macOS" ]; then # For darwin we disable the static flags (not supported by clang) and we make some adjustments - cmake -DCMAKE_C_COMPILER=${{ matrix.config.cross_compiler }} -DCMAKE_CXX_COMPILER=${{ matrix.config.cross_compiler }}++ -DCMAKE_AR=${{ matrix.config.ar }} -DCMAKE_LINKER=${{ matrix.config.ld}} -DCMAKE_EXE_LINKER_FLAGS="-L/opt/lib/${{ matrix.config.cross_compile }}/lib/" -DCMAKE_C_FLAGS="-I/opt/lib/${{ matrix.config.cross_compile }}/include -pthread -framework Foundation -framework IOKit -framework Cocoa -framework Security -DHAVE_USB_H" -DCMAKE_PREFIX_PATH=/opt/lib/${{ matrix.config.cross_compile }}/ -DHAVE_LIBFTDI="NO" -B build/ + cmake -DCMAKE_C_COMPILER=${{ matrix.config.cross_compiler }} -DCMAKE_CXX_COMPILER=${{ matrix.config.cross_compiler }}++ -DCMAKE_AR=${{ matrix.config.ar }} -DCMAKE_LINKER=${{ matrix.config.ld}} -DCMAKE_EXE_LINKER_FLAGS="-L/opt/lib/${{ matrix.config.cross_compile }}/lib/" -DCMAKE_C_FLAGS="-I/opt/lib/${{ matrix.config.cross_compile }}/include -pthread -framework Foundation -framework IOKit -framework Cocoa -framework Security -DHAVE_USB_H" -DCMAKE_PREFIX_PATH=/opt/lib/${{ matrix.config.cross_compile }}/ -DHAVE_LIBFTDI="NO" -DUSE_STATIC_LIBS="ON" -B build/ else cmake -DCMAKE_C_COMPILER=${{ matrix.config.cross_compile }}-gcc -DCMAKE_CXX_COMPILER=${{ matrix.config.cross_compile }}-g++ -DCMAKE_EXE_LINKER_FLAGS="-static-libgcc -static-libstdc++" -DCMAKE_C_FLAGS="-I/opt/lib/${{ matrix.config.cross_compile }}/include/libusb-1.0/ -I/opt/lib/${{ matrix.config.cross_compile }}/include -pthread" -DCMAKE_PREFIX_PATH=/opt/lib/${{ matrix.config.cross_compile }}/ -DHAVE_LIBFTDI="NO" -B build/ fi From 005ee69d6c11974e56687f7d286d12bf6f93dc95 Mon Sep 17 00:00:00 2001 From: mcuee Date: Sun, 7 Apr 2024 14:37:55 +0800 Subject: [PATCH 08/11] Fix CI build failure --- .github/workflows/arduino_packing_release.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/arduino_packing_release.yml b/.github/workflows/arduino_packing_release.yml index a73ad874c..baba03fab 100644 --- a/.github/workflows/arduino_packing_release.yml +++ b/.github/workflows/arduino_packing_release.yml @@ -49,6 +49,8 @@ jobs: - name: Checkout avrdude repository uses: actions/checkout@v3 with: + repository: avrdudes/avrdude + path: ${{ env.PROJECT_NAME }} - name: replace system ranlib with darwin one # for some reason is not possible to override ranlib with env vars, so this is ugly but it's the only way I found From 277e50e701838aae34c0bb76f9f572a640c047af Mon Sep 17 00:00:00 2001 From: mcuee Date: Sun, 7 Apr 2024 14:42:45 +0800 Subject: [PATCH 09/11] Change name to avrdude_packing_release --- .github/workflows/arduino_packing_release.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/arduino_packing_release.yml b/.github/workflows/arduino_packing_release.yml index baba03fab..77a8dc130 100644 --- a/.github/workflows/arduino_packing_release.yml +++ b/.github/workflows/arduino_packing_release.yml @@ -1,4 +1,4 @@ -name: avrdude_packing +name: avrdude_packing_release env: # The name of the project From 1a04644a3611c2088f0ee0a17dc835a15865ba3d Mon Sep 17 00:00:00 2001 From: mcuee Date: Sun, 7 Apr 2024 14:48:20 +0800 Subject: [PATCH 10/11] Fix CI build by adding PROJECT_NAME --- .github/workflows/arduino_packing_release.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/arduino_packing_release.yml b/.github/workflows/arduino_packing_release.yml index 77a8dc130..8217a286c 100644 --- a/.github/workflows/arduino_packing_release.yml +++ b/.github/workflows/arduino_packing_release.yml @@ -2,6 +2,7 @@ name: avrdude_packing_release env: # The name of the project + PROJECT_NAME: avrdude DIST_DIR: dist ARTIFACT_NAME: dist From 9d608de0680585e9770c6266afe3ad66b8429560 Mon Sep 17 00:00:00 2001 From: mcuee Date: Sun, 7 Apr 2024 15:32:39 +0800 Subject: [PATCH 11/11] Try to fix CI build error --- .github/workflows/arduino_packing_release.yml | 3 --- 1 file changed, 3 deletions(-) diff --git a/.github/workflows/arduino_packing_release.yml b/.github/workflows/arduino_packing_release.yml index 8217a286c..bcdaae6ad 100644 --- a/.github/workflows/arduino_packing_release.yml +++ b/.github/workflows/arduino_packing_release.yml @@ -49,9 +49,6 @@ jobs: - name: Checkout avrdude repository uses: actions/checkout@v3 - with: - repository: avrdudes/avrdude - path: ${{ env.PROJECT_NAME }} - name: replace system ranlib with darwin one # for some reason is not possible to override ranlib with env vars, so this is ugly but it's the only way I found