-
Notifications
You must be signed in to change notification settings - Fork 13
90 lines (85 loc) · 3.51 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
name: build
on:
pull_request:
push:
branches:
- main
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
build-macos:
runs-on: macos-latest
steps:
- uses: actions/checkout@v3
- uses: subosito/flutter-action@v2
with:
channel: 'stable' # or: 'beta', 'dev' or 'master'
cache: true
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
- run: flutter config --enable-macos-desktop
- run: flutter build -v macos --release
- run: ditto -c -k --sequesterRsrc --keepParent retro.app $GITHUB_WORKSPACE/retro.zip
working-directory: build/macos/Build/Products/Release
- uses: actions/upload-artifact@v3
with:
name: macos
path: retro.zip
build-windows:
runs-on: windows-latest
steps:
- uses: actions/checkout@v3
- uses: subosito/flutter-action@v2
with:
channel: 'stable' # or: 'beta', 'dev' or 'master'
cache: true
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
- run: flutter config --enable-windows-desktop
- run: flutter build windows --release
- uses: actions/upload-artifact@v3
with:
name: windows
path: build/windows/x64/runner/Release/*
build-linux:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Install dependencies
run: sudo apt-get update && sudo apt-get install -y ninja-build libgtk-3-dev fuse libfuse2
- uses: subosito/flutter-action@v2
with:
channel: 'stable' # or: 'beta', 'dev' or 'master'
cache: true
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
- run: flutter config --enable-linux-desktop
- run: flutter build linux --release
- name: Create AppImage
run: |
wget "https://github.com/AppImage/AppImageKit/releases/download/continuous/appimagetool-x86_64.AppImage"
chmod a+x appimagetool-x86_64.AppImage
# Create AppDir
cp -r build/linux/x64/release/bundle/ retro.AppDir
cp assets/icon-macos.png retro.AppDir/retro.png
# Create AppRun
echo '#!/bin/sh' > retro.AppDir/AppRun
echo 'cd "$(dirname "$0")"' >> retro.AppDir/AppRun
echo 'exec ./retro' >> retro.AppDir/AppRun
chmod a+x retro.AppDir/AppRun
# Create Desktop file
echo '[Desktop Entry]' > retro.AppDir/retro.desktop
echo 'Version=1.0' >> retro.AppDir/retro.desktop
echo 'Name=retro' >> retro.AppDir/retro.desktop
echo 'Exec=retro %u' >> retro.AppDir/retro.desktop
echo 'Icon=retro' >> retro.AppDir/retro.desktop
echo 'Terminal=false' >> retro.AppDir/retro.desktop
echo 'Type=Application' >> retro.AppDir/retro.desktop
echo 'Categories=Utility;' >> retro.AppDir/retro.desktop
# Create AppImage
./appimagetool-x86_64.AppImage retro.AppDir retro.AppImage
- uses: actions/upload-artifact@v3
with:
name: linux
path: retro.AppImage