-
Notifications
You must be signed in to change notification settings - Fork 0
84 lines (71 loc) · 2.84 KB
/
build_and_deploy.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
name: Build + Deploy to itch.io ✨
on:
workflow_dispatch
env:
ITCHIO_USERNAME: ${{ secrets.ITCHIO_USERNAME }}
ITCHIO_GAME: ${{ secrets.ITCHIO_GAME }}
EXPORT_NAME: ${{ secrets.EXPORT_NAME }}
BUTLER_API_KEY: ${{ secrets.BUTLER_API_KEY }}
EXPORT_PATH: ./Builds
jobs:
call-reusable-run-tests:
name: Run tests
uses: ./.github/workflows/reusable_run_tests.yml
build-and-deploy-to-itchio:
name: Build and deploy to itch.io
needs: call-reusable-run-tests
runs-on: ubuntu-latest
timeout-minutes: 5
container:
image: barichello/godot-ci:4.3
env:
# if you change this, remember to update the image version below
GODOT_VERSION: 4.3
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Setup Godot export templates
run: |
mkdir -v -p ~/.local/share/godot/export_templates
mv /root/.local/share/godot/export_templates/${GODOT_VERSION}.stable ~/.local/share/godot/export_templates/${GODOT_VERSION}.stable
# Fix to allow running git commands (as required by semantic-version action).
# If this is not included we get the error "detected dubious ownership".
# See: https://github.com/actions/runner/issues/2033
- name: Set ownership
run: |
# this is to fix GIT not liking owner of the checkout dir
chown -R $(id -u):$(id -g) $PWD
- name: Calculate application version
id: application_version
uses: paulhatch/[email protected]
with:
user_format_type: "json"
tag_prefix: "v"
version_format: "v${major}.${minor}.${patch}-${increment}"
# debug: true
- name: Generate project version
env:
VERSION: ${{ steps.application_version.outputs.version }}
run: |
# echo "--- debug_output ---"
# echo ${{ steps.application_version.outputs.debug_output }}
echo "--- VERSION ---"
echo "Setting project version to $VERSION"
./scripts/set_project_version.sh $VERSION
- name: Windows Build + Itch.io Deploy 🚀
run: |
./scripts/build_and_push_to_itchio.sh win ${EXPORT_PATH}/win/${EXPORT_NAME}.exe ${ITCHIO_USERNAME} ${ITCHIO_GAME} release
- name: Web Build + Itch.io Deploy 🚀
run: |
./scripts/build_and_push_to_itchio.sh html5 ${EXPORT_PATH}/html5/index.html ${ITCHIO_USERNAME} ${ITCHIO_GAME} release
- name: Commit and push version change
env:
VERSION: ${{ steps.application_version.outputs.version }}
run: |
git config --global user.email "github-actions[bot]@users.noreply.github.com"
git config --global user.name "github-actions[bot]"
git add project.godot
git commit -m "🚀 Deployed new build $VERSION!"
git push