install themes #92
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Build Release | |
on: | |
push: | |
tags: v[1-9]+.[0-9]+.* | |
jobs: | |
test: | |
runs-on: ubuntu-18.04 | |
continue-on-error: ${{ matrix.experimental }} | |
strategy: | |
fail-fast: false | |
matrix: | |
php-version: ['7.4'] | |
experimental: [false] | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Find the version | |
run: echo "RELEASE_VERSION=${GITHUB_REF#refs/*/v}" >> $GITHUB_ENV | |
- name: Show the discovered version | |
run: | | |
echo $RELEASE_VERSION | |
echo ${{ env.RELEASE_VERSION }} | |
echo $GITHUB_REF | |
echo ${{ env.GITHUB_REF }} | |
- name: Set up PHP ${{ matrix.php-version }} | |
uses: shivammathur/setup-php@v2 | |
with: | |
php-version: ${{ matrix.php-version }} | |
- name: Setup Packages | |
run: | | |
cd $GITHUB_WORKSPACE | |
sudo apt update && sudo apt install -y rsync | |
- name: Cache Composer dependencies | |
uses: actions/cache@v2 | |
with: | |
path: /tmp/composer-cache | |
key: ${{ matrix.php-version }}-${{ hashFiles('**/composer.lock') }} | |
- name: Install dependencies | |
uses: php-actions/composer@v5 | |
with: | |
dev: yes | |
args: --prefer-dist --no-interaction | |
php_version: 7.4 | |
php_extensions: xml | |
version: 2 | |
- name: Install Plugins | |
run: | | |
cd $GITHUB_WORKSPACE | |
./scripts/install-plugins.sh vendor public_html/lists/admin/plugins/ | |
./scripts/install-themes.sh vendor public_html/lists/admin/ui/ | |
- name: Install the phpList4 based REST API | |
run: | | |
cd $GITHUB_WORKSPACE | |
cd public_html/lists | |
wget https://github.com/phpList/base-distribution/archive/phplist3.zip | |
unzip phplist3.zip | |
rm phplist3.zip | |
mv base-distribution-phplist3 base | |
cd base | |
composer update --no-dev | |
- name: Create Database | |
run: | | |
sudo systemctl start mysql.service | |
sudo mysql -proot -e 'drop database if exists phplistdb' | |
sudo mysqladmin -proot create phplistdb | |
sudo mysql -proot -e 'grant all on phplistdb.* to phplist@localhost identified by "phplist"' | |
- name: Start Test Server | |
run: | | |
cd $GITHUB_WORKSPACE | |
cp -fv tests/default.behat.yml tests/behat.yml | |
cp -fv tests/ci/config.php public_html/lists/config/config.php | |
mkdir -p output/screenshots | |
mkdir -p build/mails | |
./bin/start-selenium > output/selenium.log 2>&1 & | |
sleep 5 | |
sudo php -S 0.0.0.0:80 -t public_html > /dev/null 2>&1 & | |
- name: Check PHP syntax errors | |
uses: overtrue/[email protected] | |
with: | |
path: ./public_html | |
options: --exclude=base/vendor | |
- name: Report Versions | |
run: | | |
google-chrome --version | |
php -v | |
chromedriver -v | |
geckodriver -V | |
which geckodriver | |
which chromedriver | |
which rsync | |
rsync --version | |
firefox -v | |
vendor/bin/behat -V | |
- name: Run BDD Tests | |
run: | | |
cd $GITHUB_WORKSPACE/tests | |
../vendor/bin/behat -n -fprogress -p chrome --strict --stop-on-failure --tags=@initialise | |
../vendor/bin/behat -n -fprogress -p chrome --strict --stop-on-failure --tags="~@initialise && ~@wip" | |
- name: Upload the screenshots | |
if: always() | |
uses: actions/upload-artifact@v2 | |
with: | |
path: "output" | |
name: "behat output" | |
retention-days: 3 | |
- name: Clean Up | |
run: | | |
cd $GITHUB_WORKSPACE | |
cd .. | |
mv phplist3 phplist-$RELEASE_VERSION | |
sudo find . -type d -exec chmod 755 {} \; | |
sudo find . -type f -exec chmod 644 {} \; | |
cd phplist-$RELEASE_VERSION | |
chmod 777 public_html/lists/admin/plugins | |
cat public_html/lists/admin/init.php | tr '\n' '\r' | sed 's~//## remove on rollout.*//## end remove on rollout ###~define("VERSION","'${RELEASE_VERSION}'");~' | tr '\r' '\n' > /tmp/$$.init | |
mv -f /tmp/$$.init public_html/lists/admin/init.php | |
sed -i s~define\(\'STRUCTUREVERSION\'.*~define\(\'STRUCTUREVERSION\',\"${RELEASE_VERSION}\"\)\;~ public_html/lists/admin/structure.php | |
sed -i s/^VERSION=/VERSION=${RELEASE_VERSION}/ VERSION | |
cd .. | |
zip -rq9 phplist-${RELEASE_VERSION}.zip phplist-${RELEASE_VERSION} | |
tar cf phplist-${RELEASE_VERSION}.tar phplist-${RELEASE_VERSION} | |
remove=( | |
default.behat.yml | |
TESTING.md | |
.dotgitlab-ci.yml | |
.travis.yml | |
composer.json | |
composer.lock | |
.git | |
.github | |
.php_cs | |
.gitmodules | |
Dockerfile | |
Vagrantfile | |
.styleci.yml | |
.gitignore | |
.gitsvnextmodules | |
tests | |
output.log | |
output | |
build | |
.phplist-cache | |
docker_tag | |
vendor | |
public_html/lists/admin/tests | |
scripts | |
bin/start-selenium | |
bin/fake-sendmail.sh | |
bin/imgur-uploader.sh | |
public_html/lists/base/tests | |
public_html/lists/base/.htaccess | |
public_html/lists/base/phpunit.xml.dist | |
public_html/lists/base/composer.lock | |
public_html/lists/base/CODE_OF_CONDUCT.md | |
public_html/lists/admin/ui/default | |
) | |
for item in ${remove[@]}; do | |
[[ -f phplist-$RELEASE_VERSION/$item ]] && { | |
tar -vf phplist-${RELEASE_VERSION}.tar --delete phplist-$RELEASE_VERSION/$item | |
zip -d phplist-${RELEASE_VERSION}.zip phplist-$RELEASE_VERSION/$item | |
} | |
[[ -d phplist-$RELEASE_VERSION/$item ]] && { | |
tar -vf phplist-${RELEASE_VERSION}.tar --delete phplist-$RELEASE_VERSION/$item | |
zip -d phplist-${RELEASE_VERSION}.zip phplist-$RELEASE_VERSION/$item/\* | |
} | |
done | |
gzip phplist-${RELEASE_VERSION}.tar | |
mv phplist-${RELEASE_VERSION}.tar.gz phplist-${RELEASE_VERSION}.tgz | |
md5sum phplist-${RELEASE_VERSION}.* > phplist-${RELEASE_VERSION}.md5 | |
sha256sum phplist-${RELEASE_VERSION}.* > phplist-${RELEASE_VERSION}.sha256 | |
sha1sum phplist-${RELEASE_VERSION}.* > phplist-${RELEASE_VERSION}.sha1 | |
ls -l | |
mv phplist-$RELEASE_VERSION phplist3 | |
cd $GITHUB_WORKSPACE | |
- name: Set up S3cmd cli tool | |
uses: s3-actions/[email protected] | |
with: | |
provider: aws | |
region: 'us-east-1' | |
access_key: ${{ secrets.AWS_KEY_ID }} | |
secret_key: ${{ secrets.AWS_SECRET_ACCESS_KEY }} | |
- name: Upload the files | |
run: | | |
cd .. | |
s3cmd put phplist-${RELEASE_VERSION}.* s3://${{ secrets.AWS_S3_VERSIONS_BUCKET }}/ | |
s3cmd put phplist3/public_html/lists/admin/images/power-phplist.png s3://${{ secrets.AWS_S3_POWERED_BUCKET }}/images/${RELEASE_VERSION}/ |