Compare commits
1 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
f7377406df |
@@ -1,5 +1,9 @@
|
||||
name: Android build
|
||||
|
||||
permissions:
|
||||
contents: read
|
||||
releases: write
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
@@ -82,10 +86,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