-
-
Notifications
You must be signed in to change notification settings - Fork 2
103 lines (86 loc) · 4.28 KB
/
upload-dekstop.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
# SPDX-FileCopyrightText: 2023 Simon Dalvai <[email protected]>
# SPDX-License-Identifier: CC0-1.0
name: CI/CD desktop
on:
push:
paths:
- "version"
- ".github/workflows/upload-dekstop.yml"
- "game/export_presets.desktop.example"
env:
GODOT_VERSION: 4.2.1
PROJECT_NAME: FutsalManager
WORKING_DIR: game
jobs:
deploy:
runs-on: ubuntu-latest
if: github.ref == 'refs/heads/prod'
steps:
- uses: actions/checkout@v2
- name: Cache Godot files
id: cache-godot
uses: actions/cache@v3
with:
path: |
~/.local/share/godot/**
/usr/local/bin/godot
~/.config/godot/**
key: ${{ runner.os }}-godot-${{ env.GODOT_VERSION }}
- name: Read version number and version code
run: |
echo "VERSION_NAME=$(cat version | cut -f1 -d-)" >> $GITHUB_ENV
echo "VERSION_CODE=$(cat version | cut -f2 -d-)" >> $GITHUB_ENV
- name: Download and config Godot Engine linux server and templates
if: steps.cache-godot.outputs.cache-hit != 'true'
run: |
wget -q https://github.com/godotengine/godot/releases/download/${{ env.GODOT_VERSION }}-stable/Godot_v${{ env.GODOT_VERSION }}-stable_linux.x86_64.zip
wget -q https://github.com/godotengine/godot/releases/download/${{ env.GODOT_VERSION }}-stable/Godot_v${{ env.GODOT_VERSION }}-stable_export_templates.tpz
mkdir ~/.cache
mkdir -p ~/.config/godot
mkdir -p ~/.local/share/godot/export_templates/${{ env.GODOT_VERSION }}.stable
unzip Godot_v${{ env.GODOT_VERSION }}-stable_linux.x86_64.zip
mv Godot_v${{ env.GODOT_VERSION }}-stable_linux.x86_64 /usr/local/bin/godot
unzip Godot_v${{ env.GODOT_VERSION }}-stable_export_templates.tpz
mv templates/* ~/.local/share/godot/export_templates/${{ env.GODOT_VERSION }}.stable
rm -f Godot_v${{ env.GODOT_VERSION }}-stable_linux.x86_64.zip Godot_v${{ env.GODOT_VERSION }}-stable_export_templates.tpz
# TODO replace wit --import once available
# https://github.com/godotengine/godot/pull/90431
- name: Open project once to import assets in editor mode
continue-on-error: true # timeout will exit with code 124 OR use || true to always exit with 0
run: timeout 25 godot --headless --path ${{ env.WORKING_DIR }} -e
####################
# WINDOWS
####################
# TODO install and configure rcedit tool https://github.com/electron/rcedit
# to create icon in Windows
- name: Prepare export_presets.cfg for Windows
run: cp ${{ env.WORKING_DIR }}/export_presets.windows.example ${{ env.WORKING_DIR }}/export_presets.cfg
- name: Export Godot 4 Windows
run: godot --headless --path ${{ env.WORKING_DIR }}/ --export-release 'Windows Desktop' ../${{ env.PROJECT_NAME }}.exe
- name: Create zip file
run: zip ${{ env.PROJECT_NAME }}-Windows.zip ${{ env.PROJECT_NAME }}.exe ${{ env.PROJECT_NAME }}.pck
- name: Upload binaries to Github release
uses: svenstaro/upload-release-action@v2
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: ./${{ env.PROJECT_NAME }}-Windows.zip
asset_name: ${{ env.PROJECT_NAME }}-Windows.zip
tag: ${{ env.VERSION_NAME }}-${{ env.VERSION_CODE }}
overwrite: true
body: "FutsalManager - version: ${{ env.VERSION_NAME }} code: ${{ env.VERSION_CODE }}"
####################
# Linux
####################
- name: Prepare export_presets.cfg for Linux
run: cp ${{ env.WORKING_DIR }}/export_presets.linux.example ${{ env.WORKING_DIR }}/export_presets.cfg
- name: Export Godot 4 Linux
run: godot --headless --path ${{ env.WORKING_DIR }}/ --export-release 'Linux/X11' ../${{ env.PROJECT_NAME }}-Linux.x86_64
- name: Upload binaries to Github release
uses: svenstaro/upload-release-action@v2
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: ./${{ env.PROJECT_NAME }}-Linux.x86_64
asset_name: ${{ env.PROJECT_NAME }}-Linux.x86_64
tag: ${{ env.VERSION_NAME }}-${{ env.VERSION_CODE }}
overwrite: true
body: "FutsalManager - version: ${{ env.VERSION_NAME }} code: ${{ env.VERSION_CODE }}"