mirror of
https://github.com/drakkan/sftpgo.git
synced 2025-12-06 14:20:55 +03:00
CI: build deb/rpm for arm64
This commit is contained in:
51
.github/workflows/development.yml
vendored
51
.github/workflows/development.yml
vendored
@@ -43,6 +43,28 @@ jobs:
|
||||
$DATE_TIME = ([datetime]::Now.ToUniversalTime().toString("yyyy-MM-ddTHH:mm:ssZ")) | Out-String
|
||||
go build -ldflags "-s -w -X github.com/drakkan/sftpgo/version.commit=$GIT_COMMIT -X github.com/drakkan/sftpgo/version.date=$DATE_TIME" -o sftpgo.exe
|
||||
|
||||
- name: Gather cross build info
|
||||
id: cross_info
|
||||
if: ${{ matrix.upload-coverage && startsWith(matrix.os, 'ubuntu-') }}
|
||||
run: |
|
||||
GIT_COMMIT=$(git describe --always)
|
||||
BUILD_DATE=$(date -u +%FT%TZ)
|
||||
echo ::set-output name=sha::${GIT_COMMIT}
|
||||
echo ::set-output name=created::${BUILD_DATE}
|
||||
|
||||
- name: Build with xgo
|
||||
if: ${{ matrix.upload-coverage && startsWith(matrix.os, 'ubuntu-') }}
|
||||
uses: crazy-max/ghaction-xgo@v1
|
||||
with:
|
||||
dest: cross
|
||||
prefix: sftpgo
|
||||
targets: linux/arm64
|
||||
v: true
|
||||
x: false
|
||||
race: false
|
||||
ldflags: -s -w -X github.com/drakkan/sftpgo/version.commit=${{ steps.cross_info.outputs.sha }} -X github.com/drakkan/sftpgo/version.date=${{ steps.cross_info.outputs.created }}
|
||||
buildmode: default
|
||||
|
||||
- name: Run test cases using SQLite provider
|
||||
run: go test -v -p 1 -timeout 10m ./... -coverprofile=coverage.txt -covermode=atomic
|
||||
|
||||
@@ -86,6 +108,7 @@ jobs:
|
||||
./sftpgo gen completion zsh > output/zsh_completion/_sftpgo
|
||||
./sftpgo gen man -d output/man/man1
|
||||
gzip output/man/man1/*
|
||||
cp cross/sftpgo-linux-arm64 output/ || :
|
||||
|
||||
- name: Prepare build artifact for Windows
|
||||
if: startsWith(matrix.os, 'windows-')
|
||||
@@ -127,6 +150,34 @@ jobs:
|
||||
name: sftpgo-${{ steps.build_linux_pkgs.outputs.pkg-version }}-x86_64-rpm
|
||||
path: pkgs/dist/rpm/*
|
||||
|
||||
- name: Build Linux Packages arm64
|
||||
id: build_linux_pkgs_arm64
|
||||
if: ${{ matrix.upload-coverage && startsWith(matrix.os, 'ubuntu-') }}
|
||||
run: |
|
||||
cp cross/sftpgo-linux-arm64 .
|
||||
cd pkgs
|
||||
rm -rf dist
|
||||
./build.sh
|
||||
PKG_VERSION=$(cat dist/version)
|
||||
echo "::set-output name=pkg-version::${PKG_VERSION}"
|
||||
env:
|
||||
NFPM_ARCH: arm64
|
||||
BIN_SUFFIX: -linux-arm64
|
||||
|
||||
- name: Upload Debian Package arm64
|
||||
if: ${{ matrix.upload-coverage && startsWith(matrix.os, 'ubuntu-') }}
|
||||
uses: actions/upload-artifact@v2
|
||||
with:
|
||||
name: sftpgo-${{ steps.build_linux_pkgs.outputs.pkg-version }}-arm64-deb
|
||||
path: pkgs/dist/deb/*
|
||||
|
||||
- name: Upload RPM Package arm64
|
||||
if: ${{ matrix.upload-coverage && startsWith(matrix.os, 'ubuntu-') }}
|
||||
uses: actions/upload-artifact@v2
|
||||
with:
|
||||
name: sftpgo-${{ steps.build_linux_pkgs.outputs.pkg-version }}-arm64-rpm
|
||||
path: pkgs/dist/rpm/*
|
||||
|
||||
test-postgresql-mysql:
|
||||
name: Test with PostgreSQL/MySQL
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
#!/bin/bash
|
||||
|
||||
NFPM_VERSION=1.9.0
|
||||
|
||||
NFPM_ARCH=${NFPM_ARCH:-amd64}
|
||||
if [ -z ${SFTPGO_VERSION} ]
|
||||
then
|
||||
LATEST_TAG=$(git describe --tags $(git rev-list --tags --max-count=1))
|
||||
@@ -30,11 +30,11 @@ $BASE_DIR/sftpgo gen man -d man1
|
||||
|
||||
cat >nfpm.yaml <<EOF
|
||||
name: "sftpgo"
|
||||
arch: "amd64"
|
||||
arch: "${NFPM_ARCH}"
|
||||
platform: "linux"
|
||||
version: ${VERSION}
|
||||
release: 1
|
||||
section: "default"
|
||||
section: "net"
|
||||
priority: "extra"
|
||||
maintainer: "Nicola Murino <nicola.murino@gmail.com>"
|
||||
provides:
|
||||
@@ -48,7 +48,7 @@ vendor: "SFTPGo"
|
||||
homepage: "https://github.com/drakkan/sftpgo"
|
||||
license: "GPL-3.0"
|
||||
files:
|
||||
${BASE_DIR}/sftpgo: "/usr/bin/sftpgo"
|
||||
${BASE_DIR}/sftpgo${BIN_SUFFIX}: "/usr/bin/sftpgo"
|
||||
./sftpgo-completion.bash: "/usr/share/bash-completion/completions/sftpgo"
|
||||
./man1/*: "/usr/share/man/man1/"
|
||||
${BASE_DIR}/init/sftpgo.service: "/lib/systemd/system/sftpgo.service"
|
||||
|
||||
Reference in New Issue
Block a user