-
Notifications
You must be signed in to change notification settings - Fork 1
66 lines (58 loc) · 2.4 KB
/
export-dispatch.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
name: Export Dispatch
on:
workflow_dispatch:
inputs:
godot_version:
description: "Godot version (without v prefix)"
default: 4.1.1
jobs:
export_game:
runs-on: ubuntu-latest
permissions: write-all
name: Export Game
steps:
- name: Checkout
uses: actions/checkout@v3.3.0
- name: Release Please
uses: google-github-actions/release-please-action@v3
id: release
with:
token: ${{ secrets.RELEASE_PLEASE }}
release-type: simple
extra-files: |
project/version.gd
- name: Export Game
if: ${{ steps.release.outputs.release_created }}
id: export
uses: firebelley/godot-export@v5.2.1
with:
godot_executable_download_url: https://downloads.tuxfamily.org/godotengine/${{ github.event.inputs.godot_version }}/Godot_v${{ github.event.inputs.godot_version }}-stable_linux.x86_64.zip
godot_export_templates_download_url: https://downloads.tuxfamily.org/godotengine/${{ github.event.inputs.godot_version }}/Godot_v${{ github.event.inputs.godot_version }}-stable_export_templates.tpz
relative_project_path: ./project
cache: true
archive_output: true
- name: Upload Release Artifact
if: ${{ steps.release.outputs.release_created }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
for FILE_PATH in ${{ steps.export.outputs.archive_directory }}/*; do
gh release upload ${{ steps.release.outputs.tag_name }} "$FILE_PATH" --clobber
done
- name: Deploy to Itch.io
if: ${{ steps.release.outputs.release_created }}
env:
BUTLER_API_KEY: ${{ secrets.BUTLER_API_KEY }}
BUILD_VERSION: ${{ steps.release.outputs.major }}.${{ steps.release.outputs.minor }}.${{ steps.release.outputs.patch }}
run: |
for FILE_PATH in ${{ steps.export.outputs.archive_directory }}/*; do
directory=$FILE_PATH
filename=$(basename "$FILE_PATH")
platform="${filename%%.*}"
version="${{ steps.release.outputs.tag_name }}"
version="${version#v}" # Remove the "v" prefix
user=${{ vars.ITCH_USERNAME }}
game=${{ vars.ITCH_GAME_ID }}
channel=${platform}
butler push "$directory" "$user"/"$game":"$channel" --userversion "$version"
done