build..release
This commit is contained in:
3
.build/release/.env.example
Normal file
3
.build/release/.env.example
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
KEYSTORE_PASSWORD=your_keystore_password_here
|
||||||
|
KEY_ALIAS=your_key_alias_here
|
||||||
|
KEY_PASSWORD=your_key_password_here
|
||||||
2
.build/release/.gitignore
vendored
Normal file
2
.build/release/.gitignore
vendored
Normal file
@@ -0,0 +1,2 @@
|
|||||||
|
.env
|
||||||
|
release/
|
||||||
11
.build/release/compose.yml
Normal file
11
.build/release/compose.yml
Normal file
@@ -0,0 +1,11 @@
|
|||||||
|
services:
|
||||||
|
release:
|
||||||
|
# image: git.shihaam.dev/dockerfiles/android-builder
|
||||||
|
image: git.shihaam.dev/dockerfiles/runners/gradle
|
||||||
|
hostname: isodroid
|
||||||
|
network_mode: host
|
||||||
|
env_file: .env
|
||||||
|
volumes:
|
||||||
|
- ./release:/release
|
||||||
|
- ../../:/source
|
||||||
|
- ./cache:/root/.gradle
|
||||||
40
.build/release/create-release.sh
Normal file
40
.build/release/create-release.sh
Normal file
@@ -0,0 +1,40 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
set -e
|
||||||
|
|
||||||
|
TAG="$1"
|
||||||
|
TITLE="$2"
|
||||||
|
NOTES_FILE="$3"
|
||||||
|
ASSET_PATH="$4"
|
||||||
|
|
||||||
|
API_URL="${GITEA_SERVER_URL}/api/v1/repos/${GITEA_REPOSITORY}/releases"
|
||||||
|
|
||||||
|
# Create release
|
||||||
|
RELEASE_RESPONSE=$(curl -s -X POST "$API_URL" \
|
||||||
|
-H "Authorization: token ${GITEA_TOKEN}" \
|
||||||
|
-H "Content-Type: application/json" \
|
||||||
|
-d "{
|
||||||
|
\"tag_name\": \"${TAG}\",
|
||||||
|
\"name\": \"${TITLE}\",
|
||||||
|
\"body\": $(jq -Rs . < "$NOTES_FILE")
|
||||||
|
}")
|
||||||
|
|
||||||
|
RELEASE_ID=$(echo "$RELEASE_RESPONSE" | jq -r '.id')
|
||||||
|
|
||||||
|
if [ "$RELEASE_ID" = "null" ] || [ -z "$RELEASE_ID" ]; then
|
||||||
|
echo "Failed to create release:"
|
||||||
|
echo "$RELEASE_RESPONSE"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
echo "Created release with ID: $RELEASE_ID"
|
||||||
|
|
||||||
|
# Upload asset
|
||||||
|
ASSET_NAME=$(basename "$ASSET_PATH")
|
||||||
|
UPLOAD_URL="${API_URL}/${RELEASE_ID}/assets?name=${ASSET_NAME}"
|
||||||
|
|
||||||
|
curl -s -X POST "$UPLOAD_URL" \
|
||||||
|
-H "Authorization: token ${GITEA_TOKEN}" \
|
||||||
|
-H "Content-Type: application/octet-stream" \
|
||||||
|
--data-binary "@${ASSET_PATH}"
|
||||||
|
|
||||||
|
echo "Uploaded asset: $ASSET_NAME"
|
||||||
17
.build/release/extract-changelog.sh
Normal file
17
.build/release/extract-changelog.sh
Normal file
@@ -0,0 +1,17 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
set -e
|
||||||
|
|
||||||
|
VERSION="${1#v}"
|
||||||
|
VERSION_CODE=$(grep 'versionCode = ' app/build.gradle.kts | sed 's/.*versionCode = \([0-9]*\).*/\1/')
|
||||||
|
FASTLANE_DIR="fastlane/metadata/android/en-US/changelogs"
|
||||||
|
|
||||||
|
mkdir -p "$FASTLANE_DIR"
|
||||||
|
|
||||||
|
awk -v ver="$VERSION" '
|
||||||
|
BEGIN { found=0 }
|
||||||
|
/^## \[/ {
|
||||||
|
if (found) exit
|
||||||
|
if ($0 ~ "\\[" ver "\\]") { found=1; next }
|
||||||
|
}
|
||||||
|
found { print }
|
||||||
|
' CHANGELOG.md | tee release_notes.md > "$FASTLANE_DIR/${VERSION_CODE}.txt"
|
||||||
Reference in New Issue
Block a user