diff --git a/DistTasks.yml b/DistTasks.yml index eb0ce3dbd25..c1b3fe243c3 100644 --- a/DistTasks.yml +++ b/DistTasks.yml @@ -76,6 +76,10 @@ tasks: -p "{{.BUILD_PLATFORM}}" tar cz -C {{.PLATFORM_DIR}} {{.PROJECT_NAME}} -C ../.. LICENSE.txt -f {{.PACKAGE_NAME}} + - task: build_deb + vars: + GO_BINARY: "{{.DIST_DIR}}/{{.PLATFORM_DIR}}/{{.PROJECT_NAME}}" + ARCH: "i386" vars: PLATFORM_DIR: "{{.PROJECT_NAME}}_linux_amd32" @@ -97,6 +101,10 @@ tasks: -p "{{.BUILD_PLATFORM}}" tar cz -C {{.PLATFORM_DIR}} {{.PROJECT_NAME}} -C ../.. LICENSE.txt -f {{.PACKAGE_NAME}} + - task: build_deb + vars: + GO_BINARY: "{{.DIST_DIR}}/{{.PLATFORM_DIR}}/{{.PROJECT_NAME}}" + ARCH: "amd64" vars: PLATFORM_DIR: "{{.PROJECT_NAME}}_linux_amd64" @@ -118,6 +126,10 @@ tasks: -p "{{.BUILD_PLATFORM}}" tar cz -C {{.PLATFORM_DIR}} {{.PROJECT_NAME}} -C ../.. LICENSE.txt -f {{.PACKAGE_NAME}} + - task: build_deb + vars: + GO_BINARY: "{{.DIST_DIR}}/{{.PLATFORM_DIR}}/{{.PROJECT_NAME}}" + ARCH: "armhf" vars: PLATFORM_DIR: "{{.PROJECT_NAME}}_linux_arm_7" @@ -139,6 +151,10 @@ tasks: -p "{{.BUILD_PLATFORM}}" tar cz -C {{.PLATFORM_DIR}} {{.PROJECT_NAME}} -C ../.. LICENSE.txt -f {{.PACKAGE_NAME}} + - task: build_deb + vars: + GO_BINARY: "{{.DIST_DIR}}/{{.PLATFORM_DIR}}/{{.PROJECT_NAME}}" + ARCH: "armel" vars: PLATFORM_DIR: "{{.PROJECT_NAME}}_linux_arm_6" @@ -160,6 +176,10 @@ tasks: -p "{{.BUILD_PLATFORM}}" tar cz -C {{.PLATFORM_DIR}} {{.PROJECT_NAME}} -C ../.. LICENSE.txt -f {{.PACKAGE_NAME}} + - task: build_deb + vars: + GO_BINARY: "{{.DIST_DIR}}/{{.PLATFORM_DIR}}/{{.PROJECT_NAME}}" + ARCH: "arm64" vars: PLATFORM_DIR: "{{.PROJECT_NAME}}_linux_arm_64" @@ -231,3 +251,19 @@ tasks: cmds: - mkdir --parents {{.DIST_DIR}} - cp ./internal/cli/configuration/configuration.schema.json {{.DIST_DIR}}/{{.PROJECT_NAME}}_{{.VERSION}}_configuration.schema.json + + build_deb: + desc: Builds the deb package + internal: true + cmds: + - | + docker build \ + --build-arg BINARY_NAME={{.PROJECT_NAME}} \ + --build-arg DEB_NAME={{.PROJECT_NAME}} \ + --build-arg VERSION={{ .VERSION }} \ + --build-arg ARCH={{ .ARCH }} \ + --build-arg GO_BINARY={{ .GO_BINARY }} \ + --output=./dist \ + -f debian/Dockerfile . + vars: + VERSION: "{{if .TAG}}{{.VERSION}}{{else}}v0.0.0-{{.VERSION}}{{end}}" diff --git a/debian/Dockerfile b/debian/Dockerfile new file mode 100644 index 00000000000..bd6cfaad4d6 --- /dev/null +++ b/debian/Dockerfile @@ -0,0 +1,33 @@ +FROM debian:bookworm AS debian + +ARG VERSION +RUN test -n "${VERSION}" || (echo "Error: VERSION is not set" && exit 1) + +ARG REVISION="1" +ARG ARCH +RUN test -n "${ARCH}" || (echo "Error: ARCH is not set" && exit 1) + +ARG DEB_NAME +RUN test -n "${DEB_NAME}" || (echo "Error: DEB_NAME is not set" && exit 1) + +ARG BINARY_NAME +RUN test -n "${BINARY_NAME}" || (echo "Error: BINARY_NAME is not set" && exit 1) + +RUN apt-get update && apt-get install -y sed + +ARG GO_BINARY + +COPY ./debian/${DEB_NAME} /${DEB_NAME}/ +COPY ./${GO_BINARY} /${DEB_NAME}/usr/bin/${BINARY_NAME} +COPY ./debian/${DEB_NAME}/DEBIAN/copyright /${DEB_NAME}/usr/share/doc/copyright + +# Go application are tagged with `v` prefix, this remove the first v if present +RUN export VERSION=$(echo "${VERSION}" | sed -e "s/^v\(.*\)/\1/") && \ + sed -i "s/\$ARCH/${ARCH}/" /${DEB_NAME}/DEBIAN/control && \ + sed -i "s/\$VERSION/${VERSION}/" /${DEB_NAME}/DEBIAN/control && \ + dpkg-deb --build --root-owner-group /${DEB_NAME} &&\ + mv /${DEB_NAME}.deb "/${DEB_NAME}_${VERSION}-${REVISION}_${ARCH}.deb" + +FROM scratch + +COPY --from=debian /*.deb / diff --git a/debian/arduino-cli/DEBIAN/control b/debian/arduino-cli/DEBIAN/control new file mode 100644 index 00000000000..f9a23038492 --- /dev/null +++ b/debian/arduino-cli/DEBIAN/control @@ -0,0 +1,5 @@ +Package: arduino-cli +Version: $VERSION +Architecture: $ARCH +Maintainer: arduino +Description: Arduino CLI diff --git a/debian/arduino-cli/DEBIAN/copyright b/debian/arduino-cli/DEBIAN/copyright new file mode 100644 index 00000000000..aee0cd7a5d3 --- /dev/null +++ b/debian/arduino-cli/DEBIAN/copyright @@ -0,0 +1,18 @@ +Format: https://www.debian.org/doc/packaging-manuals/copyright-format/1.0/ +Source: https://github.com/arduino/arduino-cli +Upstream-Name: arduino-cli + +Files: + * +Copyright: Copyright 2020-2025 ARDUINO SA (http://www.arduino.cc/) +License: GPL-3+ with exception + This software is released under the GNU General Public License version 3, + which covers the main part of arduino-cli. + The terms of this license can be found at: + https://www.gnu.org/licenses/gpl-3.0.en.html + . + You can be released from the requirements of the above licenses by purchasing + a commercial license. Buying such a license is mandatory if you want to + modify or otherwise use the software for commercial activities involving the + Arduino software without disclosing the source code of your own applications. + To purchase a commercial license, send an email to license@arduino.cc. pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy