From 28827c6af18171dfbaa6e84eb42aa2783cbe7887 Mon Sep 17 00:00:00 2001 From: Klaus Silveira Date: Fri, 14 Jan 2022 23:10:12 -0500 Subject: [PATCH] Updated legacy build. --- .github/workflows/{php.yml => legacy.yml} | 27 +++++++++++-- Makefile | 46 +++++++++++++++++++++++ themes/default/twig/footer.twig | 2 +- 3 files changed, 71 insertions(+), 4 deletions(-) rename .github/workflows/{php.yml => legacy.yml} (55%) create mode 100644 Makefile diff --git a/.github/workflows/php.yml b/.github/workflows/legacy.yml similarity index 55% rename from .github/workflows/php.yml rename to .github/workflows/legacy.yml index 125a288..e25189d 100644 --- a/.github/workflows/php.yml +++ b/.github/workflows/legacy.yml @@ -1,10 +1,11 @@ -name: build +name: Legacy Build on: push: - branches: [ master ] + branches: [ legacy ] + pull_request: - branches: [ master ] + branches: [ legacy ] jobs: build: @@ -37,3 +38,23 @@ jobs: - name: Run test suite run: composer run-script test + + release: + runs-on: ubuntu-latest + needs: [build] + steps: + - name: Checkout + uses: actions/checkout@v2 + + - name: Build package + run: make build + + - name: Rename package to current tag + run: mv build.zip gitlist-${{ github.ref_name }}.zip + + - name: Release + uses: softprops/action-gh-release@v1 + if: startsWith(github.ref, 'refs/tags/') + with: + generate_release_notes: true + files: gitlist-${{ github.ref_name }}.zip diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..71fdecf --- /dev/null +++ b/Makefile @@ -0,0 +1,46 @@ +.PHONY: help build +.DEFAULT_GOAL := help +NAME := gitlist +VERSION := $(shell git show -s --format=%h) + +help: # Display the application manual + @echo -e "$(NAME) version \033[33m$(VERSION)\n\e[0m" + @echo -e "\033[1;37mUSAGE\e[0m" + @echo -e " \e[4mmake\e[0m [] ... []\n" + @echo -e "\033[1;37mAVAILABLE COMMANDS\e[0m" + @grep -E '^[a-zA-Z_-]+:.*?# .*$$' $(MAKEFILE_LIST) | sort | awk 'BEGIN {FS = ":.*?# "}; {printf " \033[32m%-20s\033[0m %s\n", $$1, $$2}' + +check-deps: + @if ! [ -x "$$(command -v composer)" ]; then\ + echo -e '\n\033[0;31mcomposer is not installed.';\ + exit 1;\ + else\ + echo -e "\033[0;32mcomposer installed\033[0m";\ + fi + +setup: check-deps # Setup dependencies and development configuration + composer install + +test: # Run automated test suite + $(EXEC_PHP) composer test + +build: # Build application package + @rm -rf vendor/ + @composer install --ignore-platform-reqs --no-dev --no-scripts -o + @zip ./build.zip \ + -r * .[^.]* \ + -x '.github/*' \ + -x 'cache/*' \ + -x 'logo/*' \ + -x 'tests/*' \ + -x 'pkg_builder/*' \ + -x 'build.xml' \ + -x '.git/*' \ + -x '.gitignore' \ + -x '.php-cs-fixer.cache' \ + -x '.php-cs-fixer.php' \ + -x '.phpunit.result.cache' \ + -x 'composer.json' \ + -x 'composer.lock' \ + -x 'Makefile' \ + -x 'phpunit.xml.dist' \ diff --git a/themes/default/twig/footer.twig b/themes/default/twig/footer.twig index f76aa82..f74ea1a 100644 --- a/themes/default/twig/footer.twig +++ b/themes/default/twig/footer.twig @@ -1,3 +1,3 @@