Fix session history and bell timing

This commit is contained in:
waozi authored and Waozi committed 2026-07-11 18:49:15 -03:00
1 parent e4cb7edc98
commit 81ccbde44c
20 files changed
+118 -152

No files matched your search

+34 -99
View File
@@ -4,16 +4,17 @@ on:
push:
branches:
- master
tags:
- 'v*'
pull_request:
branches:
- master
workflow_dispatch:
permissions:
contents: write
jobs:
unsigned-release:
name: Build Unsigned Release APK (F-Droid)
release:
name: Build Release APK
runs-on: ubuntu-latest
steps:
@@ -21,49 +22,7 @@ jobs:
uses: actions/checkout@v4
with:
submodules: recursive
- name: Set up JDK 17
uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: '17'
- name: Setup Gradle
uses: gradle/actions/setup-gradle@v3
- name: Grant execute permission for gradlew
run: chmod +x droid/gradlew
- name: Build Release APK (unsigned)
working-directory: ./droid
run: ./gradlew assembleRelease --stacktrace
- name: Rename APKs
run: |
# Get universal APK
find droid/app/build/outputs/apk/release -name "*-universal-release.apk" -exec cp {} inbe-release-universal.apk \; 2>/dev/null || true
# Get any release APK as fallback
find droid/app/build/outputs/apk/release -name "*.apk" -exec cp {} inbe-release.apk \; 2>/dev/null || true
- name: Upload Unsigned APK
uses: actions/upload-artifact@v4
with:
name: unsigned-release-apk
path: |
inbe-release-universal.apk
inbe-release.apk
if-no-files-found: warn
signed-release:
name: Build Signed Release APK
runs-on: ubuntu-latest
if: github.event_name == 'workflow_dispatch' || startsWith(github.ref, 'refs/tags/')
steps:
- name: Checkout Repository
uses: actions/checkout@v4
with:
submodules: recursive
fetch-depth: 0
- name: Set up JDK 17
uses: actions/setup-java@v4
@@ -91,7 +50,7 @@ jobs:
echo "$KEYSTORE_BASE64" | base64 -d > ~/.android/inbe-release.keystore
echo "Keystore decoded successfully"
- name: Build Signed Release APK
- name: Build Release APK
working-directory: ./droid
env:
KEYSTORE_PASSWORD: ${{ secrets.KEYSTORE_PASSWORD }}
@@ -103,66 +62,42 @@ jobs:
-Pkeystore.path="/home/runner/.android/inbe-release.keystore" \
--stacktrace
- name: Rename Signed APK
- name: Rename APK
run: |
# Get universal signed APK
find droid/app/build/outputs/apk/release -name "*-universal-release.apk" -exec cp {} inbe-signed-release-universal.apk \; 2>/dev/null || true
# Get any signed APK as fallback
find droid/app/build/outputs/apk/release -name "*.apk" ! -name "*unsigned*" -exec cp {} inbe-signed-release.apk \; 2>/dev/null || true
find droid/app/build/outputs/apk/release -name "*-universal-release.apk" -exec cp {} inbe.apk \; 2>/dev/null || true
- name: Verify APK Signature
run: |
if [ -f inbe-signed-release.apk ]; then
echo "APK exists, checking signature..."
# Check if APK is signed using apksigner (available in Android SDK)
$ANDROID_HOME/build-tools/34.0.0/apksigner verify --print-certs inbe-signed-release.apk || echo "apksigner not available, skipping verification"
else
echo "No signed APK found"
ls -la droid/app/build/outputs/apk/release/
fi
- name: Upload Signed APK
- name: Upload APK
uses: actions/upload-artifact@v4
with:
name: signed-release-apk
path: |
inbe-signed-release-universal.apk
inbe-signed-release.apk
name: release-apk
path: inbe.apk
if-no-files-found: warn
release:
name: Create GitHub Release
needs: [unsigned-release, signed-release]
if: startsWith(github.ref, 'refs/tags/')
runs-on: ubuntu-latest
permissions:
contents: write
- name: Create and Push Tag (if new version)
id: tag_version
if: github.event_name == 'push' && github.ref == 'refs/heads/master'
run: |
VERSION=$(grep "versionName" droid/app/build.gradle | awk '{print $2}' | tr -d '"')
TAG="v$VERSION"
if git rev-parse "$TAG" >/dev/null 2>&1; then
echo "Tag $TAG exists, skipping"
echo "tag_pushed=false" >> $GITHUB_OUTPUT
else
git config user.name "github-actions[bot]"
git config user.email "github-actions[bot]@users.noreply.github.com"
git tag -a "$TAG" -m "Release $VERSION"
git push origin "$TAG"
echo "tag_pushed=true" >> $GITHUB_OUTPUT
echo "tag_name=$TAG" >> $GITHUB_OUTPUT
fi
steps:
- name: Checkout Repository
uses: actions/checkout@v4
- name: Download Unsigned APK
uses: actions/download-artifact@v4
with:
name: unsigned-release-apk
path: .
- name: Download Signed APK
uses: actions/download-artifact@v4
with:
name: signed-release-apk
path: .
if-no-files-found: ignore
- name: Create Release
- name: Create GitHub Release
if: steps.tag_version.outputs.tag_pushed == 'true'
uses: softprops/action-gh-release@v1
with:
files: |
inbe-release*.apk
inbe-signed*.apk
draft: false
prerelease: false
tag_name: ${{ steps.tag_version.outputs.tag_name }}
files: inbe.apk
generate_release_notes: true
draft: false
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
+6
View File
@@ -1,4 +1,10 @@
# Changelog
## [1.0.7] - 2026-05-27
### Added
- F-Droid metadata (screenshots, feature graphic, icon)
- Automatic version tag generation for releases
- Fastlane changelog integration
## [1.0.6] - 2026-05-27
### Fixed
- Bell now plays before the last breath (at maxbreaths - 1) instead of after
+18 -4
View File
@@ -1,7 +1,21 @@
Copyright 2026 waozi
MIT License
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
Copyright (c) 2026 waozi
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
+1 -1
View File
@@ -1,4 +1,4 @@
# inbe
# Inner Breeze
Inner Breeze - A free, open-source guided breathing meditation app based on the Wim Hof method.
+3 -1
View File
@@ -62,7 +62,9 @@ android {
}
gradle.taskGraph.whenReady { taskGraph ->
if (taskGraph.hasTask(":app:assembleRelease") && !project.findProperty('keystore.password')) {
if (taskGraph.hasTask(":app:assembleRelease")
&& !project.findProperty('keystore.password')
&& !System.getenv("FDROIDBUILD")) {
throw new GradleException("Use: make android-release PASSWORD=your-password")
}
}
@@ -0,0 +1 @@
@@ -0,0 +1 @@
@@ -0,0 +1 @@
@@ -0,0 +1 @@
@@ -0,0 +1 @@
@@ -0,0 +1 @@
@@ -0,0 +1 @@
@@ -0,0 +1 @@
Binary file not shown.

After

Width:  |  Height:  |  Size: 50 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 30 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 187 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 57 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 47 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 37 KiB

+48 -47
View File
@@ -1,69 +1,70 @@
#!/usr/bin/env bash
# update_version.sh - Update version from CHANGELOG.md
# update_version.sh - Update version from CHANGELOG.md (master truth)
# Usage: ./update_version.sh
set -e
CHANGELOG_FILE="CHANGELOG.md"
GRADLE_FILE="droid/app/build.gradle"
CHANGELOG_DIR="fastlane/metadata/android/en-US/changelogs"
# Check if files exist
if [ ! -f "$CHANGELOG_FILE" ]; then
echo "Error: $CHANGELOG_FILE not found"
exit 1
fi
# Extract all versions from CHANGELOG
VERSIONS=$(grep '^## \[' "$CHANGELOG_FILE" | sed 's/^## \[\([^]]*\)\].*/\1/')
if [ ! -f "$GRADLE_FILE" ]; then
echo "Error: $GRADLE_FILE not found"
exit 1
fi
# Extract latest version from CHANGELOG (first ## [X.Y.Z] pattern)
VERSION=$(grep -m1 '^## \[' "$CHANGELOG_FILE" | sed 's/^## \[\([^]]*\)\].*/\1/')
if [ -z "$VERSION" ]; then
echo "Error: No version found in $CHANGELOG_FILE"
if [ -z "$VERSIONS" ]; then
echo "Error: No versions found in $CHANGELOG_FILE"
echo "Expected format: ## [1.0.0] - YYYY-MM-DD"
exit 1
fi
# Validate version format (basic semver check)
if ! [[ "$VERSION" =~ ^[0-9]+\.[0-9]+\.[0-9]+$ ]]; then
echo "Error: Invalid version format: $VERSION"
echo "Expected semantic versioning format: X.Y.Z"
exit 1
fi
# Get latest version for gradle update
LATEST_VERSION=$(echo "$VERSIONS" | head -n 1)
# versionCode = patch + 1 (since 1.0.0 = code 1)
VERSION_CODE=$(($(echo "$LATEST_VERSION" | cut -d. -f3) + 1))
# Get current versionCode and increment
CURRENT_CODE=$(grep "versionCode" "$GRADLE_FILE" | awk '{print $2}')
NEW_CODE=$((CURRENT_CODE + 1))
# Get current versionName for comparison
# Get current versionName
CURRENT_NAME=$(grep "versionName" "$GRADLE_FILE" | sed 's/.*"\([^"]*\)".*/\1/')
CURRENT_CODE=$(grep "versionCode" "$GRADLE_FILE" | awk '{print $2}')
echo "Current: versionName = $CURRENT_NAME, versionCode = $CURRENT_CODE"
echo "New: versionName = $VERSION, versionCode = $NEW_CODE"
echo "Updating to: $LATEST_VERSION (code $VERSION_CODE)"
echo "Current: $CURRENT_NAME (code $CURRENT_CODE)"
# Confirm before making changes
read -p "Apply changes? (y/N) " -n 1 -r
echo
if [[ ! $REPLY =~ ^[Yy]$ ]]; then
echo "Aborted"
exit 0
fi
# Backup original file
cp "$GRADLE_FILE" "$GRADLE_FILE.bak"
# Update gradle file
sed -i "s/versionCode $CURRENT_CODE/versionCode $NEW_CODE/" "$GRADLE_FILE"
sed -i "s/versionName \"$CURRENT_NAME\"/versionName \"$VERSION\"/" "$GRADLE_FILE"
# Update gradle file with latest version
sed -i "s/versionCode $CURRENT_CODE/versionCode $VERSION_CODE/" "$GRADLE_FILE"
sed -i "s/versionName \"$CURRENT_NAME\"/versionName \"$LATEST_VERSION\"/" "$GRADLE_FILE"
echo "✓ Updated $GRADLE_FILE"
echo ""
echo "Changes:"
diff -u "$GRADLE_FILE.bak" "$GRADLE_FILE" || true
rm "$GRADLE_FILE.bak"
# Create changelog directory
mkdir -p "$CHANGELOG_DIR"
# Generate only missing changelog files
while IFS= read -r VERSION; do
# versionCode = patch + 1
CODE=$(($(echo "$VERSION" | cut -d. -f3) + 1))
OUTPUT_FILE="$CHANGELOG_DIR/$CODE.txt"
# Skip if file already exists
if [ -f "$OUTPUT_FILE" ]; then
continue
fi
# Extract changelog content for this version
CHANGELOG_CONTENT=$(awk -v version="[$VERSION]" '
/^## \[/ {
if (found) exit
if ($0 ~ "\\[\\[" version "\\]\\]") {
found=1
next
}
}
found && /^### / { subsection=1 }
found { print }
' "$CHANGELOG_FILE" | sed '1d;/^$/d' | head -n -1)
echo "$CHANGELOG_CONTENT" > "$OUTPUT_FILE"
echo "✓ Created $OUTPUT_FILE"
done <<< "$VERSIONS"
echo ""
echo "Done! Build and test the app before committing."