added automated binary artifacts (#849)

* Allow an autobuilder with no access to private key material to create testable packages

* Initial dpkg build - will need helpers installed to work

* Start adding required dpkg helpers

* Tweak package artifact names

* Add a windows 'package' builder

* Ensure prefix path handling deals with current directory change when descending to tools dir

* The tools makefile currently only needs the SBINDIR path to install properly

* Add a macos 'package' builder

* Remove unused configure variables

* Without commit history, some of the automatic version numbering will fail

* Add an rpm builder

* Need to set the env var for the rpm build before we change our working dir

* Allow gpg signing to fail for generating test rpm packages

* Unfortunately the rpm spec file hardcodes some path assumptions, so we need to use hacks to work around them

* Return to the top dir before moving things around

* A small change to make actions re-run the pipeline

* Name this workflow file with a nicer looking name
This commit is contained in:
Hamish Coleman 2021-10-11 13:59:28 +01:00 committed by GitHub
parent 5f3c27e3a6
commit 7d4ff08200
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 128 additions and 12 deletions

View File

@ -1,5 +1,5 @@
name: testing
name: Testing
on:
push:
@ -7,7 +7,7 @@ on:
jobs:
quicktest:
name: Quick test
name: Smoke test
runs-on: ubuntu-latest
steps:
@ -96,3 +96,126 @@ jobs:
- name: Upload data to codecov
uses: codecov/codecov-action@v2
package_dpkg:
needs: fulltest
name: Create packages for Debian/Ubuntu
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Install packages needed for build
run: |
sudo apt-get install debhelper
- name: Configure
run: |
./autogen.sh
./configure
cd packages/debian/
./configure
- name: Build
run: |
cd packages/debian/
make
- name: Upload dpkg
uses: actions/upload-artifact@v2
with:
name: package-amd64-dpkg
path: packages/debian/*.deb
package_rpm:
needs: fulltest
name: Create packages for Redhat
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Install packages needed for build
run: |
sudo apt-get install rpm
- name: Configure
run: |
./autogen.sh
./configure
cd packages/rpm/
./configure
- name: Build
run: |
make
HOME=$(pwd)/../
cd packages/rpm/
make
cd ../../
mv ../rpmbuild ./
- name: Upload rpm
uses: actions/upload-artifact@v2
with:
name: package-amd64-rpm
path: rpmbuild/RPMS/x86_64/*.rpm
package_windows:
needs: fulltest
name: Create packages for Windows
runs-on: windows-latest
steps:
- uses: actions/checkout@v2
- name: Configure and Build
shell: bash
run: |
./scripts/hack_fakeautoconf
make
- name: Create binary dir
shell: bash
run: |
make install DESTDIR=package
- name: Upload binary zip
uses: actions/upload-artifact@v2
with:
name: package-amd64-windows
path: package
package_macos:
needs: fulltest
name: Create packages for MacOS
runs-on: macos-latest
steps:
- uses: actions/checkout@v2
- name: Install packages needed for build
run: |
brew install automake
- name: Configure and Build
shell: bash
run: |
./autogen.sh
./configure
make
- name: Create binary dir
shell: bash
run: |
make install DESTDIR=package
- name: Upload binary zip
uses: actions/upload-artifact@v2
with:
name: package-amd64-macos
path: package

View File

@ -59,7 +59,6 @@ export MKDIR
export INSTALL
export INSTALL_PROG
export INSTALL_DOC
export PREFIX
export SBINDIR
MKDIR=mkdir -p
@ -188,7 +187,7 @@ install: edge supernode edge.8.gz supernode.1.gz n2n.7.gz
$(INSTALL_DOC) edge.8.gz $(MAN8DIR)/
$(INSTALL_DOC) supernode.1.gz $(MAN1DIR)/
$(INSTALL_DOC) n2n.7.gz $(MAN7DIR)/
$(MAKE) -C tools install
$(MAKE) -C tools install SBINDIR=$(abspath $(SBINDIR))
# Docker builder section
DOCKER_IMAGE_NAME=ntop/supernode

View File

@ -8,9 +8,6 @@ N2N_PATCH="0"
N2N_VERSION_SHORT="$N2N_MAJOR.$N2N_MINOR.$N2N_PATCH"
cat configure.seed | sed \
-e "s/@N2N_MAJOR@/$N2N_MAJOR/g" \
-e "s/@N2N_MINOR@/$N2N_MINOR/g" \
-e "s/@N2N_PATCH@/$N2N_PATCH/g" \
-e "s/@N2N_VERSION_SHORT@/$N2N_VERSION_SHORT/g" \
> configure.ac

View File

@ -124,9 +124,6 @@ AC_SUBST(CC)
AC_SUBST(AR)
AC_SUBST(CFLAGS)
AC_SUBST(LDFLAGS)
AC_SUBST(N2N_MAJOR)
AC_SUBST(N2N_MINOR)
AC_SUBST(N2N_PATCH)
AC_SUBST(N2N_VERSION_SHORT)
AC_SUBST(GIT_COMMITS)
AC_SUBST(GIT_REVISION)

View File

@ -20,7 +20,7 @@ pkg:
install -m644 ../../doc/*.md ${N2N_BUILD}/usr/share/doc/n2n/
@/bin/rm -f ../n2n*.deb
dpkg-buildpackage -rfakeroot -d -us -uc @BUILDPACKAGE_EXTRA@
dpkg-sig --sign builder -k D1EB60BE ../n2n_*deb
-dpkg-sig --sign builder -k D1EB60BE ../n2n_*deb
@\rm -f ../n2n_*dsc ../n2n_*.gz ../n2n_*changes
@/bin/mv ../n2n_*deb .
@echo

View File

@ -10,7 +10,7 @@ all: clean pkg
pkg:
rpmbuild -bb ./n2n.spec
@@RPM_SIGN_CMD@ $(HOME)/rpmbuild/RPMS/$(PLATFORM)/$(RPM_PKG)
-@@RPM_SIGN_CMD@ $(HOME)/rpmbuild/RPMS/$(PLATFORM)/$(RPM_PKG)
@echo ""
@echo "Package contents:"
@rpm -qpl $(HOME)/rpmbuild/RPMS/$(PLATFORM)/$(RPM_PKG)