-
Notifications
You must be signed in to change notification settings - Fork 59
141 lines (128 loc) · 4.35 KB
/
build.yml
File metadata and controls
141 lines (128 loc) · 4.35 KB
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
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
name: Build Final Flutter App
on: workflow_dispatch
jobs:
build_android:
name: Build APK
runs-on: ubuntu-latest
env:
KEYSTORE_PASSWORD: ${{ secrets.KEYSTORE_PASSWORD }}
KEY_ALIAS: ${{ secrets.KEY_ALIAS }}
KEY_PASSWORD: ${{ secrets.KEY_PASSWORD }}
steps:
- uses: actions/checkout@v2
- name: Set up Java
uses: actions/setup-java@v3
with:
distribution: 'temurin'
java-version: '20'
- uses: subosito/flutter-action@v2
with:
flutter-version: '3.38.5'
- uses: actions/checkout@v2
- run: flutter pub get
- name: Decode Keystore
run: |
echo "${{ secrets.KEYSTORE }}" | base64 --decode > android/app/keystore.jks
- name: Build APK
run: |
flutter build apk --release
env:
KEYSTORE_FILE: keystore.jks
KEYSTORE_PASSWORD: ${{ secrets.KEYSTORE_PASSWORD }}
KEY_ALIAS: ${{ secrets.KEY_ALIAS }}
KEY_PASSWORD: ${{ secrets.KEY_PASSWORD }}
- name: Verify APK signature (jarsigner)
run: |
jarsigner -verify -verbose -certs build/app/outputs/flutter-apk/app-release.apk
- name: List APK Directory
run: ls -alh ${{ github.workspace }}/build/app/outputs/flutter-apk
- name: Upload APK
uses: actions/upload-artifact@v4
with:
name: apk
path: ${{ github.workspace }}/build/app/outputs/flutter-apk/app-release.apk
build_windows:
name: Build Windows
runs-on: windows-latest
steps:
- uses: actions/checkout@v2
- uses: subosito/flutter-action@v2
with:
flutter-version: '3.38.5'
- run: flutter pub get
- run: mkdir -p ${{ github.workspace }}/build/windows/x64/runner/Release
- run: flutter build windows
- name: List Windows Build Directory
run: dir ${{ github.workspace }}/build/windows/x64/runner/Release
- name: zip everything
run: |
cd ${{ github.workspace }}/build/windows/x64/runner/Release
powershell -Command "Compress-Archive -Path * -DestinationPath rdnbenet-windows.zip"
- name: Upload binary
uses: actions/upload-artifact@v4
with:
name: windows-zip
path: ${{ github.workspace }}/build/windows/x64/runner/Release/rdnbenet-windows.zip
build_linux:
name: Build Linux
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: subosito/flutter-action@v2
with:
flutter-version: '3.38.5'
- run: sudo apt-get update
- run: sudo apt-get install -y ninja-build cmake libgtk-3-dev
- run: flutter pub get
- run: mkdir -p ${{ github.workspace }}/build/linux/x64/release/bundle
- run: flutter build linux
- name: List Linux Build Directory
run: ls -alh ${{ github.workspace }}/build/linux/x64/release/bundle
- name: zip everything
run: |
cd ${{ github.workspace }}/build/linux/x64/release/bundle
zip -r rdnbenet.zip *
- name: Upload binary
uses: actions/upload-artifact@v4
with:
name: linux-zip
path: ${{ github.workspace }}/build/linux/x64/release/bundle/rdnbenet.zip
upload-release:
permissions: write-all
needs: [build_android, build_linux, build_windows]
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Read version from pubspec.yaml
id: version
run: |
VERSION=$(grep 'version:' pubspec.yaml | sed 's/version: //')
echo "VERSION=$VERSION" >> $GITHUB_OUTPUT
- name: Download APK
uses: actions/download-artifact@v4
with:
name: apk
path: ./out/android
- name: Download Windows ZIP
uses: actions/download-artifact@v4
with:
name: windows-zip
path: ./out/windows
- name: Download Linux ZIP
uses: actions/download-artifact@v4
with:
name: linux-zip
path: ./out/linux
- name: List output directory
run: ls -R ./out
- name: Upload Release
uses: softprops/action-gh-release@v1
with:
files: |
./out/android/*
./out/windows/*
./out/linux/*
tag_name: ${{ steps.version.outputs.VERSION }}
draft: false
prerelease: false