-
Notifications
You must be signed in to change notification settings - Fork 3
122 lines (100 loc) · 3.76 KB
/
build-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
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
name: Build Linux
on:
workflow_call:
inputs:
version:
type: string
required: true
prefix:
type: string
required: true
dist-suffix: # "arm64" or "amd64"
type: string
required: true
jobs:
build-linux:
permissions:
contents: "read"
id-token: "write"
env:
version: ${{ inputs.version }}
prefix: ${{ inputs.prefix }}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Granting private modules access
run: git config --global url."https://${{ secrets.GH_TOKEN }}:x-oauth-basic@github.com/".insteadOf "https://github.com/"
- name: Repo access
run: |
mkdir /tmp/cache
echo "machine github.com login ${{ secrets.GH_TOKEN }} password x-oauth-basic" > /tmp/cache/.netrc
chmod 600 /tmp/cache/.netrc
- name: Install dependencies
run: |
sudo apt-get update
sudo apt-get install -y file build-essential pkg-config
sudo apt-get install -y libunwind-dev libstdc++-12-dev libgstreamer1.0-dev libgstreamer-plugins-base1.0-d cmake
sudo apt-get install -y libgtk-3-0 libblkid1 liblzma5
sudo apt-get install -y libpcap-dev libgtk-3-dev libayatana-appindicator3-dev ruby ruby-dev && sudo gem install bundler -v 2.2.26
- uses: actions/setup-go@v4
with:
go-version-file: "go.mod"
- name: Build
env:
SENTRY_AUTH_TOKEN: "${{ secrets.SENTRY_AUTH_TOKEN }}"
VERSION: ${{ inputs.version }}
run: |
make linux-amd64
- uses: actions/setup-python@v4
with:
python-version: '3.8'
- name: Install s3cmd
run: pip install s3cmd
- name: Set s3cmd permissions
run: |
echo "[default]" > "$HOME/.s3cfg"
echo "access_key = ${{ secrets.AWS_ACCESS_KEY }}" >> "$HOME/.s3cfg"
echo "secret_key = ${{ secrets.AWS_SECRET_KEY }}" >> "$HOME/.s3cfg"
# Install Flutter
- uses: subosito/flutter-action@v2
with:
channel: "stable"
flutter-version-file: pubspec.yaml
- run: flutter --version
- run: make ffigen
- name: Setup protoc
uses: arduino/setup-protoc@v2
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
- name: Activate protoc-gen-dart plugin
run: |
dart pub global activate protoc_plugin
- uses: seanmiddleditch/gha-setup-ninja@master
- run: touch app.env
- name: Build Flutter app
run: flutter build linux
- name: Build installer
run: |
cp liblantern.so "build/linux/${{inputs.dist-suffix}}/release/bundle"
VERSION="${{ inputs.version }}" make "package-linux-${{inputs.dist-suffix}}"
- uses: actions/upload-artifact@v4
with:
name: linux-build
path: |
lantern_${{inputs.version}}_x64.deb
- name: Push binaries to s3
env:
VERSION: "${{ inputs.version }}"
dist_versionless: "${{inputs.prefix}}-64-bit.deb"
dist: "${{inputs.prefix}}-${{inputs.version}}-64-bit.deb"
update: "lantern_update_linux_x64-${{inputs.version}}.bz2"
dist_source: "lantern_${{inputs.version}}_x64.deb"
update_source: lantern_update_linux_x64.bz2
run: |
ls -l
mv ${{ env.dist_source }} ${{ env.dist }}
mv ${{ env.update_source }} ${{ env.update }}
shasum -a 256 ${{ env.dist }} | cut -d " " -f 1 > ${{ env.dist }}.sha256
shasum -a 256 ${{ env.update }} | cut -d " " -f 1 > ${{ env.update }}.sha256
ls -l
s3cmd put --acl-public ${{ env.dist }} ${{ env.update }} ${{ env.update }}.sha256 ${{ env.dist }}.sha256 "s3://lantern"