-
Notifications
You must be signed in to change notification settings - Fork 0
Fix Android SIGSEGV at pc=0x0, merge upstream, add keystore upload to release workflow #219
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
c148e20
0ecb892
2aa9f75
d8c4c7e
682155b
3ffb519
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -17,6 +17,21 @@ on: | |
| required: false | ||
| default: true | ||
| type: boolean | ||
| keystore_base64: | ||
| description: "Base64-encoded keystore (from SAVE-THESE-SECRETS.txt). Overrides ANDROID_KEYSTORE_BASE64 secret." | ||
| required: false | ||
| default: "" | ||
| type: string | ||
| key_alias: | ||
| description: "Signing key alias (from SAVE-THESE-SECRETS.txt). Overrides ANDROID_SIGNING_KEY_ALIAS secret." | ||
| required: false | ||
| default: "" | ||
| type: string | ||
| key_password: | ||
| description: "Signing key password (from SAVE-THESE-SECRETS.txt). Overrides ANDROID_SIGNING_KEY_PASSWORD secret." | ||
| required: false | ||
| default: "" | ||
| type: string | ||
|
|
||
| jobs: | ||
| build-android: | ||
|
|
@@ -82,17 +97,37 @@ jobs: | |
| run: | | ||
| KS_PATH="${{ github.workspace }}/osu.Android/osu.keystore" | ||
|
|
||
| if [ -n "$KEYSTORE_BASE64" ]; then | ||
| # ── User provided a persistent keystore secret ────────────── | ||
| echo "$KEYSTORE_BASE64" | base64 --decode > "$KS_PATH" | ||
| # Priority: workflow_dispatch inputs > repository secrets > auto-generate. | ||
| # This lets users paste values from SAVE-THESE-SECRETS.txt directly into | ||
| # the "Run workflow" form so they don't need to set up repo secrets. | ||
| # Note: the auto-generated keystore uses the same password for both key and | ||
| # store, so a single key_password input covers both. Users with separate | ||
| # passwords should use repository secrets instead of workflow inputs. | ||
| EFFECTIVE_KS="${INPUT_KEYSTORE_BASE64:-$KEYSTORE_BASE64}" | ||
| EFFECTIVE_ALIAS="${INPUT_KEY_ALIAS:-$KEY_ALIAS_SECRET}" | ||
| EFFECTIVE_PASS="${INPUT_KEY_PASSWORD:-$KEY_PASS_SECRET}" | ||
| EFFECTIVE_STORE_PASS="${INPUT_KEY_PASSWORD:-${STORE_PASS_SECRET:-$EFFECTIVE_PASS}}" | ||
|
|
||
| # Mask passwords so they never appear in logs. | ||
| if [ -n "$EFFECTIVE_PASS" ]; then echo "::add-mask::$EFFECTIVE_PASS"; fi | ||
| if [ -n "$EFFECTIVE_STORE_PASS" ]; then echo "::add-mask::$EFFECTIVE_STORE_PASS"; fi | ||
|
|
||
| if [ -n "$EFFECTIVE_KS" ]; then | ||
| # ── User provided a keystore (via input or secret) ────────────── | ||
| echo "$EFFECTIVE_KS" | base64 --decode > "$KS_PATH" | ||
|
Comment on lines
+106
to
+117
|
||
| echo "has_keystore=true" >> "$GITHUB_OUTPUT" | ||
| echo "generated=false" >> "$GITHUB_OUTPUT" | ||
| echo "key_alias=$KEY_ALIAS_SECRET" >> "$GITHUB_OUTPUT" | ||
| echo "key_pass=$KEY_PASS_SECRET" >> "$GITHUB_OUTPUT" | ||
| echo "store_pass=$STORE_PASS_SECRET" >> "$GITHUB_OUTPUT" | ||
| echo "✅ Using saved keystore from repository secrets." | ||
| echo "key_alias=${EFFECTIVE_ALIAS:-osu-release}" >> "$GITHUB_OUTPUT" | ||
| echo "key_pass=${EFFECTIVE_PASS}" >> "$GITHUB_OUTPUT" | ||
| echo "store_pass=${EFFECTIVE_STORE_PASS}" >> "$GITHUB_OUTPUT" | ||
|
Comment on lines
+115
to
+122
|
||
|
|
||
| if [ -n "$INPUT_KEYSTORE_BASE64" ]; then | ||
| echo "✅ Using keystore from workflow dispatch inputs." | ||
| else | ||
| echo "✅ Using saved keystore from repository secrets." | ||
| fi | ||
| else | ||
| # ── No secret → auto-generate a keystore for this build ───── | ||
| # ── No keystore → auto-generate one for this build ────────────── | ||
| # The APK will install fine on any device, but UPDATING from a | ||
| # previous build signed with a DIFFERENT key will fail. | ||
| # To avoid that, save the generated keystore as a secret | ||
|
|
@@ -141,6 +176,9 @@ jobs: | |
| KEY_ALIAS_SECRET: ${{ secrets.ANDROID_SIGNING_KEY_ALIAS }} | ||
| KEY_PASS_SECRET: ${{ secrets.ANDROID_SIGNING_KEY_PASSWORD }} | ||
| STORE_PASS_SECRET: ${{ secrets.ANDROID_SIGNING_STORE_PASSWORD }} | ||
| INPUT_KEYSTORE_BASE64: ${{ inputs.keystore_base64 }} | ||
| INPUT_KEY_ALIAS: ${{ inputs.key_alias }} | ||
| INPUT_KEY_PASSWORD: ${{ inputs.key_password }} | ||
|
|
||
| - name: Determine version | ||
| id: version | ||
|
|
@@ -308,6 +346,11 @@ jobs: | |
| echo "" | ||
| echo " ⚡ After saving the secrets, all future builds will use the" | ||
| echo " same keystore automatically — no more setup needed." | ||
| echo "" | ||
| echo " 💡 QUICK OPTION: You can also paste the values from" | ||
| echo " SAVE-THESE-SECRETS.txt directly into the workflow" | ||
| echo " dispatch inputs (keystore_base64, key_alias, key_password)" | ||
| echo " when running the 'Build Android APK' workflow manually." | ||
| echo "==================================================================" | ||
|
|
||
| # Create a GitHub Release with the APK attached. | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,33 @@ | ||
| // Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence. | ||
| // See the LICENCE file in the repository root for full licence text. | ||
|
|
||
| using NUnit.Framework; | ||
| using osu.Framework.Graphics; | ||
| using osu.Game.Screens.OnlinePlay.Matchmaking.RankedPlay.Intro; | ||
|
|
||
| namespace osu.Game.Tests.Visual.RankedPlay | ||
| { | ||
| [TestFixture] | ||
| public partial class TestSceneStarRatingSequence : RankedPlayTestScene | ||
| { | ||
| [Test] | ||
| public void TestBasicAppearance() | ||
| { | ||
| float starRating = 5; | ||
|
|
||
| AddSliderStep("set star rating", 0f, 10, 5, sr => starRating = sr); | ||
| AddStep("play sequence", () => | ||
| { | ||
| StarRatingSequence sequence; | ||
|
|
||
| Child = sequence = new StarRatingSequence | ||
| { | ||
| Anchor = Anchor.Centre, | ||
| Origin = Anchor.Centre | ||
| }; | ||
| double delay = 0; | ||
| sequence.Play(ref delay, starRating); | ||
| }); | ||
| } | ||
| } | ||
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The
workflow_dispatchinputskeystore_base64,key_alias, andkey_passwordare not secret-protected by GitHub Actions (their values are stored in the workflow run metadata and may be visible to anyone with access to the run). Using them for an Android signing keystore/password risks leaking the private signing key. Consider removing these inputs and only supporting repository/environment secrets (or another secret-protected mechanism) for providing signing material.