Create release workflow

This commit is contained in:
Philipp Holzer 2021-05-02 23:20:58 +02:00
parent 904f9624f9
commit 01240c5fbd
No known key found for this signature in database
GPG Key ID: 9A28B7D4FF5667BD
4 changed files with 108 additions and 1 deletions

72
.github/workflows/releases.yml vendored Normal file
View File

@ -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 }}

4
.gitignore vendored
View File

@ -84,4 +84,6 @@ venv/
/bin/phpunit
#Ignore cache file
.php_cs.cache
.php_cs.cache
build

View File

@ -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.

29
mods/release-list.txt Normal file
View File

@ -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