-
Notifications
You must be signed in to change notification settings - Fork 1
162 lines (127 loc) · 4.3 KB
/
build.yaml
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
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
name: Build and Upload
on:
pull_request:
push:
branches:
- 'main'
- 'build/*'
tags:
- 'v*'
paths-ignore:
- '**.md'
env:
FLUTTER_VERSION: 3.10.5
jobs:
build-android:
name: Build Android
runs-on: ubuntu-latest
steps:
- name: Dump GitHub context
env:
GITHUB_CONTEXT: ${{ toJson(github) }}
run: echo "$GITHUB_CONTEXT"
- name: Checkout repository
uses: actions/checkout@v2
- name: Set up Flutter
uses: subosito/flutter-action@v2
with:
flutter-version: '${{ env.FLUTTER_VERSION }}'
- name: Install dependencies
run: flutter pub get
- name: Build APK
run: flutter build apk
- name: Upload artifact
uses: actions/upload-artifact@v2
with:
name: URSADriverStation_android
path: build/app/outputs/flutter-apk/*.apk
- name: Rename artifact
if: startsWith(github.ref, 'refs/tags/v')
run: |
ls -R build/app/outputs/flutter-apk
mkdir gh-release
cp build/app/outputs/flutter-apk/app-release.apk gh-release/URSADriverStation-${GITHUB_REF#refs/tags/v}_android.apk
- name: Upload release artifact
uses: softprops/action-gh-release@v1
if: startsWith(github.ref, 'refs/tags/v')
with:
files: |
gh-release/*.apk
build-linux:
name: Build Linux
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v2
- name: Set up Flutter
uses: subosito/flutter-action@v2
with:
flutter-version: '${{ env.FLUTTER_VERSION }}'
- name: Install dependencies
run: |
sudo apt-get install -y ninja-build libglib2.0-dev libgtk-3-dev libfuse2
flutter pub get
- name: Build Linux package
run: flutter build linux
- name: Create AppImage
run: |
cp -r build/linux/x64/release/bundle build/linux/AppDir
cd build/
# Install appimage-builder
wget -O appimage-builder-x86_64.AppImage https://github.com/AppImageCrafters/appimage-builder/releases/download/v1.1.0/appimage-builder-1.1.0-x86_64.AppImage
chmod +x appimage-builder-x86_64.AppImage
cd linux/
../appimage-builder-x86_64.AppImage --recipe ../../AppImageBuilder.yml --skip-test
ls -l
- name: Upload artifact
uses: actions/upload-artifact@v2
with:
name: URSADriverStation_linux_x64
path: build/linux/*.AppImage
- name: Rename artifact
if: startsWith(github.ref, 'refs/tags/v')
run: |
ls -R build/linux
mkdir gh-release
cp "build/linux/URSA Driver Station-latest-x86_64.AppImage" gh-release/URSADriverStation-${GITHUB_REF#refs/tags/v}_linux_x64.AppImage
- name: Upload release artifact
uses: softprops/action-gh-release@v1
if: startsWith(github.ref, 'refs/tags/v')
with:
files: |
gh-release/*.AppImage
build-windows:
name: Build Windows
runs-on: windows-latest
steps:
- name: Checkout repository
uses: actions/checkout@v2
- name: Set up Flutter
uses: subosito/flutter-action@v2
with:
flutter-version: '${{ env.FLUTTER_VERSION }}'
- name: Install dependencies
run: flutter pub get
- name: Build Windows package
run: flutter build windows
- name: Upload artifact
uses: actions/upload-artifact@v2
with:
name: URSADriverStation_windows_x64
path: build/windows/runner/Release
- name: Rename artifact
if: startsWith(github.ref, 'refs/tags/v')
run: |
ls -R build/windows/runner/Release
mkdir gh-release
# Get the tag name by removing "refs/tags/v"
$tagName = $env:GITHUB_REF -replace "refs/tags/v", ""
# Create the archive
Compress-Archive -Path build/windows/runner/Release -DestinationPath ("gh-release/URSADriverStation-" + $tagName + "_windows_x64.zip")
ls -R gh-release
- name: Upload release artifact
uses: softprops/action-gh-release@v1
if: startsWith(github.ref, 'refs/tags/v')
with:
files: |
gh-release/*.zip