Skip to content

Revert "fix deprecation when calling htmlentities with null" #173

Revert "fix deprecation when calling htmlentities with null"

Revert "fix deprecation when calling htmlentities with null" #173

Workflow file for this run

name: Packaging
on:
push:
branches:
- master
- devel
- 'release-**'
- 'feature-008-debian'
tags:
- 'v*'
jobs:
debian:
name: Debian package
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Install required packages
run: |
sudo apt-get update
sudo apt-get install -y git-buildpackage build-essential dh-apache2 pkg-php-tools phpab php-xdebug
cd ~
# These need to be more recent than the ones shipped in ubuntu focal (to build the dependencies)
# We need these versions to build the dependencies. The previous ones don't work well with php 7.4 that is in ubuntu focal.
wget http://ftp.us.debian.org/debian/pool/main/p/php-zeta-console-tools/php-zeta-console-tools_1.7.2-2_all.deb
wget http://ftp.us.debian.org/debian/pool/main/p/phpab/phpab_1.26.0-1_all.deb
# There is this crash with dh_phpcomposer on ubuntu focal
# Non-static method Pkgtools\Base\Overrides::override() cannot be called statically in /usr/share/php/pkgtools/base/dependencies.php:45
# So we update pkg-php-tools to version 1.40 (focal has 1.38)
wget http://ftp.us.debian.org/debian/pool/main/p/pkg-php-tools/pkg-php-tools_1.40_all.deb
# Get php-random-compat (build dependency on >= 2.0.20)
wget http://mirrors.kernel.org/ubuntu/pool/universe/p/php-random-compat/php-random-compat_2.0.21-1_all.deb
# Install the packages
sudo dpkg -i php-zeta-console-tools_1.7.2-2_all.deb phpab_1.26.0-1_all.deb pkg-php-tools_1.40_all.deb php-random-compat_2.0.21-1_all.deb
- name: Set env
run: |
echo "LAST_COMMIT_HASH=$(git rev-parse --short HEAD)" >> $GITHUB_ENV
echo "LAST_COMMIT_DATE=$(git log -1 --date=format:%Y%m%d --format=%cd)" >> $GITHUB_ENV
echo "KALKUN_VERSION=$(grep kalkun_version application/config/kalkun_settings.php | cut -d "'" -f 4)" >> $GITHUB_ENV
echo "DEBEMAIL=none@domain.tld" >> $GITHUB_ENV
echo "DEBFULLNAME='Github Actions Deb Builder for Kalkun'" >> $GITHUB_ENV
- name: Build dependencies
run: |
set -x
# get the packages from debian salsa servers as they have not entered Debian yet
mkdir -p ~/deps
cd ~/deps
gbp clone https://salsa.debian.org/php-team/pear/php-codeigniter-framework
gbp clone https://salsa.debian.org/php-team/pear/php-datto-json-rpc
gbp clone https://salsa.debian.org/php-team/pear/php-datto-json-rpc-http
gbp clone https://salsa.debian.org/php-team/pear/php-giggsey-locale
gbp clone https://salsa.debian.org/php-team/pear/php-giggsey-libphonenumber
gbp clone https://salsa.debian.org/php-team/pear/php-kissifrot-php-ixr
gbp clone https://salsa.debian.org/php-team/pear/php-league-csv
# Install some dependencies to be able to build the packages (for php-giggsey-locale & php-league-csv)
sudo apt-get install -y phpunit php-symfony-console php-symfony-filesystem
sudo apt-get install -y php-curl php-xdebug
# First build php-giggsey-locale because it is a dependency to build php-giggsey-libphonenumber
cd php-giggsey-locale ; \
gbp export-orig ; \
sed -i -e "s/debhelper-compat (= 13)/debhelper-compat (= 12)/" debian/control ; \
dpkg-buildpackage -d ; \
cd ~/deps ; \
# Install php-giggsey-locale
sudo apt-get install ./php-giggsey-locale*.deb
# We apply a change with sed:
# - depend on debhelper 12 (because ubuntu focal has only debhelper 12)
for dir in $(find -type d -maxdepth 1 -mindepth 1); do \
cd $dir; \
gbp export-orig ; \
sed -i -e "s/debhelper-compat (= 13)/debhelper-compat (= 12)/" debian/control ; \
dpkg-buildpackage -d ; \
cd ~/deps ; \
done
- name: Build kalkun packages
run: |
set -x
# Download the only the debian folder from debian salsa servers to be able to build kalkun
# This adds only the debian folder to $GITHUB_REF_NAME to be able to build the packages
git remote add debian https://salsa.debian.org/bastif/kalkun.git
git fetch debian
git checkout -b debian_branch debian/master
git checkout $GITHUB_REF_NAME
git checkout debian_branch -- debian
git status
if [[ "$(git tag --points-at ${GIT_BRANCH})" != "" ]]; then \
KALKUN_VERSION="$(git tag --points-at ${GIT_BRANCH} | sed "s/^v//")" ; \
DEB_VERSION=$(echo ${KALKUN_VERSION} | sed -e "s/-/~/g")-1 ; \
rm debian/changelog
dch --package kalkun --newversion="$DEB_VERSION" --create $DEB_VERSION ; \
gbp export-orig --upstream-tag=$(git tag --points-at ${GIT_BRANCH}) --compression=xz ; \
else \
DEB_VERSION=$(echo $KALKUN_VERSION | sed -e "s/-/~/g")~${LAST_COMMIT_DATE} ; \
gbp dch --new-version="$DEB_VERSION" --snapshot --ignore-branch ; \
# Append debian version to version number ; \
sed -i -e "1s/)/-1)/" debian/changelog ; \
gbp export-orig --upstream-tree=BRANCH --upstream-branch=$(git rev-parse --abbrev-ref HEAD) --compression=xz ; \
fi
# depend on debhelper 12 (because ubuntu focal has only debhelper 12)
sed -i -e "s/debhelper-compat (= 13)/debhelper-compat (= 12)/" debian/control
dpkg-buildpackage -d
- name: Copy source & binary packages, and dependencies
if: always()
run: |
set -x
mkdir -p ~/Kalkun_${GITHUB_REF_NAME}_debianBundle
dcmd mv ../*.changes ~/Kalkun_${GITHUB_REF_NAME}_debianBundle
cp ~/deps/*.deb ~/Kalkun_${GITHUB_REF_NAME}_debianBundle
cd ~ && tar -cvf Kalkun_${GITHUB_REF_NAME}_debianBundle.tar Kalkun_${GITHUB_REF_NAME}_debianBundle
echo "my_home=$HOME" >> $GITHUB_ENV
- name: Archive artifacts
if: always()
uses: actions/upload-artifact@v2
with:
name: Debian packages (source & binary)
path: ~/Kalkun_${{ github.ref_name }}_debianBundle/*
if-no-files-found: ignore
- name: Release
uses: softprops/action-gh-release@v1
if: startsWith(github.ref, 'refs/tags/')
with:
files: |
${{ env.my_home }}/Kalkun_${{ github.ref_name }}_debianBundle.tar
prebuilt:
name: Prebuilt packages by PHP version
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Composer (php-actions)
uses: php-actions/composer@v6
with:
dev: no
php_version: "7.4"
php_extensions: ctype curl hash intl json mbstring session
- name: Install required packages
run: |
if ! command -v jq; then sudo apt-get update && sudo apt-get install -y jq; fi
- name: Build prebuilt packages with Composer dependencies
run: |
set -x
git fetch --prune --unshallow --tags
# Start with 7.1.24 since this is for the DEMO we publish on sourceforge.
./utils/build_single_dist.sh 7.1.24
# They build for all versions.
./utils/build_single_dist.sh 5.6
./utils/build_single_dist.sh 7.0
./utils/build_single_dist.sh 7.2
./utils/build_single_dist.sh 7.3
./utils/build_single_dist.sh 7.4
./utils/build_single_dist.sh 8.0
./utils/build_single_dist.sh 8.1
ls dist
- name: Archive artifacts for PHP 5.6
if: always()
uses: actions/upload-artifact@v2
with:
name: Prebuilt package for PHP 5.6
path: 'dist/*forPHP5.6*'
if-no-files-found: ignore
- name: Archive artifacts for PHP 7.0
if: always()
uses: actions/upload-artifact@v2
with:
name: Prebuilt package for PHP 7.0
path: 'dist/*forPHP7.0*'
if-no-files-found: ignore
- name: Archive artifacts for PHP 7.1.24
if: always()
uses: actions/upload-artifact@v2
with:
name: Prebuilt package for PHP 7.1.24
path: 'dist/*forPHP7.1.24*'
if-no-files-found: ignore
- name: Archive artifacts for PHP 7.2
if: always()
uses: actions/upload-artifact@v2
with:
name: Prebuilt package for PHP 7.2
path: 'dist/*forPHP7.2*'
if-no-files-found: ignore
- name: Archive artifacts for PHP 7.3
if: always()
uses: actions/upload-artifact@v2
with:
name: Prebuilt package for PHP 7.3
path: 'dist/*forPHP7.3*'
if-no-files-found: ignore
- name: Archive artifacts for PHP 7.4
if: always()
uses: actions/upload-artifact@v2
with:
name: Prebuilt package for PHP 7.4
path: 'dist/*forPHP7.4*'
if-no-files-found: ignore
- name: Archive artifacts for PHP 8.0
if: always()
uses: actions/upload-artifact@v2
with:
name: Prebuilt package for PHP 8.0
path: 'dist/*forPHP8.0*'
if-no-files-found: ignore
- name: Archive artifacts for PHP 8.1
if: always()
uses: actions/upload-artifact@v2
with:
name: Prebuilt package for PHP 8.1
path: 'dist/*forPHP8.1*'
if-no-files-found: ignore
- name: Release
uses: softprops/action-gh-release@v1
if: startsWith(github.ref, 'refs/tags/')
with:
files: "dist/*"