This repository has been archived by the owner on May 15, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
95 lines (79 loc) · 2.4 KB
/
flutter.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
name: Flutter app build and release
env:
TAG_NAME: "v2"
RELEASE_TITLE: "Transfer-client v2"
on:
push:
paths-ignore:
- "**/*.md"
jobs:
linux:
name: Build linux app
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Setup dart and flutter
uses: subosito/flutter-action@v2
with:
flutter-version: "3.13.8"
- name: Patch for linux build
run: |
flutter doctor
sudo apt-get update -y
sudo apt-get install -y ninja-build libgtk-3-dev
flutter doctor
- name: flutter get dependency
run: |
flutter pub get
- name: Build and compress
run: |
flutter build linux --obfuscate --split-debug-info=tcli.debug-info
tar zcvf tcli_linux64.tar.gz ./build/linux/x64/release/bundle
- name: "Uplaod artifact"
uses: actions/upload-artifact@v3
with:
name: tcli-linux
path: |
./tcli_linux64.tar.gz
retention-days: 1
android:
name: Build android apk
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Setup dart and flutter
uses: subosito/flutter-action@v2
with:
flutter-version: "3.13.8"
- name: flutter get dependency
run: |
flutter pub get
- name: Build apk
run: |
flutter build apk --no-shrink --split-per-abi --obfuscate --split-debug-info=tcli.debug-info
- name: "Uplaod artifact"
uses: actions/upload-artifact@v3
with:
name: tcli-android
path: |
./build/app/outputs/apk/release/*
retention-days: 1
publish:
needs: [linux, android]
runs-on: ubuntu-latest
env:
GH_REPO: ${{ github.repository }}
GH_TOKEN: ${{ secrets.RELEASE_TOKEN }}
permissions:
contents: write
steps:
- uses: actions/checkout@v4
- uses: actions/download-artifact@v3
- name: Install dependencies
run: sudo apt-get update && sudo apt-get install -y gettext-base
- name: Delete existing release
run: |
gh release delete $TAG_NAME --yes || true
- name: Create Release and Upload Release Asset
run: |
gh release create $TAG_NAME --notes-file "./.github/workflows/release_note.md" --title "$RELEASE_TITLE" --target $GITHUB_SHA tcli-linux/* tcli-android/*