From 01240c5fbde26b189945b24fba0955669c19aac7 Mon Sep 17 00:00:00 2001 From: Philipp Date: Sun, 2 May 2021 23:20:58 +0200 Subject: [PATCH] Create release workflow --- .github/workflows/releases.yml | 72 ++++++++++++++++++++++++++++++++++ .gitignore | 4 +- mods/README.md | 4 ++ mods/release-list.txt | 29 ++++++++++++++ 4 files changed, 108 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/releases.yml create mode 100644 mods/release-list.txt diff --git a/.github/workflows/releases.yml b/.github/workflows/releases.yml new file mode 100644 index 0000000000..a10ca28099 --- /dev/null +++ b/.github/workflows/releases.yml @@ -0,0 +1,72 @@ +name: Generate release packages +on: [pull_request] +# release: +# types: [published] +jobs: + release: + name: Create release + runs-on: ubuntu-latest + steps: + - name: Checkout code + uses: actions/checkout@v2 + + - name: Retrieve version + id: release + run: echo "::set-output name=version::$(echo VERSION)" + + - name: Build project for production + run: | + composer install --no-dev --optimize-autoloader + mkdir build + + - name: Create artifact + run: tar -xvjf build/friendica-full-${{ steps.release.outputs.version }}.tar.gz -T mods/release-list.txt + + - name: Upload artifact + uses: actions/upload-artifact@v2 + with: + name: friendica + path: build/build/friendica-full-${{ steps.release.outputs.version }}.tar.gz + +# - name: Upload to release +# uses: JasonEtco/upload-to-release@master +# with: +# args: build/friendica-full-${{ steps.release.outputs.version }}.tar.gz application/zip +# env: +# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + php70: + name: Create legacy release for PRE PHP 7.3 + runs-on: ubuntu-latest + steps: + - name: Checkout code + uses: actions/checkout@v2 + + - name: Retrieve version + id: release + run: echo "::set-output name=version::$(echo VERSION)" + + - name: Downgrade code for production (to PHP 7.0) + run: | + composer install + vendor/bin/rector process + + - name: Build project for production + run: | + composer install --no-dev --optimize-autoloader + mkdir build + + - name: Create artifact + run: tar -xvjf build/friendica-full-${{ steps.release.outputs.version }}-legacy.tar.gz -T mods/release-list.txt + + - name: Upload artifact + uses: actions/upload-artifact@v2 + with: + name: friendica + path: build/build/friendica-full-${{ steps.release.outputs.version }}-legacy.tar.gz + +# - name: Upload to release +# uses: JasonEtco/upload-to-release@master +# with: +# args: build/friendica-full-${{ steps.release.outputs.version }}-legacy.tar.gz application/zip +# env: +# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} \ No newline at end of file diff --git a/.gitignore b/.gitignore index 9044604f81..45399b83f2 100644 --- a/.gitignore +++ b/.gitignore @@ -84,4 +84,6 @@ venv/ /bin/phpunit #Ignore cache file -.php_cs.cache \ No newline at end of file +.php_cs.cache + +build \ No newline at end of file diff --git a/mods/README.md b/mods/README.md index fe7a7fed57..6890e4feae 100644 --- a/mods/README.md +++ b/mods/README.md @@ -34,3 +34,7 @@ Sample systemd unit files to start worker.php periodically. Please place them in the correct location for your system, typically this is `/etc/systemd/system/friendicaworker.timer` and `/etc/systemd/system/friendicaworker.service`. Please report problems and improvements to `!helpers@forum.friendi.ca` and `@utzer@social.yl.ms` or open an issue in [the Github Friendica page](https://github.com/friendica/friendica/issues). This is for usage of systemd instead of cron to start the worker periodically, the solution is a work-in-progress and can surely be improved. + +## `release-list.txt` + +Contains all directories and files, which are necessary for a Friendica release. \ No newline at end of file diff --git a/mods/release-list.txt b/mods/release-list.txt new file mode 100644 index 0000000000..dfebc02169 --- /dev/null +++ b/mods/release-list.txt @@ -0,0 +1,29 @@ +bin/auth_ejabberd.php +bin/console +bin/console.bat +bin/console.php +bin/daemon.php +bin/testargs.php +bin/worker.php +config/ +doc/ +images/ +include/ +mod/ +mods/ +spec/ +src/ +static/ +vendor/ +view/ +.htaccess-dist +boot.php +CHANGELOG +CREDITS.txt +database.sql +index.php +LICENSE +README.md +security.txt +update.php +VERSION \ No newline at end of file