-
Notifications
You must be signed in to change notification settings - Fork 9
83 lines (65 loc) · 2.94 KB
/
upload-linux.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
# SPDX-FileCopyrightText: 2023 Simon Dalvai <[email protected]>
# SPDX-License-Identifier: CC0-1.0
name: Linux upload
on:
push:
paths:
- "version"
- ".github/workflows/upload-linux.yml"
- "export_presets.linux.example"
env:
WORKING_DIRECTORY: game
GODOT_VERSION: 3.6
jobs:
deploy:
if: github.ref == 'refs/heads/prod'
runs-on: ubuntu-latest
steps:
- name: Checkout source code
uses: actions/checkout@v3
- 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: Delete iOS icons
run: rm -rf $WORKING_DIRECTORY/AppIcons
- name: Create export directory
run: mkdir linux
- name: Create export_presets.cfg
run: cp game/export_presets.linux.example game/export_presets.cfg
- 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: Download and config Godot Engine headless linux server and templates
if: steps.cache-godot.outputs.cache-hit != 'true'
run: |
wget -q https://github.com/godotengine/godot-builds/releases/download/${{ env.GODOT_VERSION }}/Godot_v${{ env.GODOT_VERSION }}-stable_linux_headless.64.zip
wget -q https://github.com/godotengine/godot-builds/releases/download/${{ env.GODOT_VERSION }}/Godot_v${{ env.GODOT_VERSION }}-stable_export_templates.tpz
mkdir ~/.cache
mkdir -p ~/.config/godot
mkdir -p ~/.local/share/godot/templates/${{ env.GODOT_VERSION }}.stable
unzip Godot_v${{ env.GODOT_VERSION }}-stable_linux_headless.64.zip
mv Godot_v${{ env.GODOT_VERSION }}-stable_linux_headless.64 /usr/local/bin/godot
unzip Godot_v${{ env.GODOT_VERSION }}-stable_export_templates.tpz
mv templates/* ~/.local/share/godot/templates/${{ env.GODOT_VERSION }}.stable
rm -f Godot_v${{ env.GODOT_VERSION }}-stable_linux_headless.64.zip Godot_v${{ env.GODOT_VERSION }}-stable_export_templates.tpz
- name: Export
run: godot --path ${{ env.WORKING_DIRECTORY }} --export Linux/X11 ${{ inputs.output-file-path }}
- name: create archive
run: tar -cJf pocket-broomball.tar.xz PocketBroomball.x86_64 PocketBroomball.pck
working-directory: ${{ env.WORKING_DIRECTORY }}
- name: Upload binaries to Github release
uses: svenstaro/upload-release-action@v2
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: ./game/pocket-broomball.tar.xz
asset_name: pocket-broomball.tar.xz
tag: v${{ env.VERSION_NAME }}
overwrite: true
body: ${{ steps.changelog.outputs.RELEASE_BODY }}