-
-
Notifications
You must be signed in to change notification settings - Fork 222
133 lines (117 loc) · 4 KB
/
ExportGodot.yaml
File metadata and controls
133 lines (117 loc) · 4 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
# this actions workflow builds large dscript for desktop plus web. It also has
# some steps to deploy to itch.io through their upload program butler. We have a
# copy of the app on itch.
name: "Export Godot"
on:
workflow_call:
workflow_dispatch:
push:
branches:
- release
- staging
env:
BUTLER_API_KEY: ${{ secrets.BUTLER_API_KEY }}
ITCHIO_USERNAME: ${{ secrets.ITCHIO_USERNAME }}
ITCHIO_GAME: ${{ secrets.ITCHIO_GAME }}
BUILD_GIT_COMMIT: ${{ github.sha }}
BUILD_GIT_BRANCH: ${{ github.ref_name }}
jobs:
# This setup job runs only once and first to prepare the environment to avoid
# downloading Godot and the export templates multiple times.
setup:
name: Setup environment
runs-on: ubuntu-latest
container: registry.gitlab.com/greenfox/godot-build-automation:latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
lfs: false
- name: Install Python 3
run: apt-get update && apt-get install -y --no-install-recommends python3
- name: Prepare CI environment
run: python3 build.py prepare ci
- name: Upload prepared source
uses: actions/upload-artifact@v4
with:
name: prepared-source
path: |
.
!.git
retention-days: 1
include-hidden-files: true
export:
name: Export ${{ matrix.platform }}
needs: setup
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
platform: [linux, windows, osx, web]
include:
- platform: linux
artifact_name: linux
release_tag: linux
- platform: windows
artifact_name: windows
release_tag: windows
- platform: osx
artifact_name: macos-build
release_tag: osx
- platform: web
artifact_name: web
release_tag: web
steps:
- name: Checkout for GitHub Pages deploy
if: matrix.platform == 'web'
uses: actions/checkout@v4
with:
lfs: false
- name: Download prepared source
uses: actions/download-artifact@v4
with:
name: prepared-source
- name: Make Godot and butler executable and set up environment
run: |
chmod +x godot_server.x86_64
chmod +x butler
echo "$PWD" >> $GITHUB_PATH
echo "GODOT_TEMPLATES_DIR=$PWD/templates" >> $GITHUB_ENV
- name: Export for ${{ matrix.platform }}
run: python3 build.py export ${{ matrix.platform }}
- name: Push to itch.io
if: github.ref_name == 'release' || github.ref_name == 'staging'
run: python3 build.py push ${{ matrix.platform }}
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: ${{ matrix.artifact_name }}
path: build/${{ matrix.platform }}
retention-days: ${{ matrix.platform == 'osx' && 30 || 90 }}
- name: Upload desktop builds to GitHub Releases
if: matrix.release_tag != ''
uses: svenstaro/upload-release-action@v2
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: build/${{ matrix.platform }}/*
tag: ${{ matrix.release_tag }}
file_glob: true
overwrite: true
- name: Deploy release web build to GitHub Pages
if: (matrix.platform == 'web') && (github.ref_name == 'release')
uses: JamesIves/github-pages-deploy-action@v4
with:
token: ${{ secrets.GITHUB_TOKEN }}
branch: gh-pages
folder: build/web
target-folder: ''
clean: false
- name: Deploy staging/other web build to GitHub Pages
if: (matrix.platform == 'web') && (github.ref_name != 'release')
uses: JamesIves/github-pages-deploy-action@v4
with:
token: ${{ secrets.GITHUB_TOKEN }}
branch: gh-pages
folder: build/web/${{ github.ref_name }}
target-folder: ${{ github.ref_name }}
clean: false