-
Notifications
You must be signed in to change notification settings - Fork 2
133 lines (125 loc) · 4.81 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
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
name: Build
on:
workflow_run:
workflows: ["Run Tests"]
branches: [master]
types:
- completed
env:
CARGO_TERM_COLOR: always
jobs:
build_linux:
strategy:
matrix:
app: [icy_term, icy_draw, icy_view]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install required libraries
run: |
sudo apt-get install build-essential libgtk-3-dev libasound2-dev libxcb-shape0-dev libxcb-xfixes0-dev
- name: Build deb
id: build-deb
run: |
cargo install cargo-deb
export version=$(python3 tools/prep_diz.py "${{ matrix.app }}" "file_id.diz")
echo "VERSION=$version" >> $GITHUB_ENV
echo "Version: $version"
cd crates/${{ matrix.app }}
export DEB=$(cargo deb)
echo "Copy $DEB to ${{ matrix.app }}.deb"
mv $DEB "../../${{ matrix.app }}.deb"
cd ../..
- name: 'Upload deb'
uses: actions/upload-artifact@v4
with:
name: ${{ matrix.app }}_linux_${{ env.VERSION }}
path: |
${{ matrix.app }}.deb
file_id.diz
build_windows:
strategy:
matrix:
app: [icy_term, icy_draw, icy_view, icy_play]
runs-on: windows-latest
steps:
- uses: actions/checkout@v4
- name: Prepare FILE_ID.DIZ
run: |
$VERSION=$(python tools\prep_diz.py "${{ matrix.app }}" "file_id.diz")
echo "Version: $VERSION"
Add-Content -Path $env:GITHUB_ENV -Value "VERSION=$VERSION"
get-content .\crates\${{ matrix.app }}\build\file_id.diz | %{$_ -replace "#VERSION","$VERSION"} >file_id.diz
- name: Build exe
run: |
cd .\crates\${{ matrix.app }}
cargo build --release
cd ..\..
move .\target\release\${{ matrix.app }}.exe .
- name: 'Upload executable'
uses: actions/upload-artifact@v4
with:
name: ${{ matrix.app }}_windows_${{ env.VERSION }}
path: |
${{ matrix.app }}.exe
file_id.diz
build_mac:
strategy:
matrix:
app: [icy_term, icy_draw, icy_view]
runs-on: macos-13
steps:
- uses: actions/checkout@v4
- name: Install cargo bundle & get
run: |
rustup target add aarch64-apple-darwin
rustup target add x86_64-apple-darwin
cargo install cargo-bundle
brew install create-dmg
- name: Build app
run: |
cd crates/${{ matrix.app }}
cargo build --release --target aarch64-apple-darwin
cargo build --release --target x86_64-apple-darwin
cd ../..
export app=$(python3 tools/get_name.py "${{ matrix.app }}")
echo "Build bundle for: $app"
echo "APP=$app" >> $GITHUB_ENV
mkdir -p "${{ matrix.app }}.app/Contents/MacOS"
mkdir -p "${{ matrix.app }}.app/Contents/Resources"
cp crates/${{ matrix.app }}/build/mac/Info.plist "${{ matrix.app }}.app/Contents/Info.plist"
mkdir -p AppIcon.iconset
sips -z 16 16 crates/${{ matrix.app }}/build/mac/128x128@2x.png --out AppIcon.iconset/icon_16x16.png
sips -z 32 32 crates/${{ matrix.app }}/build/mac/128x128@2x.png --out AppIcon.iconset/icon_16x16@2x.png
sips -z 32 32 crates/${{ matrix.app }}/build/mac/128x128@2x.png --out AppIcon.iconset/icon_32x32.png
sips -z 64 64 crates/${{ matrix.app }}/build/mac/128x128@2x.png --out AppIcon.iconset/icon_32x32@2.png
sips -z 128 128 crates/${{ matrix.app }}/build/mac/128x128@2x.png --out AppIcon.iconset/icon_128x128.png
cp crates/${{ matrix.app }}/build/mac/128x128@2x.png AppIcon.iconset/icon_128x128@2x.png
iconutil -c icns AppIcon.iconset
cp AppIcon.icns "${{ matrix.app }}.app/Contents/Resources"
export version=$(python3 tools/prep_diz.py "${{ matrix.app }}" "file_id.diz")
echo "VERSION=$version" >> $GITHUB_ENV
echo "Version: $version"
lipo "target/x86_64-apple-darwin/release/${{ matrix.app }}" \
"target/aarch64-apple-darwin/release/${{ matrix.app }}" \
-create -output "${{ matrix.app }}.app/Contents/MacOS/${{ matrix.app }}"
- name: Sign dmg
id: sign-bundle
run: |
create-dmg \
--volname "${{ env.APP }} Installer" \
--volicon "AppIcon.icns" \
--window-pos 200 120 \
--window-size 800 400 \
--icon-size 128 \
--hide-extension "${{ matrix.app }}.app" \
--app-drop-link 600 185 \
"${{ matrix.app }}-${{ env.VERSION }}-universal.dmg" \
"${{ matrix.app }}.app"
- name: 'Upload dmg'
uses: actions/upload-artifact@v4
with:
name: ${{ matrix.app }}_osx_${{ env.VERSION }}${{ matrix.target }}
path: |
${{ matrix.app }}-${{ env.VERSION }}-universal.dmg
file_id.diz