-
Notifications
You must be signed in to change notification settings - Fork 1
115 lines (112 loc) · 4.27 KB
/
build.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
name: Build executables (All platform)
on:
workflow_call:
inputs:
os:
required: true
type: string
postfix:
required: true
type: string
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
build_windows:
if: ${{ inputs.os == 'windows' }}
runs-on: windows-latest
# needs:
# - test_heavy_windows
env:
MACHINE_OS: windows
steps:
- uses: actions/checkout@v3
- uses: subosito/flutter-action@v2.8.0
with:
channel: 'stable'
- name: Doctor
run: flutter doctor -v
- name: Install Dependencies
run: |
flutter config --enable-windows-desktop
flutter packages get
- name: Build release
run: |
flutter build -v ${{ env.MACHINE_OS }} --release
- name: Copy essentials to Windows artifacs (Release)
run: |
cp -Path ${{ github.workspace }}/build_dependencies/windows/* ${{ github.workspace }}/build/windows/runner/Release/
mkdir ${{ github.workspace }}/build/windows/runner/minecraft_cube_desktop/minecraft_cube_desktop
mv -Path ${{ github.workspace }}/build/windows/runner/Release/* ${{ github.workspace }}/build/windows/runner/minecraft_cube_desktop/minecraft_cube_desktop
- name: Upload Windows artifaces (Release)
uses: actions/upload-artifact@v3
with:
name: windows-release-${{ github.sha }}
path: ${{ github.workspace }}/build/windows/runner/minecraft_cube_desktop
build_ubuntu:
if: ${{ inputs.os == 'linux' }}
runs-on: ubuntu-latest
# needs:
# - test_heavy_ubuntu
env:
MACHINE_OS: linux
steps:
- uses: actions/checkout@v3
- uses: subosito/flutter-action@v2.8.0
with:
channel: 'stable'
- name: Install Linux dependencies
# if: startsWith(matrix.os, 'ubuntu')
run: |
sudo apt-get update
sudo apt-get install -y libgtk-3-dev libx11-dev pkg-config cmake ninja-build libblkid-dev liblzma-dev
- name: Doctor
run: flutter doctor -v
- name: Install Dependencies
run: |
flutter config --enable-linux-desktop
flutter packages get
- name: Build release
run: |
flutter build -v ${{ env.MACHINE_OS }} --release
- name: Copy essentials to Linux artifacs and package (Release)
run: |
cp -r ${{ github.workspace }}/build_dependencies/linux ${{ github.workspace }}/build/linux/x64/release/minecraft_cube_desktop
mv ${{ github.workspace }}/build/linux/x64/release/bundle/* ${{ github.workspace }}/build/linux/x64/release/minecraft_cube_desktop/usr/local/lib/minecraft_cube_desktop/
dpkg-deb --build --root-owner-group ${{ github.workspace }}/build/linux/x64/release/minecraft_cube_desktop
- name: Upload Linux artifaces (Release)
uses: actions/upload-artifact@v3
with:
name: linux-release-${{ github.sha }}
path: ${{ github.workspace }}/build/linux/x64/release/minecraft_cube_desktop.deb
build_macos:
if: ${{ inputs.os == 'macos' }}
runs-on: macos-latest
# needs:
# - test_heavy_macos
env:
MACHINE_OS: macos
steps:
- uses: actions/checkout@v3
- uses: subosito/flutter-action@v2.8.0
with:
channel: 'stable'
- name: Doctor
run: flutter doctor -v
- name: Install Dependencies
run: |
flutter config --enable-macos-desktop
flutter packages get
- name: Build release
run: |
flutter build -v ${{ env.MACHINE_OS }} --release
- name: Copy essentials to Macos and package (Release)
run: |
mkdir ${{ github.workspace }}/build/macos/Build/Products/minecraft_cube_desktop
mv ${{ github.workspace }}/build/macos/Build/Products/Release/minecraft_cube_desktop.app ${{ github.workspace }}/build/macos/Build/Products/minecraft_cube_desktop/minecraft_cube_desktop.app
- name: Upload MacOS artifaces (Release)
# if: startsWith(matrix.os, 'macOS')
uses: actions/upload-artifact@v3
with:
name: macos-release-${{ github.sha }}
path: ${{ github.workspace }}/build/macos/Build/Products/minecraft_cube_desktop