This repository has been archived by the owner on May 30, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 62
178 lines (153 loc) · 6.29 KB
/
nightly-release.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
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
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
---
name: Create nightly artifact
on:
schedule:
- cron: "59 23 * * *"
workflow_dispatch:
env:
tar-path: resources.tar.gz
resource-artifact-prefix: "__workflow-resources-"
jobs:
setup-extensions:
strategy:
fail-fast: false
matrix:
include:
- os: windows-latest
os-name: windows
- os: ubuntu-latest
os-name: linux
# - os: macos-latest
# os-name: osx
runs-on: ${{ matrix.os }}
steps:
- name: Checkout repo
uses: actions/checkout@v3
with:
submodules: recursive
- name: Build default extensions
if: matrix.os != 'macos-latest'
shell: bash
run: |
python -m pip install requests
python scripts/setup_extensions.py --setup --export
- name: Build default extensions
if: matrix.os == 'macos-latest'
shell: bash
run: |
python3 -m pip install requests
python3 scripts/setup_extensions.py --setup --export
- name: Tar to preserve file permissions
shell: bash
run: |
tar -czvf ${{ env.tar-path }} resources
- name: Upload resources
uses: actions/upload-artifact@v3
with:
name: ${{ env.resource-artifact-prefix }}${{ matrix.os-name }}
path: ${{ env.tar-path }}
retention-days: 1 # No reason to retain these
release:
env:
headless-bin-url: "https://github.com/virtual-puppet-project/godot-builds/releases/download/latest/Godot_v3.x-stable_linux_headless.64.tar.gz"
headless-bin: Godot_v3.x-stable_linux_headless.64
release-config: release_config.toml
decompress-windows: decompress.bat
decompress-unix: decompress.sh
decompress-instructions: instructions.txt
strategy:
fail-fast: false
matrix:
include:
- os-name: windows
export-preset-name: windows
release-template-url: "https://github.com/virtual-puppet-project/godot-builds/releases/download/latest/Godot_v3.x-stable_windows_release.64.exe.tar.gz"
resource-path: "$EXE_DIR/resources"
- os-name: linux
export-preset-name: linux
release-template-url: "https://github.com/virtual-puppet-project/godot-builds/releases/download/latest/Godot_v3.x-stable_linux_release.64.tar.gz"
resource-path: "$EXE_DIR/resources"
- os-name: linux
export-preset-name: flatpak
release-template-url: "https://github.com/virtual-puppet-project/godot-builds/releases/download/latest/Godot_v3.x-stable_linux_release.64.tar.gz"
resource-path: "$EXE_DIR/resources"
## Disabled for now since osx templates are not packed correctly
# - os-name: osx
# export-preset-name: osx
runs-on: ubuntu-latest
needs: setup-extensions
steps:
- name: Checkout repo without submodules
uses: actions/checkout@v3
- name: Download Godot binaries
shell: bash
run: |
curl -L ${{ env.headless-bin-url }} -o editor.tar.gz
tar -xzvf editor.tar.gz
chmod +x ${{ env.headless-bin }}
./${{ env.headless-bin }} --editor --quit # Needed to load things once?
mkdir release_templates
cd release_templates
curl -L ${{ matrix.release-template-url }} -o template.tar.gz
tar -xzvf *.tar.gz
- name: Set export path
shell: bash
run: echo "EXPORT_PATH=export/${{ matrix.export-preset-name }}" >> $GITHUB_ENV
- name: Set current date
shell: bash
run: echo "CURRENT_DATETIME=$(date '+%Y-%m-%d_%H-%M-%S')" >> $GITHUB_ENV
- name: Generate ${{ env.release-config }}
shell: bash
run: |
touch ${{ env.release-config }}
echo "resource_path = '\$EXE_DIR/resources'" >> ${{ env.release-config }}
echo "version = 'nightly_${{ env.CURRENT_DATETIME }}'" >> ${{ env.release-config }}
- name: Export project
shell: bash
run: |
mkdir ${{ env.EXPORT_PATH }}
./${{ env.headless-bin }} --export --verbose ${{ matrix.export-preset-name }}
# mv resources ${{ env.EXPORT_PATH }}
- name: Fix executable bit
if: matrix.os-name == 'linux'
shell: bash
run: chmod +x ${{ env.EXPORT_PATH }}/vpuppr.x86_64
- name: Download pre-setup resources
uses: actions/download-artifact@v3
with:
name: ${{ env.resource-artifact-prefix }}${{ matrix.os-name }}
- name: Process resources
shell: bash
run: |
rm -rf resources
tar -xzvf ${{ env.tar-path }} resources
mv resources ${{ env.EXPORT_PATH }}
- name: Set tar name
shell: bash
run: echo "PROJECT_TAR_NAME=vpuppr_nightly_${{ matrix.export-preset-name }}_${{ env.CURRENT_DATETIME }}.tar.gz" >> $GITHUB_ENV
- name: Pack release into tar.gz
shell: bash
run: |
cd export/${{ matrix.export-preset-name }}
tar -czvf ${{ env.PROJECT_TAR_NAME }} *
mv ${{ env.PROJECT_TAR_NAME }} ../..
- name: Create scripts to decompress tar.gz
shell: bash
run: |
echo "tar xzvf ${{ env.PROJECT_TAR_NAME }}" > ${{ env.decompress-windows }}
echo "tar xzvf ${{ env.PROJECT_TAR_NAME }}" > ${{ env.decompress-unix }}
touch ${{ env.decompress-instructions }}
echo "Windows" >> ${{ env.decompress-instructions }}
echo "Double click on ${{ env.decompress-windows }}" >> ${{ env.decompress-instructions }}
echo "" >> ${{ env.decompress-instructions }}
echo "Linux and Mac" >> ${{ env.decompress-instructions }}
echo "Run ${{ env.decompress-unix }} from a terminal" >> ${{ env.decompress-instructions }}
- name: Upload artifact
uses: actions/upload-artifact@v3
with:
name: vpuppr_nightly_${{ matrix.export-preset-name }}_${{ env.CURRENT_DATETIME }}
path: |
${{ env.PROJECT_TAR_NAME }}
${{ env.decompress-windows }}
${{ env.decompress-unix }}
${{ env.decompress-instructions }}