]> git.mxchange.org Git - friendica.git/blob - .github/workflows/releases.yml
Automatic release artifact generation
[friendica.git] / .github / workflows / releases.yml
1 name: Generate release packages
2 on: [pull_request]
3 #  release:
4 #    types: [published]
5 jobs:
6   release:
7     name: Create release
8     runs-on: ubuntu-latest
9     steps:
10       - name: Checkout code
11         uses: actions/checkout@v2
12
13       - name: Setup PHP, with composer and extensions
14         uses: shivammathur/setup-php@v2
15         with:
16           tools: pecl, composer:v1
17
18       - name: Retrieve version
19         id: release
20         run: echo "::set-output name=version::$(cat VERSION)"
21
22       - name: Validate composer.json and composer.lock
23         run: composer validate
24
25       - name: Get composer cache directory
26         id: composercache
27         run: echo "::set-output name=dir::$(composer config cache-files-dir)"
28
29       - name: Cache dependencies
30         uses: actions/cache@v2
31         with:
32           path: ${{ steps.composercache.outputs.dir }}
33           key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}
34           restore-keys: ${{ runner.os }}-composer-
35
36       - name: Install dependencies
37         run: composer install --no-dev --optimize-autoloader
38
39       - name: Create artifact
40         id: artifact
41         run: |
42           ARTIFACT="friendica-full-${{ steps.release.outputs.version }}.tar.gz"
43           echo "::set-output name=name::${ARTIFACT}"
44           mkdir build
45           tar -cvjf build/${ARTIFACT} -T mods/release-list.txt
46
47       - name: SHA256
48         id: sha256
49         run: |
50           cd build
51           ARTIFACT=${{ steps.artifact.outputs.name }}
52           sha256sum "${ARTIFACT}" > "${ARTIFACT}.sha256"
53           echo "::set-output name=name::${ARTIFACT}.sha256"
54
55       - name: Upload artifact
56         uses: actions/upload-artifact@v2
57         with:
58           name: friendica
59           path: build/
60
61   #      - name: Upload to release
62   #        uses: JasonEtco/upload-to-release@master
63   #        with:
64   #          args: build/friendica-full-${{ steps.release.outputs.version }}.tar.gz application/zip
65   #        env:
66   #          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}