Browse Source

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
pull/850/head
Hamish Coleman 3 years ago
committed by GitHub
parent
commit
7d4ff08200
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 127
      .github/workflows/tests.yml
  2. 3
      Makefile.in
  3. 3
      autogen.sh
  4. 3
      configure.seed
  5. 2
      packages/debian/Makefile.in
  6. 2
      packages/rpm/Makefile.in

127
.github/workflows/tests.yml

@ -1,5 +1,5 @@
name: testing name: Testing
on: on:
push: push:
@ -7,7 +7,7 @@ on:
jobs: jobs:
quicktest: quicktest:
name: Quick test name: Smoke test
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
@ -96,3 +96,126 @@ jobs:
- name: Upload data to codecov - name: Upload data to codecov
uses: codecov/codecov-action@v2 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

3
Makefile.in

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

3
autogen.sh

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

3
configure.seed

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

2
packages/debian/Makefile.in

@ -20,7 +20,7 @@ pkg:
install -m644 ../../doc/*.md ${N2N_BUILD}/usr/share/doc/n2n/ install -m644 ../../doc/*.md ${N2N_BUILD}/usr/share/doc/n2n/
@/bin/rm -f ../n2n*.deb @/bin/rm -f ../n2n*.deb
dpkg-buildpackage -rfakeroot -d -us -uc @BUILDPACKAGE_EXTRA@ 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 @\rm -f ../n2n_*dsc ../n2n_*.gz ../n2n_*changes
@/bin/mv ../n2n_*deb . @/bin/mv ../n2n_*deb .
@echo @echo

2
packages/rpm/Makefile.in

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

Loading…
Cancel
Save