Neues Appicon und Release-Script
This commit is contained in:
parent
8d472f8378
commit
5153f228e1
Binary file not shown.
|
Before Width: | Height: | Size: 1.4 KiB After Width: | Height: | Size: 76 KiB |
|
|
@ -16,7 +16,7 @@ publish_to: 'none' # Remove this line if you wish to publish to pub.dev
|
||||||
# https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html
|
# https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html
|
||||||
# In Windows, build-name is used as the major, minor, and patch parts
|
# In Windows, build-name is used as the major, minor, and patch parts
|
||||||
# of the product and file versions while build-number is used as the build suffix.
|
# of the product and file versions while build-number is used as the build suffix.
|
||||||
version: 1.0.0+1
|
version: 0.9.3
|
||||||
|
|
||||||
environment:
|
environment:
|
||||||
sdk: ^3.10.1
|
sdk: ^3.10.1
|
||||||
|
|
|
||||||
65
release.sh
65
release.sh
|
|
@ -1,8 +1,71 @@
|
||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
set -euo pipefail
|
||||||
flutter clean
|
flutter clean
|
||||||
flutter pub get
|
flutter pub get
|
||||||
flutter build apk
|
flutter build apk --release
|
||||||
cp build/app/outputs/flutter-apk/app-release.apk ./release/eggtimer.apk
|
cp build/app/outputs/flutter-apk/app-release.apk ./release/eggtimer.apk
|
||||||
echo "APK built and copied to ./release/eggtimer.apk"
|
echo "APK built and copied to ./release/eggtimer.apk"
|
||||||
|
GITEA_URL="https://git.ude-consult.de"
|
||||||
|
GITEA_TOKEN="6ea286299e8e081d9923d5deea2fbd91ad83dc8e"
|
||||||
|
OWNER="Arnold"
|
||||||
|
REPO="EggTimer"
|
||||||
|
APK_PATH="release/eggtimer.apk"
|
||||||
|
|
||||||
|
PUBSPEC="pubspec.yaml"
|
||||||
|
|
||||||
|
line=$(grep "^version:" $PUBSPEC | awk '{print $2}')
|
||||||
|
before_plus="${line%%+*}" # 1.0.3
|
||||||
|
build="${line##*+}"
|
||||||
|
|
||||||
|
major=$(echo $before_plus | cut -d. -f1)
|
||||||
|
minor=$(echo $before_plus | cut -d. -f2)
|
||||||
|
patch=$(echo $before_plus | cut -d. -f3)
|
||||||
|
|
||||||
|
patch=$((patch + 1))
|
||||||
|
build=$((build + 1))
|
||||||
|
|
||||||
|
new="${major}.${minor}.${patch}+${build}"
|
||||||
|
|
||||||
|
echo "Neue Version: $new"
|
||||||
|
|
||||||
|
sed -i "s/^version: .*/version: ${new}/" "$PUBSPEC"
|
||||||
|
|
||||||
|
# Version z.B. aus Datei oder Argument
|
||||||
|
VERSION_TAG=$(grep "^version:" pubspec.yaml | awk '{print $2}')
|
||||||
|
|
||||||
|
RELEASE_TITLE="EggTimer ${VERSION_TAG}"
|
||||||
|
RELEASE_BODY="Automatisch erstelltes Release ${VERSION_TAG}."
|
||||||
|
|
||||||
|
# 1. Release anlegen
|
||||||
|
create_release_response=$(curl -sS -X POST \
|
||||||
|
-H "Content-Type: application/json" \
|
||||||
|
-H "Authorization: token ${GITEA_TOKEN}" \
|
||||||
|
"${GITEA_URL}/api/v1/repos/${OWNER}/${REPO}/releases" \
|
||||||
|
-d "{
|
||||||
|
\"tag_name\": \"${VERSION_TAG}\",
|
||||||
|
\"target\": \"main\",
|
||||||
|
\"title\": \"${RELEASE_TITLE}\",
|
||||||
|
\"note\": \"${RELEASE_BODY}\",
|
||||||
|
\"draft\": false,
|
||||||
|
\"prerelease\": false
|
||||||
|
}")
|
||||||
|
|
||||||
|
release_id=$(echo "$create_release_response" | jq -r '.id')
|
||||||
|
|
||||||
|
if [[ "$release_id" == "null" || -z "$release_id" ]]; then
|
||||||
|
echo "Fehler: Konnte Release-ID nicht auslesen."
|
||||||
|
echo "$create_release_response"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
echo "Release ${VERSION_TAG} erstellt, ID=${release_id}"
|
||||||
|
|
||||||
|
# 2. APK hochladen
|
||||||
|
curl -sS -X POST \
|
||||||
|
-H "Authorization: token ${GITEA_TOKEN}" \
|
||||||
|
-F "attachment=@${APK_PATH};filename=eggtimer-${VERSION_TAG}.apk" \
|
||||||
|
"${GITEA_URL}/api/v1/repos/${OWNER}/${REPO}/releases/${release_id}/assets"
|
||||||
|
|
||||||
|
echo "APK hochgeladen."
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
Binary file not shown.
Loading…
Reference in New Issue