-
Notifications
You must be signed in to change notification settings - Fork 8
151 lines (132 loc) · 4.21 KB
/
main.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
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
name: Release
on: workflow_dispatch
jobs:
create_release:
name: Create Draft Release
runs-on: ubuntu-latest
outputs:
upload_url: ${{ steps.create_release_id.outputs.upload_url }}
steps:
- name: Create Draft Release
id: create_release_id
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: auto-generated draft
release_name: Auto-Generated Draft
body: |
New Features:
- Foo
Fixes:
- Bar
Known Issues:
- Foobar
Authors:
@Bonfra04
draft: true
prerelease: false
build_windows:
name: Build Windows
needs: create_release
runs-on: windows-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Download Flutter
uses: subosito/flutter-action@v2
with:
flutter-version: '3.16.0'
channel: 'stable'
cache: false # Disabled cuz windows is bad
cache-key: 'flutter-windows'
cache-path: '${{ runner.tool_cache }}/flutter/windows'
architecture: x64
- name: Build Windows App
run: |
flutter config --enable-windows-desktop
flutter build windows --release
- name: Zip File
run: Compress-Archive -Path build\windows\x64\runner\Release* -Destination build.zip
- name: Upload Release Asset
id: upload-release-asset
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ needs.create_release.outputs.upload_url }}
asset_path: ./build.zip
asset_name: Stronzflix Windows - amd64.zip
asset_content_type: application/zip
build_linux:
name: Build Linux
needs: create_release
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Download dependencies
run: |
sudo apt-get update -y
sudo apt-get install -y ninja-build libgtk-3-dev
- name: Download Flutter
uses: subosito/flutter-action@v2
with:
flutter-version: '3.16.0'
channel: 'stable'
cache: true
cache-key: 'flutter-linux'
cache-path: '${{ runner.tool_cache }}/flutter/linux'
architecture: x64
- name: Build Linux App
run: |
flutter config --enable-linux-desktop
flutter build linux --release
- name: Zip File
run: |
cd build/linux/x64/release; zip -r ../../../../build.zip bundle; cd -
- name: Upload Release Asset
id: upload-release-asset
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ needs.create_release.outputs.upload_url }}
asset_path: ./build.zip
asset_name: Stronzflix Linux - amd64.zip
asset_content_type: application/zip
build_android:
name: Build Android
needs: create_release
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Download dependencies
uses: actions/setup-java@v2
with:
distribution: 'zulu'
java-version: '17'
- name: Download Flutter
uses: subosito/flutter-action@v2
with:
flutter-version: '3.16.0'
channel: 'stable'
cache: true
cache-key: 'flutter-android'
cache-path: '${{ runner.tool_cache }}/flutter/android'
architecture: x64
- name: Build Android App
run: |
flutter config --enable-android
flutter build apk --release
- name: Upload Release Asset
id: upload-release-asset
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ needs.create_release.outputs.upload_url }}
asset_path: build/app/outputs/flutter-apk/app-release.apk
asset_name: Stronzflix.apk
asset_content_type: application/vnd.android.package-archive