From cd72ac4fc942d34b265b9872d39e62c665bbe795 Mon Sep 17 00:00:00 2001 From: Nicola Murino Date: Sat, 25 Sep 2021 14:14:21 +0200 Subject: [PATCH] CI: add armv7 support --- .github/workflows/development.yml | 15 +++++++++++- .github/workflows/docker.yml | 2 +- .github/workflows/release.yml | 39 ++++++++++++++++++++++++++++--- pkgs/debian/sftpgo.install.armhf | 7 ++++++ 4 files changed, 58 insertions(+), 5 deletions(-) create mode 100644 pkgs/debian/sftpgo.install.armhf diff --git a/.github/workflows/development.yml b/.github/workflows/development.yml index a1ad59cc..9fe8901e 100644 --- a/.github/workflows/development.yml +++ b/.github/workflows/development.yml @@ -228,6 +228,10 @@ jobs: distro: ubuntu18.04 go: latest go-arch: ppc64le + - arch: armv7 + distro: ubuntu18.04 + go: latest + go-arch: arm steps: - uses: actions/checkout@v2 with: @@ -274,10 +278,19 @@ jobs: else GO_VERSION=${{ matrix.go }} fi - curl --retry 5 --retry-delay 2 --connect-timeout 10 -o go.tar.gz -L https://golang.org/dl/${GO_VERSION}.linux-${{ matrix.go-arch }}.tar.gz + GO_DOWNLOAD_ARCH=${{ matrix.go-arch }} + if [ ${{ matrix.arch}} == 'armv7' ] + then + GO_DOWNLOAD_ARCH=armv6l + fi + curl --retry 5 --retry-delay 2 --connect-timeout 10 -o go.tar.gz -L https://golang.org/dl/${GO_VERSION}.linux-${GO_DOWNLOAD_ARCH}.tar.gz tar -C /usr/local -xzf go.tar.gz run: | export PATH=$PATH:/usr/local/go/bin + if [ ${{ matrix.arch}} == 'armv7' ] + then + export GOARM=7 + fi go build -trimpath -ldflags "-s -w -X github.com/drakkan/sftpgo/v2/version.commit=`git describe --always --dirty` -X github.com/drakkan/sftpgo/v2/version.date=`date -u +%FT%TZ`" -o sftpgo mkdir -p output/{init,bash_completion,zsh_completion} cp sftpgo.json output/ diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml index 99e94755..7401bdb8 100644 --- a/.github/workflows/docker.yml +++ b/.github/workflows/docker.yml @@ -152,7 +152,7 @@ jobs: context: . builder: ${{ steps.builder.outputs.name }} file: ./${{ steps.info.outputs.dockerfile }} - platforms: linux/amd64,linux/arm64,linux/ppc64le + platforms: linux/amd64,linux/arm64,linux/ppc64le,linux/arm/v7 push: ${{ github.event_name != 'pull_request' }} tags: ${{ steps.info.outputs.tags }} build-args: | diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index fd21a89b..ea2afd8f 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -5,7 +5,7 @@ on: tags: 'v*' env: - GO_VERSION: 1.16.5 + GO_VERSION: 1.17.1 jobs: prepare-sources-with-deps: @@ -206,6 +206,12 @@ jobs: deb-arch: ppc64el rpm-arch: ppc64le tar-arch: ppc64le + - arch: armv7 + distro: ubuntu18.04 + go-arch: arm + deb-arch: armhf + rpm-arch: arm + tar-arch: armv7 steps: - uses: actions/checkout@v2 @@ -265,7 +271,12 @@ jobs: install: | apt-get update -q -y apt-get install -q -y curl gcc git xz-utils - curl --retry 5 --retry-delay 2 --connect-timeout 10 -o go.tar.gz -L https://golang.org/dl/go${{ steps.get_version.outputs.GO_VERSION }}.linux-${{ matrix.go-arch }}.tar.gz + GO_DOWNLOAD_ARCH=${{ matrix.go-arch }} + if [ ${{ matrix.arch}} == 'armv7' ] + then + GO_DOWNLOAD_ARCH=armv6l + fi + curl --retry 5 --retry-delay 2 --connect-timeout 10 -o go.tar.gz -L https://golang.org/dl/go${{ steps.get_version.outputs.GO_VERSION }}.linux-${GO_DOWNLOAD_ARCH}.tar.gz tar -C /usr/local -xzf go.tar.gz run: | export PATH=$PATH:/usr/local/go/bin @@ -349,16 +360,23 @@ jobs: with: name: sftpgo_${{ steps.get_version.outputs.SFTPGO_VERSION }}_linux_ppc64le.tar.xz + - name: Download armv7 artifact + uses: actions/download-artifact@v2 + with: + name: sftpgo_${{ steps.get_version.outputs.SFTPGO_VERSION }}_linux_armv7.tar.xz + - name: Build bundle shell: bash run: | - mkdir -p bundle/{arm64,ppc64le} + mkdir -p bundle/{arm64,ppc64le,armv7} cd bundle tar xvf ../sftpgo_${SFTPGO_VERSION}_linux_x86_64.tar.xz cd arm64 tar xvf ../../sftpgo_${SFTPGO_VERSION}_linux_arm64.tar.xz sftpgo cd ../ppc64le tar xvf ../../sftpgo_${SFTPGO_VERSION}_linux_ppc64le.tar.xz sftpgo + cd ../armv7 + tar xvf ../../sftpgo_${SFTPGO_VERSION}_linux_armv7.tar.xz sftpgo cd .. tar cJvf sftpgo_${SFTPGO_VERSION}_linux_bundle.tar.xz * cd .. @@ -403,6 +421,11 @@ jobs: with: name: sftpgo_${{ steps.get_version.outputs.SFTPGO_VERSION }}_linux_ppc64le.tar.xz + - name: Download armv7 artifact + uses: actions/download-artifact@v2 + with: + name: sftpgo_${{ steps.get_version.outputs.SFTPGO_VERSION }}_linux_armv7.tar.xz + - name: Download Linux bundle artifact uses: actions/download-artifact@v2 with: @@ -423,6 +446,11 @@ jobs: with: name: sftpgo_${{ steps.get_version.outputs.PKG_VERSION }}-1_ppc64el.deb + - name: Download Deb armv7 artifact + uses: actions/download-artifact@v2 + with: + name: sftpgo_${{ steps.get_version.outputs.PKG_VERSION }}-1_armhf.deb + - name: Download RPM x86_64 artifact uses: actions/download-artifact@v2 with: @@ -438,6 +466,11 @@ jobs: with: name: sftpgo-${{ steps.get_version.outputs.PKG_VERSION }}-1.ppc64le.rpm + - name: Download RPM armv7 artifact + uses: actions/download-artifact@v2 + with: + name: sftpgo-${{ steps.get_version.outputs.PKG_VERSION }}-1.arm.rpm + - name: Download macOS x86_64 artifact uses: actions/download-artifact@v2 with: diff --git a/pkgs/debian/sftpgo.install.armhf b/pkgs/debian/sftpgo.install.armhf new file mode 100644 index 00000000..56c3de7f --- /dev/null +++ b/pkgs/debian/sftpgo.install.armhf @@ -0,0 +1,7 @@ +armv7/sftpgo usr/bin +sftpgo.json etc/sftpgo +init/sftpgo.service lib/systemd/system +bash_completion/sftpgo usr/share/bash-completion/completions +man/man1/* usr/share/man/man1 +templates usr/share/sftpgo +static usr/share/sftpgo