feat: set up signed release pipeline for Forgejo
All checks were successful
Release APK / build (push) Successful in 3m17s
All checks were successful
Release APK / build (push) Successful in 3m17s
Adds env-var-driven release signing, fastlane metadata for F-Droid/Obtainium listings, and a tag-triggered .forgejo workflow that builds, signs, and publishes the APK as a Forgejo release. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
parent
3762a82bab
commit
2519a3a337
9 changed files with 84 additions and 3 deletions
57
.forgejo/workflows/release.yml
Normal file
57
.forgejo/workflows/release.yml
Normal file
|
|
@ -0,0 +1,57 @@
|
|||
name: Release APK
|
||||
|
||||
on:
|
||||
push:
|
||||
tags: ["v*"]
|
||||
|
||||
jobs:
|
||||
build:
|
||||
runs-on: android
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
|
||||
- name: Extract version
|
||||
run: |
|
||||
VERSION=$(grep '^version:' pubspec.yaml | sed 's/version: //')
|
||||
echo "VERSION_CODE=$(echo "$VERSION" | grep -oP '(?<=\+)\d+')" >> $GITHUB_ENV
|
||||
echo "VERSION_NAME=$(echo "$VERSION" | grep -oP '^[^+]+')" >> $GITHUB_ENV
|
||||
|
||||
- name: Decode keystore
|
||||
run: |
|
||||
echo "${{ secrets.KEYSTORE_BASE64 }}" | base64 -d > android/app/release.jks
|
||||
echo "KEYSTORE_PATH=$GITHUB_WORKSPACE/android/app/release.jks" >> $GITHUB_ENV
|
||||
|
||||
- name: Build release APK
|
||||
env:
|
||||
STORE_PASSWORD: ${{ secrets.STORE_PASSWORD }}
|
||||
KEY_ALIAS: ${{ secrets.KEY_ALIAS }}
|
||||
KEY_PASSWORD: ${{ secrets.KEY_PASSWORD }}
|
||||
run: |
|
||||
env -u GITHUB_TOKEN -u GH_TOKEN -u JAVA_HOME \
|
||||
devbox run -- flutter build apk --release
|
||||
|
||||
- name: Create release and upload APK
|
||||
env:
|
||||
FORGEJO_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
run: |
|
||||
APK="muzzlevelocity-${{ env.VERSION_NAME }}.apk"
|
||||
cp build/app/outputs/flutter-apk/app-release.apk "$APK"
|
||||
|
||||
BODY=$(python3 -c "
|
||||
import json
|
||||
print(json.dumps(open('fastlane/metadata/android/en-US/changelogs/${{ env.VERSION_CODE }}.txt').read().strip()))
|
||||
")
|
||||
|
||||
RELEASE_ID=$(curl -sf -X POST \
|
||||
-H "Authorization: token $FORGEJO_TOKEN" \
|
||||
-H "Content-Type: application/json" \
|
||||
"$GITHUB_SERVER_URL/api/v1/repos/$GITHUB_REPOSITORY/releases" \
|
||||
-d "{\"tag_name\":\"$GITHUB_REF_NAME\",\"name\":\"$GITHUB_REF_NAME\",\"body\":$BODY}" \
|
||||
| python3 -c 'import sys,json; print(json.load(sys.stdin)["id"])')
|
||||
|
||||
curl -sf -X POST \
|
||||
-H "Authorization: token $FORGEJO_TOKEN" \
|
||||
-H "Content-Type: application/vnd.android.package-archive" \
|
||||
"$GITHUB_SERVER_URL/api/v1/repos/$GITHUB_REPOSITORY/releases/$RELEASE_ID/assets?name=$APK" \
|
||||
--data-binary @"$APK"
|
||||
4
.gitignore
vendored
4
.gitignore
vendored
|
|
@ -47,3 +47,7 @@ app.*.map.json
|
|||
# devbox
|
||||
.devbox/
|
||||
nix-android-sdk/flake.lock
|
||||
|
||||
# Release signing (see RELEASE.md)
|
||||
**/*.jks
|
||||
key.properties
|
||||
|
|
|
|||
|
|
@ -33,11 +33,19 @@ android {
|
|||
targetSdkVersion 34
|
||||
}
|
||||
|
||||
signingConfigs {
|
||||
release {
|
||||
storeFile = System.getenv("KEYSTORE_PATH") ? file(System.getenv("KEYSTORE_PATH")) : null
|
||||
storePassword = System.getenv("STORE_PASSWORD")
|
||||
keyAlias = System.getenv("KEY_ALIAS")
|
||||
keyPassword = System.getenv("KEY_PASSWORD")
|
||||
}
|
||||
}
|
||||
|
||||
buildTypes {
|
||||
release {
|
||||
// TODO: Add your own signing config for the release build.
|
||||
// Signing with the debug keys for now, so `flutter run --release` works.
|
||||
signingConfig = signingConfigs.debug
|
||||
// Falls back to the debug keys locally, so `flutter run --release` keeps working.
|
||||
signingConfig = System.getenv("KEYSTORE_PATH") ? signingConfigs.release : signingConfigs.debug
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
1
fastlane/Fastfile
Normal file
1
fastlane/Fastfile
Normal file
|
|
@ -0,0 +1 @@
|
|||
default_platform(:android)
|
||||
1
fastlane/metadata/android/en-US/changelogs/2.txt
Normal file
1
fastlane/metadata/android/en-US/changelogs/2.txt
Normal file
|
|
@ -0,0 +1 @@
|
|||
Built-in Markdown editor, keyboard shortcuts, and D-pad navigation for phones.
|
||||
8
fastlane/metadata/android/en-US/full_description.txt
Normal file
8
fastlane/metadata/android/en-US/full_description.txt
Normal file
|
|
@ -0,0 +1,8 @@
|
|||
A fast and minimalist note-taking app inspired by Notational Velocity and Terminal Velocity. Notes are plain Markdown files in a folder you choose, so you can sync or edit them with other tools.
|
||||
|
||||
- One search bar to filter notes by title, content, and #tags, +projects, or @contexts, and to create a note by pressing Enter.
|
||||
- Notes open read-only with Markdown highlighting, and jump to the search match. Switch to editing with one tap.
|
||||
- Editing helps with Markdown: wrapping selections, continuing lists, and keeping indentation.
|
||||
- Keyboard shortcuts on desktop and D-pad navigation on phones.
|
||||
|
||||
The in-app Help page describes every feature.
|
||||
BIN
fastlane/metadata/android/en-US/images/icon.png
Normal file
BIN
fastlane/metadata/android/en-US/images/icon.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 8.1 KiB |
1
fastlane/metadata/android/en-US/short_description.txt
Normal file
1
fastlane/metadata/android/en-US/short_description.txt
Normal file
|
|
@ -0,0 +1 @@
|
|||
A fast, minimalist note-taking app inspired by Notational Velocity.
|
||||
1
fastlane/metadata/android/en-US/title.txt
Normal file
1
fastlane/metadata/android/en-US/title.txt
Normal file
|
|
@ -0,0 +1 @@
|
|||
Muzzle Velocity
|
||||
Loading…
Add table
Add a link
Reference in a new issue