]> git.mxchange.org Git - friendica.git/blob - .github/workflows/releases.yml
More logging for the contact discovery
[friendica.git] / .github / workflows / releases.yml
1 name: Generate release packages
2 on:
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
54       - name: Upload artifact
55         uses: actions/upload-artifact@v2
56         with:
57           name: friendica
58           path: build/
59
60       - name: Upload to release
61         uses: softprops/action-gh-release@v1
62         with:
63           files: |
64             build/${{ steps.artifact.outputs.name }}.tar.gz
65             build/${{ steps.artifact.outputs.name }}.tar.gz.sha256
66         env:
67           GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}