-
Notifications
You must be signed in to change notification settings - Fork 2
103 lines (84 loc) · 3.79 KB
/
main.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
on:
push:
branches:
- main
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
build-mac:
runs-on: macos-latest
steps:
# See https://docs.github.com/en/actions/deployment/deploying-xcode-applications/installing-an-apple-certificate-on-macos-runners-for-xcode-development
- name: Install Apple codesigning certificate
env:
BUILD_CERTIFICATE_BASE64: ${{ secrets.APPLE_CODESIGNING_CERTIFICATE }}
P12_PASSWORD: ${{ secrets.APPLE_CODESIGNING_P12_PASSWORD }}
KEYCHAIN_PASSWORD: ${{ secrets.KEYCHAIN_PASSWORD }}
run: |
# create variables
CERTIFICATE_PATH=$RUNNER_TEMP/build_certificate.p12
KEYCHAIN_PATH=$RUNNER_TEMP/app-signing.keychain-db
# import certificate and provisioning profile from secrets
echo -n "$BUILD_CERTIFICATE_BASE64" | base64 --decode -o $CERTIFICATE_PATH
# create temporary keychain
security create-keychain -p "$KEYCHAIN_PASSWORD" $KEYCHAIN_PATH
security set-keychain-settings -lut 21600 $KEYCHAIN_PATH
security unlock-keychain -p "$KEYCHAIN_PASSWORD" $KEYCHAIN_PATH
# import certificate to keychain
security import $CERTIFICATE_PATH -P "$P12_PASSWORD" -A -t cert -f pkcs12 -k $KEYCHAIN_PATH
security set-key-partition-list -S apple-tool:,apple: -k "$KEYCHAIN_PASSWORD" $KEYCHAIN_PATH
security list-keychain -d user -s $KEYCHAIN_PATH
- name: Install Godot
working-directory: ${{ env.RUNNER_TEMP }}
run: |
curl -sL https://github.com/godotengine/godot/releases/download/4.2.2-stable/Godot_v4.2.2-stable_macos.universal.zip -o godot.zip
unzip godot.zip
mv Godot.app "$RUNNER_TEMP/Godot.app"
- name: Install butler
working-directory: ${{ env.RUNNER_TEMP }}
run: |
curl -sL https://broth.itch.ovh/butler/darwin-amd64/LATEST/archive/default -o butler.zip
unzip butler.zip
mv butler "$RUNNER_TEMP/butler"
- uses: actions/checkout@v4
- name: Prepare export templates
run: |
mkdir -p ~/Library/Application\ Support/Godot/export_templates/4.2.2.stable
mv build/export_templates/* ~/Library/Application\ Support/Godot/export_templates/4.2.2.stable/
- name: Export build
run: |
"$RUNNER_TEMP/Godot.app/Contents/MacOS/Godot" --headless --export-release macOS
- name: Push to itch.io
env:
BUTLER_API_KEY: ${{ secrets.BUTLER_API_KEY }}
run: |
"$RUNNER_TEMP/butler" push build/mac.zip "jspahrsummers/Merc:mac"
build-windows:
runs-on: ubuntu-latest
steps:
- name: Install Godot
working-directory: ${{ env.RUNNER_TEMP }}
run: |
curl -sL https://github.com/godotengine/godot/releases/download/4.2.2-stable/Godot_v4.2.2-stable_linux.x86_64.zip -o godot.zip
unzip godot.zip
mv Godot_v4.2.2-stable_linux.x86_64 "$RUNNER_TEMP/godot"
- name: Install butler
working-directory: ${{ env.RUNNER_TEMP }}
run: |
curl -sL https://broth.itch.ovh/butler/linux-amd64/LATEST/archive/default -o butler.zip
unzip butler.zip
mv butler "$RUNNER_TEMP/butler"
- uses: actions/checkout@v4
- name: Prepare export templates
run: |
mkdir -p ~/.local/share/godot/export_templates/4.2.2.stable
mv build/export_templates/* ~/.local/share/godot/export_templates/4.2.2.stable/
- name: Export build
run: |
"$RUNNER_TEMP/godot" --headless --export-release Windows
- name: Push to itch.io
env:
BUTLER_API_KEY: ${{ secrets.BUTLER_API_KEY }}
run: |
"$RUNNER_TEMP/butler" push build/Windows "jspahrsummers/Merc:windows"