Skip to content

Commit b4b705d

Browse files
authored
Merge pull request #205 from winnerspiros/copilot/review-installation-failure-issues
Fix INSTALL_FAILED_UPDATE_INCOMPATIBLE, add auto-signing, versioning, releases, and fork documentation
2 parents effc01e + ee34a92 commit b4b705d

5 files changed

Lines changed: 588 additions & 219 deletions

File tree

Lines changed: 111 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,111 @@
1+
name: Generate Android Signing Keystore
2+
3+
on:
4+
workflow_dispatch:
5+
inputs:
6+
key_password:
7+
description: "Password for the keystore and key (min 6 characters)"
8+
required: true
9+
type: string
10+
key_alias:
11+
description: "Key alias name"
12+
required: false
13+
default: "osu-release"
14+
type: string
15+
validity_days:
16+
description: "Certificate validity in days"
17+
required: false
18+
default: "10000"
19+
type: string
20+
21+
jobs:
22+
generate:
23+
name: Generate Keystore
24+
runs-on: ubuntu-latest
25+
permissions: {}
26+
steps:
27+
# Mask the password so it is never printed in logs.
28+
- name: Mask password
29+
run: echo "::add-mask::${{ inputs.key_password }}"
30+
31+
- name: Validate inputs
32+
run: |
33+
if [ ${#KEY_PASSWORD} -lt 6 ]; then
34+
echo "::error::Password must be at least 6 characters."
35+
exit 1
36+
fi
37+
env:
38+
KEY_PASSWORD: ${{ inputs.key_password }}
39+
40+
- name: Generate keystore
41+
run: |
42+
keytool -genkeypair -v \
43+
-keystore osu-release.keystore \
44+
-storepass "$KEY_PASSWORD" \
45+
-keypass "$KEY_PASSWORD" \
46+
-alias "$KEY_ALIAS" \
47+
-keyalg RSA -keysize 2048 \
48+
-validity "$VALIDITY_DAYS" \
49+
-dname "CN=osu! Android Release,O=osu,C=US"
50+
51+
echo "Keystore generated successfully ✓"
52+
keytool -list -v -keystore osu-release.keystore -storepass "$KEY_PASSWORD" | head -20
53+
env:
54+
KEY_PASSWORD: ${{ inputs.key_password }}
55+
KEY_ALIAS: ${{ inputs.key_alias }}
56+
VALIDITY_DAYS: ${{ inputs.validity_days }}
57+
58+
- name: Encode keystore as base64
59+
id: encode
60+
run: |
61+
B64=$(base64 -w 0 osu-release.keystore)
62+
echo "$B64" > keystore-base64.txt
63+
echo "encoded=true" >> "$GITHUB_OUTPUT"
64+
65+
- name: Upload keystore artifact
66+
uses: actions/upload-artifact@v7
67+
with:
68+
name: osu-signing-keystore
69+
path: osu-release.keystore
70+
retention-days: 1
71+
72+
- name: Upload base64 artifact
73+
uses: actions/upload-artifact@v7
74+
with:
75+
name: osu-signing-keystore-base64
76+
path: keystore-base64.txt
77+
retention-days: 1
78+
79+
- name: Output setup instructions
80+
run: |
81+
echo ""
82+
echo "==================================================================="
83+
echo " KEYSTORE GENERATED — SAVE THESE SECRETS NOW"
84+
echo "==================================================================="
85+
echo ""
86+
echo " Go to: Settings → Secrets and variables → Actions → New repository secret"
87+
echo ""
88+
echo " Add these four secrets:"
89+
echo ""
90+
echo " 1. ANDROID_KEYSTORE_BASE64"
91+
echo " → Value: contents of the 'keystore-base64.txt' file from the"
92+
echo " 'osu-signing-keystore-base64' artifact (download it above)"
93+
echo ""
94+
echo " 2. ANDROID_SIGNING_KEY_ALIAS"
95+
echo " → Value: ${{ inputs.key_alias }}"
96+
echo ""
97+
echo " 3. ANDROID_SIGNING_KEY_PASSWORD"
98+
echo " → Value: the password you entered when triggering this workflow"
99+
echo ""
100+
echo " 4. ANDROID_SIGNING_STORE_PASSWORD"
101+
echo " → Value: the password you entered when triggering this workflow"
102+
echo ""
103+
echo " IMPORTANT:"
104+
echo " • Keep a backup of the keystore file! If you lose it, you will"
105+
echo " never be able to update your installed APK — you would have to"
106+
echo " uninstall and reinstall (losing all local data)."
107+
echo " • After saving the secrets, DELETE this workflow run to remove"
108+
echo " the keystore artifact (Settings → Actions → this run → Delete)."
109+
echo ""
110+
echo " After saving the secrets, run the 'Build Android APK' workflow."
111+
echo "==================================================================="

0 commit comments

Comments
 (0)