Compare commits
2 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
94418c9edb | ||
|
|
f7377406df |
@@ -1,5 +1,9 @@
|
||||
name: Android build
|
||||
|
||||
permissions:
|
||||
contents: read
|
||||
releases: write
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
@@ -33,7 +37,9 @@ jobs:
|
||||
export ANDROID_HOME="$ANDROID_SDK_ROOT"
|
||||
mkdir -p "$ANDROID_SDK_ROOT/cmdline-tools"
|
||||
if [ ! -x "$ANDROID_SDK_ROOT/cmdline-tools/latest/bin/sdkmanager" ]; then
|
||||
curl -fsSL -o /tmp/commandlinetools.zip https://dl.google.com/android/repository/commandlinetools-linux-12266719_latest.zip
|
||||
tools_url="$(curl -fsSL https://developer.android.com/studio | grep -o 'https://dl.google.com/android/repository/commandlinetools-linux-[0-9][0-9]*_latest.zip' | head -n 1)"
|
||||
test -n "$tools_url"
|
||||
curl -fsSL -o /tmp/commandlinetools.zip "$tools_url"
|
||||
rm -rf "$ANDROID_SDK_ROOT/cmdline-tools/latest" "$ANDROID_SDK_ROOT/cmdline-tools/cmdline-tools"
|
||||
unzip -q /tmp/commandlinetools.zip -d "$ANDROID_SDK_ROOT/cmdline-tools"
|
||||
mv "$ANDROID_SDK_ROOT/cmdline-tools/cmdline-tools" "$ANDROID_SDK_ROOT/cmdline-tools/latest"
|
||||
@@ -82,10 +88,17 @@ jobs:
|
||||
path: app/build/outputs/apk/debug/*.apk
|
||||
if-no-files-found: error
|
||||
|
||||
- name: Upload release AAB
|
||||
- name: Attach release AAB to Gitea release
|
||||
if: github.event_name == 'release'
|
||||
uses: actions/upload-artifact@v3
|
||||
with:
|
||||
name: release-aab
|
||||
path: app/build/outputs/bundle/release/*.aab
|
||||
if-no-files-found: error
|
||||
env:
|
||||
GITEA_TOKEN: ${{ secrets.GITEA_TOKEN }}
|
||||
shell: bash
|
||||
run: |
|
||||
set -euxo pipefail
|
||||
release_id="$(python3 -c 'import json, os; print(json.load(open(os.environ["GITHUB_EVENT_PATH"], encoding="utf-8"))["release"]["id"])')"
|
||||
aab="$(find app/build/outputs/bundle/release -name '*.aab' | head -n 1)"
|
||||
curl --fail-with-body \
|
||||
--request POST \
|
||||
--header "Authorization: token ${GITEA_TOKEN}" \
|
||||
--form "attachment=@${aab}" \
|
||||
"${GITHUB_SERVER_URL}/api/v1/repos/${GITHUB_REPOSITORY}/releases/${release_id}/assets?name=$(basename "$aab")"
|
||||
|
||||
Reference in New Issue
Block a user