-
Notifications
You must be signed in to change notification settings - Fork 22
73 lines (63 loc) · 2.76 KB
/
main.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
name: Liman CI
on: [push]
jobs:
build:
runs-on: ubuntu-20.04
steps:
- name: Getting Main Liman Repository
uses: actions/checkout@v2
with:
path: package/liman/server
- name: Set up Liman Environment
uses: shivammathur/setup-php@v2
with:
php-version: "8.1"
tools: composer
extensions: ssh2, curl, sqlite3, ldap, mbstring, xml, zip, posix, smbclient, gd
- name: Restore the Composer cache directory
id: composercache
run: echo "::set-output name=dir::$(composer config cache-files-dir)"
- uses: actions/cache@v3
with:
path: ${{ steps.composercache.outputs.dir }}
key: ${{ runner.os }}-'8.1'-composer-${{ hashFiles('**/composer.json') }}
restore-keys: ${{ runner.os }}-'8.1'-composer-
- name: Build Liman Package
env:
PRIVATE_KEY: ${{ secrets.PRIVATE_KEY }}
PASSPHRASE: ${{ secrets.PASSPHRASE }}
run: |
sudo apt install zip gpg curl jq wget -y
mkdir -p /home/runner/.gnupg
echo """
use-agent
pinentry-mode loopback""" | sudo tee -a /home/runner/.gnupg/gpg.conf
echo "$PRIVATE_KEY" | gpg --import --batch --yes --passphrase $PASSPHRASE
VERSION=`cat package/liman/server/storage/VERSION`
MESSAGE="Branch: ${GITHUB_REF#refs/heads/} \n"
MESSAGE+="Version: $VERSION \n"
sudo chmod +x package/liman/server/storage/create_deb.sh
./package/liman/server/storage/create_deb.sh master master master master $GITHUB_RUN_NUMBER $PASSPHRASE
[ "$GITHUB_REF" == "refs/heads/master" ] && PRERELEASE=false || PRERELEASE=true
FILE_NAME="liman-$VERSION-$GITHUB_RUN_NUMBER"
FILE_NAME=$(echo $FILE_NAME | tr / -)
cp package.deb $FILE_NAME.deb
cp /tmp/package.rpm $FILE_NAME.rpm
echo "RELEASE_VER=$(echo $VERSION)" >> $GITHUB_ENV
echo "RELEASE_DEBFILENAME=$(echo $FILE_NAME.deb)" >> $GITHUB_ENV
echo "RELEASE_RPMFILENAME=$(echo $FILE_NAME.rpm)" >> $GITHUB_ENV
echo "RELEASE_RUNNUMBER=$(echo $GITHUB_RUN_NUMBER)" >> $GITHUB_ENV
echo "PRERELEASE=$(echo $PRERELEASE)" >> $GITHUB_ENV
echo "LIMAN_BRANCH=${GITHUB_REF#refs/heads/}" >> $GITHUB_ENV
- name: Release 🚀
id: create_release
uses: softprops/action-gh-release@v1
env:
GITHUB_TOKEN: ${{ secrets.TOKEN }}
with:
files: |
${{ env.RELEASE_DEBFILENAME }}
${{ env.RELEASE_RPMFILENAME }}
name: "Release ${{ env.RELEASE_VER }} - ${{ env.RELEASE_RUNNUMBER }}"
tag_name: "release.${{ env.LIMAN_BRANCH }}.${{ env.RELEASE_RUNNUMBER }}"
prerelease: ${{ env.PRERELEASE }}