66 lines
2 KiB
YAML
66 lines
2 KiB
YAML
|
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: Setup PHP, with composer and extensions
|
||
|
uses: shivammathur/setup-php@v2
|
||
|
with:
|
||
|
tools: pecl, composer:v1
|
||
|
|
||
|
- name: Retrieve version
|
||
|
id: release
|
||
|
run: echo "::set-output name=version::$(cat VERSION)"
|
||
|
|
||
|
- name: Validate composer.json and composer.lock
|
||
|
run: composer validate
|
||
|
|
||
|
- name: Get composer cache directory
|
||
|
id: composercache
|
||
|
run: echo "::set-output name=dir::$(composer config cache-files-dir)"
|
||
|
|
||
|
- name: Cache dependencies
|
||
|
uses: actions/cache@v2
|
||
|
with:
|
||
|
path: ${{ steps.composercache.outputs.dir }}
|
||
|
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}
|
||
|
restore-keys: ${{ runner.os }}-composer-
|
||
|
|
||
|
- name: Install dependencies
|
||
|
run: composer install --no-dev --optimize-autoloader
|
||
|
|
||
|
- name: Create artifact
|
||
|
id: artifact
|
||
|
run: |
|
||
|
ARTIFACT="friendica-full-${{ steps.release.outputs.version }}.tar.gz"
|
||
|
echo "::set-output name=name::${ARTIFACT}"
|
||
|
mkdir build
|
||
|
tar -cvjf build/${ARTIFACT} -T mods/release-list.txt
|
||
|
|
||
|
- name: SHA256
|
||
|
id: sha256
|
||
|
run: |
|
||
|
cd build
|
||
|
ARTIFACT=${{ steps.artifact.outputs.name }}
|
||
|
sha256sum "${ARTIFACT}" > "${ARTIFACT}.sha256"
|
||
|
echo "::set-output name=name::${ARTIFACT}.sha256"
|
||
|
|
||
|
- name: Upload artifact
|
||
|
uses: actions/upload-artifact@v2
|
||
|
with:
|
||
|
name: friendica
|
||
|
path: build/
|
||
|
|
||
|
# - 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 }}
|