forked from telegramdesktop/tdesktop
-
Notifications
You must be signed in to change notification settings - Fork 16
67 lines (56 loc) · 2.17 KB
/
linux.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
name: Linux
on:
push:
tags:
- '*'
jobs:
build:
runs-on: ubuntu-latest
container:
image: omanshkrishn/materialgram:latest
steps:
- name: Update System
run: pacman -Syu --noconfirm
- name: Set Tag Name
run: echo "TAGNAME=$(echo ${{ github.ref }} | cut -d '/' -f3)" >> $GITHUB_ENV
- name: Build materialgram
run: |
[ -d "/home/builder" ] && cd /home/builder || { mkdir -p /home/builder && cd /home/builder; }
git clone https://github.com/kukuruzka165/materialgram --recursive -b ${{ env.TAGNAME }} && cd materialgram
cmake \
-B build \
-G Ninja \
-DCMAKE_INSTALL_PREFIX="/usr" \
-DCMAKE_BUILD_TYPE=Release \
-DTDESKTOP_API_ID=${{ secrets.API_ID }} \
-DTDESKTOP_API_HASH=${{ secrets.API_HASH }} \
-DDESKTOP_APP_DISABLE_AUTOUPDATE=True \
-DCMAKE_INTERPROCEDURAL_OPTIMIZATION=ON
ninja -C build -j$(nproc --all)
mkdir fakeroot && DESTDIR=$(pwd)/fakeroot ninja -C build install && cd fakeroot
tar -czvf materialgram-${{ env.TAGNAME }}.tar.gz usr
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: materialgram-${{ env.TAGNAME }}
path: /home/builder/materialgram/fakeroot/materialgram-${{ env.TAGNAME }}.tar.gz
- name: Upload artifact to Release
uses: softprops/action-gh-release@v1
if: startsWith(github.ref, 'refs/tags/')
with:
name: ${{ env.TAGNAME }}
token: ${{ secrets.PAT }}
files: /home/builder/materialgram/fakeroot/materialgram-${{ env.TAGNAME }}.tar.gz
trigger-workflow:
runs-on: ubuntu-latest
needs: build
steps:
- name: Set Tag Name
run: echo "TAGNAME=$(echo ${{ github.ref }} | cut -d '/' -f3)" >> $GITHUB_ENV
- name: Trigger repository dispatch event
uses: peter-evans/repository-dispatch@v3
with:
token: ${{ secrets.OKsPAT }}
repository: materialgram/materialgram-bin
event-type: new-release
client-payload: '{"tagname": "${{ env.TAGNAME }}", "pkgrel": "1"}'