-
Notifications
You must be signed in to change notification settings - Fork 4
161 lines (150 loc) · 6.36 KB
/
release.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
---
name: "release"
on:
push:
tags:
- "1.*"
workflow_dispatch:
inputs:
logLevel:
description: 'Log level'
required: true
default: 'warning'
jobs:
flutter-build-android:
name: "Release for android"
runs-on: "windows-latest"
permissions: write-all
steps:
- name: Clone repository
uses: actions/checkout@v4
- run: |
$tag = "${{ github.ref }}".Replace('refs/tags/', '')
echo "tag=$(echo $tag)" >> $env:GITHUB_ENV
- run: echo "bilineo_android_${env:tag}.apk build progress"
- run: choco install yq
- name: Set up Flutter
uses: subosito/flutter-action@v2
with:
channel: stable
flutter-version-file: pubspec.yaml
cache-key: "flutter-:os:-:channel:-:version:-:arch:-:hash:" # optional, change this to force refresh cache
cache-path: "${{ runner.tool_cache }}/flutter/:channel:-:version:-:arch:" # optional, change this to specify the cache path
pub-cache-key: "flutter-pub:os:-:channel:-:version:-:arch:-:hash:" # optional, change this to force refresh cache of dart pub get dependencies
pub-cache-path: "${{ runner.tool_cache }}/flutter/:channel:-:version:-:arch:" # optional, change this to specify the cache path
- name: Set up Java
uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: '18'
- run: flutter pub get
- run: flutter build apk --split-per-abi
- run: |
Ren build/app/outputs/flutter-apk/app-arm64-v8a-release.apk bilineo_android_${env:tag}.apk
- name: Upload android outputs
uses: actions/upload-artifact@v4
with:
name: android_outputs
path: |
build/app/outputs/flutter-apk/bilineo_android_*.apk
flutter-build-windows:
name: "Release for windows"
runs-on: "windows-latest"
permissions: write-all
steps:
- name: Clone repository
uses: actions/checkout@v4
- run: |
$tag = "${{ github.ref }}".Replace('refs/tags/', '')
echo "tag=$(echo $tag)" >> $env:GITHUB_ENV
- run: echo "bilineo_windows_${env:tag}.zip build progress"
- run: choco install yq
- name: Set up Flutter
uses: subosito/flutter-action@v2
with:
channel: stable
flutter-version-file: pubspec.yaml
cache-key: "flutter-:os:-:channel:-:version:-:arch:-:hash:" # optional, change this to force refresh cache
cache-path: "${{ runner.tool_cache }}/flutter/:channel:-:version:-:arch:" # optional, change this to specify the cache path
pub-cache-key: "flutter-pub:os:-:channel:-:version:-:arch:-:hash:" # optional, change this to force refresh cache of dart pub get dependencies
pub-cache-path: "${{ runner.tool_cache }}/flutter/:channel:-:version:-:arch:" # optional, change this to specify the cache path
- name: Set up Java
uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: '18'
- run: flutter pub get
- run: flutter build windows
- run: |
Compress-Archive build/windows/x64/runner/Release bilineo_windows_${env:tag}.zip
- name: Upload windows outputs
uses: actions/upload-artifact@v4
with:
name: windows_outputs
path: |
bilineo_windows_*.zip
flutter-build-linux:
name: "Release for Linux"
runs-on: "ubuntu-latest"
needs: [flutter-build-windows, flutter-build-android]
permissions: write-all
steps:
- name: Clone repository
uses: actions/checkout@v4
- name: Extract tag name
run: echo "tag=${GITHUB_REF#refs/tags/}" >> $GITHUB_ENV
shell: bash
- name: Echo build progress
run: echo "bilineo_linux_${{ env.tag }}.tar.gz build progress"
shell: bash
- name: Install dependencies
run: |
sudo apt-get update
sudo apt-get install -y clang cmake libgtk-3-dev ninja-build libayatana-appindicator3-dev mpv libmpv-dev libasound2-dev
shell: bash
- name: Set up Flutter
uses: subosito/flutter-action@v2
with:
channel: stable
flutter-version-file: pubspec.yaml
- name: Get Flutter dependencies
run: flutter pub get
shell: bash
- name: Build Flutter for Linux
run: flutter build linux
shell: bash
- name: Package linux build output
run: tar -zcvf bilineo_linux_${{ env.tag }}.tar.gz build/linux/x64/release/bundle/*
shell: bash
- name: Upload linux outputs
uses: actions/upload-artifact@v4
with:
name: outputs-linux
path: bilineo_linux_*.tar.gz
- name: Download windows build file
uses: actions/download-artifact@v4
with:
name: windows_outputs
path: windows_outputs
- name: List files in windows_outputs directory
run: ls -l windows_outputs
- name: Copy windows build file to root
run: cp windows_outputs/* bilineo_windows_${{ env.tag }}.zip
- name: Download android build file
uses: actions/download-artifact@v4
with:
name: android_outputs
path: android_outputs
- name: List files in android_outputs directory
run: ls -l android_outputs
- name: Copy android build file to root
run: cp android_outputs/* bilineo_android_${{ env.tag }}.apk
- name: Create release
uses: "marvinpinto/action-automatic-releases@latest"
with:
repo_token: "${{ secrets.GITHUB_TOKEN }}"
prerelease: false
files: |
bilineo_android_*.apk
bilineo_windows_*.zip
bilineo_linux_*.tar.gz