Skip to content

fix: allow overwrite on WebDAV sync push to prevent 409 conflicts (#58) #24

fix: allow overwrite on WebDAV sync push to prevent 409 conflicts (#58)

fix: allow overwrite on WebDAV sync push to prevent 409 conflicts (#58) #24

name: Build NexaNote Android APK
on:
push:
branches: ["main"]
tags: ["v*"]
workflow_dispatch:
jobs:
build-android:
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Java
uses: actions/setup-java@v4
with:
distribution: temurin
java-version: "21"
- name: Setup Flutter
uses: subosito/flutter-action@v2
with:
channel: stable
cache: true
- name: Install dependencies
run: |
cd app
flutter pub get
- name: Analyze
run: |
cd app
flutter analyze || true
- name: Run tests
run: |
cd app
flutter test || true
- name: Build NexaNote APK
run: |
cd app
flutter build apk --release
- name: Prepare APK file
run: |
mkdir -p release
if [ "${GITHUB_REF_TYPE}" = "tag" ]; then
cp app/build/app/outputs/flutter-apk/app-release.apk "release/NexaNote-Android-${GITHUB_REF_NAME}.apk"
else
cp app/build/app/outputs/flutter-apk/app-release.apk "release/NexaNote-Android-dev-${GITHUB_SHA::7}.apk"
fi
- name: Upload APK artifact
uses: actions/upload-artifact@v4
with:
name: NexaNote-Android
path: release/*.apk
if-no-files-found: error
- name: Create GitHub Release and attach APK
if: github.ref_type == 'tag'
uses: softprops/action-gh-release@v2
with:
tag_name: ${{ github.ref_name }}
name: NexaNote ${{ github.ref_name }}
files: release/*.apk
fail_on_unmatched_files: true