diff options
| author | Giovanni | 2022-05-15 22:29:16 +0200 |
|---|---|---|
| committer | GitHub | 2022-05-15 22:29:16 +0200 |
| commit | 2a52388a05bdf4cdde302030cc591aebdbf29998 (patch) | |
| tree | f2def44912d9be9d18ac69de42c3a492b2570155 | |
| parent | a9d848d576083323ecb93caa5d5eee9bc3287b37 (diff) | |
Build release debs in CI
| -rw-r--r-- | .github/workflows/release.yml | 71 | ||||
| -rwxr-xr-x | debian/rules | 4 |
2 files changed, 75 insertions, 0 deletions
diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..6d8d3d7 --- /dev/null +++ b/.github/workflows/release.yml | |||
| @@ -0,0 +1,71 @@ | |||
| 1 | name: Release Builder | ||
| 2 | on: | ||
| 3 | push: | ||
| 4 | branches: | ||
| 5 | - "release-*" | ||
| 6 | tags: | ||
| 7 | - "v*" | ||
| 8 | pull_request: | ||
| 9 | branches: | ||
| 10 | - "release-*" | ||
| 11 | |||
| 12 | jobs: | ||
| 13 | build-deb: | ||
| 14 | runs-on: ubuntu-latest | ||
| 15 | name: ${{ matrix.name }} | ||
| 16 | container: ${{ matrix.container }} | ||
| 17 | strategy: | ||
| 18 | fail-fast: false | ||
| 19 | matrix: | ||
| 20 | name: | ||
| 21 | [ | ||
| 22 | "debian-buster", | ||
| 23 | "debian-stretch", | ||
| 24 | "debian-bullseye", | ||
| 25 | "debian-sid", | ||
| 26 | "debian-bookworm", | ||
| 27 | "ubuntu-bionic", | ||
| 28 | "ubuntu-focal", | ||
| 29 | "ubuntu-jammy", | ||
| 30 | "ubuntu-impish", | ||
| 31 | ] | ||
| 32 | include: | ||
| 33 | - name: debian-buster | ||
| 34 | container: debian:buster | ||
| 35 | - name: debian-stretch | ||
| 36 | container: debian:stretch | ||
| 37 | - name: debian-bullseye | ||
| 38 | container: debian:bullseye | ||
| 39 | - name: debian-sid | ||
| 40 | container: debian:sid | ||
| 41 | - name: debian-bookworm | ||
| 42 | container: debian:bookworm | ||
| 43 | - name: ubuntu-bionic | ||
| 44 | container: ubuntu:bionic | ||
| 45 | - name: ubuntu-focal | ||
| 46 | container: ubuntu:focal | ||
| 47 | - name: ubuntu-jammy | ||
| 48 | container: ubuntu:jammy | ||
| 49 | - name: ubuntu-impish | ||
| 50 | container: ubuntu:impish | ||
| 51 | steps: | ||
| 52 | - name: Checkout code | ||
| 53 | uses: actions/checkout@v2 | ||
| 54 | - name: Set timezone | ||
| 55 | if: startsWith(matrix.container, 'ubuntu:') | ||
| 56 | run: ln -snf /usr/share/zoneinfo/Europe/Paris /etc/localtime && echo Europe/Paris > /etc/timezone | ||
| 57 | - name: Update OS | ||
| 58 | run: apt-get -qqy update | ||
| 59 | - name: Install deps | ||
| 60 | run: DEBIAN_FRONTEND=noninteractive apt-get -qqy --no-install-recommends install fakeroot php-xml php-curl dpkg-dev gcc make libpcre3-dev dh-php php-dev build-essential | ||
| 61 | - name: Build debs | ||
| 62 | run: DPKG_SKIP_TESTS=1 dpkg-buildpackage -i -us -uc -tc -I -rfakeroot | ||
| 63 | - name: Move built debs and rename | ||
| 64 | run: | | ||
| 65 | mv -v ../*.deb ./ | ||
| 66 | ls *.deb | xargs -I % mv -v % ${{ matrix.name }}-% | ||
| 67 | - name: Upload artifacts | ||
| 68 | uses: actions/upload-artifact@v3 | ||
| 69 | with: | ||
| 70 | name: snuffleupagus-${{ matrix.name }} | ||
| 71 | path: ./*.deb | ||
diff --git a/debian/rules b/debian/rules index 70965bb..40eb4ac 100755 --- a/debian/rules +++ b/debian/rules | |||
| @@ -27,5 +27,9 @@ override_dh_auto_install: | |||
| 27 | install -m 644 -o root -g root config/snuffleupagus.ini debian/snuffleupagus/etc/php/$$(/usr/bin/php-config --version | cut -d '.' -f1-2)/mods-available/snuffleupagus.ini | 27 | install -m 644 -o root -g root config/snuffleupagus.ini debian/snuffleupagus/etc/php/$$(/usr/bin/php-config --version | cut -d '.' -f1-2)/mods-available/snuffleupagus.ini |
| 28 | 28 | ||
| 29 | override_dh_auto_test: | 29 | override_dh_auto_test: |
| 30 | ifeq ($(strip $(DPKG_SKIP_TESTS)),) | ||
| 30 | sed -i "s/\$$ext_params -d display_errors=0 -r/-d display_errors=0 -r/" src/run-tests.php | 31 | sed -i "s/\$$ext_params -d display_errors=0 -r/-d display_errors=0 -r/" src/run-tests.php |
| 31 | TEST_PHP_ARGS="-q" REPORT_EXIST_STATUS=1 make -C src test | 32 | TEST_PHP_ARGS="-q" REPORT_EXIST_STATUS=1 make -C src test |
| 33 | else | ||
| 34 | echo "skip tests" | ||
| 35 | endif \ No newline at end of file | ||
