-
Notifications
You must be signed in to change notification settings - Fork 1
158 lines (133 loc) · 5.7 KB
/
release.yml
File metadata and controls
158 lines (133 loc) · 5.7 KB
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
name: Release
on:
push:
tags:
- "v*"
jobs:
appimage-build:
runs-on: ubuntu-24.04
defaults:
run:
shell: bash
steps:
- name: Clone repo
uses: actions/checkout@v4
- name: Install dependencies
run: |
sudo apt -y update
sudo apt -y install build-essential kmod curl wget libssl-dev libadwaita-1-dev fuse file libfuse2
- name: Install Rust
run: |
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y --no-modify-path --profile=minimal
- name: Build project
run: |
PATH="${HOME}/.cargo/bin:${PATH}" cargo build --release
- name: Install appimagetool, linuxdeploy and gtk plugin
run: |
wget -c "https://github.com/AppImage/AppImageKit/releases/download/continuous/appimagetool-x86_64.AppImage"
wget -c "https://github.com/linuxdeploy/linuxdeploy/releases/download/continuous/linuxdeploy-x86_64.AppImage"
wget -c "https://raw.githubusercontent.com/linuxdeploy/linuxdeploy-plugin-gtk/ca4ae0999883fc359c87acb327ce2afaf9da8c91/linuxdeploy-plugin-gtk.sh"
chmod +x appimagetool-x86_64.AppImage linuxdeploy-x86_64.AppImage linuxdeploy-plugin-gtk.sh
- name: Create AppDir
run: |
./linuxdeploy-x86_64.AppImage --appdir AppDir --plugin gtk --executable target/release/eternal_mod_manager --icon-file resources/io.github.brunoanc.eternalmodmanager.png --desktop-file resources/io.github.brunoanc.eternalmodmanager.desktop
- name: Add metainfo
run: |
mkdir -p AppDir/usr/share/metainfo
cp resources/io.github.brunoanc.eternalmodmanager.appdata.xml AppDir/usr/share/metainfo
- name: Patch apprun hook
run: |
cd AppDir
sed -i '/GTK_THEME/d' apprun-hooks/linuxdeploy-plugin-gtk.sh
sed -i '/GDK_BACKEND/d' apprun-hooks/linuxdeploy-plugin-gtk.sh
sed -i "s|AppRun.wrapped|$(readlink AppRun.wrapped)|g" AppRun
cd ..
- name: Create AppImage
run: |
./appimagetool-x86_64.AppImage AppDir
mv EternalModManager-*.AppImage EternalModManager-${GITHUB_REF_NAME:1}-x86_64.AppImage
- name: Upload AppImage
uses: svenstaro/upload-release-action@v2
with:
repo_token: ${{ secrets.SECRET_TOKEN }}
file_glob: true
file: 'EternalModManager-*-x86_64.AppImage'
tag: ${{ github.ref }}
snap-build:
runs-on: ubuntu-24.04
steps:
- name: Clone repo
uses: actions/checkout@v4
- name: Build snap
uses: snapcore/action-build@v1
id: snapcraft
- name: Upload snap
uses: snapcore/action-publish@v1
env:
SNAPCRAFT_STORE_CREDENTIALS: ${{ secrets.STORE_LOGIN }}
with:
snap: ${{ steps.snapcraft.outputs.snap }}
release: stable
repo_token: ${{ secrets.SECRET_TOKEN }}
file_glob: true
file: 'EternalModManager-*-win64.zip'
tag: ${{ github.ref }}
windows-build:
runs-on: windows-latest
defaults:
run:
shell: msys2 {0}
steps:
- uses: actions/checkout@v4
- uses: msys2/setup-msys2@v2
with:
msystem: UCRT64
update: true
install: base-devel git zip mingw-w64-ucrt-x86_64-toolchain mingw-w64-ucrt-x86_64-gtk4 mingw-w64-ucrt-x86_64-libadwaita mingw-w64-ucrt-x86_64-cmake
- name: Install Rust toolchain
run: |
export PATH=$PATH:`cygpath $USERPROFILE/.cargo/bin`
rustup default stable-x86_64-pc-windows-gnu
- name: Compile pe-util
run: |
git clone https://github.com/gsauthof/pe-util.git
cd pe-util
git submodule update --init
mkdir build
cd build
cmake .. -DCMAKE_BUILD_TYPE=Release
ninja -v
- name: Compile and install peldd_dependency_scanner
run: |
export PATH=$PATH:`cygpath $USERPROFILE/.cargo/bin`
cargo install --git https://github.com/brunoanc/peldd_dependency_scanner.git
- name: Compile executable
run: |
export PATH=$PATH:`cygpath $USERPROFILE/.cargo/bin`
cargo build --target=x86_64-pc-windows-gnu --release --locked
# Source: https://github.com/MGlolenstine/gtk4-cross/blob/main/gtk4-cross-base-hub/package.sh
- name: Package executable
run: |
export PATH=$PATH:`cygpath $USERPROFILE/.cargo/bin`:`realpath ./pe-util/build`
mkdir -p package
cd package
cp ../target/x86_64-pc-windows-gnu/release/eternal_mod_manager.exe EternalModManager.exe
cp $MINGW_PREFIX/bin/gdbus.exe .
cp $MINGW_PREFIX/bin/gspawn-win64-helper-console.exe $MINGW_PREFIX/bin/gspawn-win64-helper.exe .
glib-compile-schemas $MINGW_PREFIX/share/glib-2.0/schemas/
mkdir -p share/glib-2.0/schemas/
cp -T $MINGW_PREFIX/share/glib-2.0/schemas/gschemas.compiled share/glib-2.0/schemas/gschemas.compiled
mkdir -p share/icons/hicolor
cp -T $MINGW_PREFIX/share/icons/hicolor/index.theme share/icons/hicolor/index.theme
mkdir -p lib/gdk-pixbuf-2.0
cp -rT $MINGW_PREFIX/lib/gdk-pixbuf-2.0 lib/gdk-pixbuf-2.0
cp -t . $(peldd_dependency_scanner -d $MINGW_PREFIX/bin -vv -f *.exe $MINGW_PREFIX/lib/gdk-pixbuf-2.0/2.10.0/loaders/*)
find . -iname "*.dll" -or -iname "*.exe" -type f -exec strip {} +
zip -r ../EternalModManager-${GITHUB_REF_NAME:1}-win64.zip *
- name: Upload zip
uses: svenstaro/upload-release-action@v2
with:
repo_token: ${{ secrets.SECRET_TOKEN }}
file_glob: true
file: 'EternalModManager-*-win64.zip'
tag: ${{ github.ref }}