This commit is contained in:
@@ -22,26 +22,27 @@ jobs:
|
|||||||
java-version: 17
|
java-version: 17
|
||||||
|
|
||||||
- name: Extract versionName
|
- name: Extract versionName
|
||||||
id: version
|
|
||||||
run: |
|
run: |
|
||||||
VERSION=$(grep -oP 'versionName\s+"[^"]+"' app/build.gradle | cut -d'"' -f2)
|
VERSION=$(grep -oP 'versionName\s+"[^"]+"' app/build.gradle | cut -d'"' -f2)
|
||||||
echo "version=$VERSION" >> $GITEA_OUTPUT
|
echo $VERSION > version.txt
|
||||||
echo "Detected version: $VERSION"
|
echo "Detected version: $VERSION"
|
||||||
|
|
||||||
- name: Check if tag exists
|
- name: Check if tag exists
|
||||||
id: tagcheck
|
|
||||||
run: |
|
run: |
|
||||||
if git rev-parse "${{ steps.version.outputs.version }}" >/dev/null 2>&1; then
|
VERSION=$(cat version.txt)
|
||||||
echo "exists=true" >> $GITEA_OUTPUT
|
if git rev-parse "$VERSION" >/dev/null 2>&1; then
|
||||||
|
echo "exists=true" > tag_exists.txt
|
||||||
else
|
else
|
||||||
echo "exists=false" >> $GITEA_OUTPUT
|
echo "exists=false" > tag_exists.txt
|
||||||
fi
|
fi
|
||||||
|
|
||||||
- name: Stop if version already released
|
- name: Stop if version already released
|
||||||
if: steps.tagcheck.outputs.exists == 'true'
|
|
||||||
run: |
|
run: |
|
||||||
echo "Version already released, skipping."
|
EXISTS=$(cat tag_exists.txt)
|
||||||
exit 0
|
if [ "$EXISTS" = "true" ]; then
|
||||||
|
echo "Version already released, skipping."
|
||||||
|
exit 0
|
||||||
|
fi
|
||||||
|
|
||||||
- name: Decode keystore
|
- name: Decode keystore
|
||||||
run: |
|
run: |
|
||||||
@@ -50,12 +51,25 @@ jobs:
|
|||||||
- name: Make Gradlew executable
|
- name: Make Gradlew executable
|
||||||
run: chmod +x ./gradlew
|
run: chmod +x ./gradlew
|
||||||
|
|
||||||
|
- name: Set up Android SDK
|
||||||
|
run: |
|
||||||
|
mkdir -p $HOME/Android/sdk
|
||||||
|
wget https://dl.google.com/android/repository/commandlinetools-linux-9477386_latest.zip -O cmdline-tools.zip
|
||||||
|
unzip cmdline-tools.zip -d $HOME/Android/cmdline-tools
|
||||||
|
yes | $HOME/Android/cmdline-tools/cmdline-tools/bin/sdkmanager --sdk_root=$HOME/Android/sdk "platform-tools" "platforms;android-34" "build-tools;34.0.0"
|
||||||
|
|
||||||
|
- name: Set environment variables
|
||||||
|
run: |
|
||||||
|
echo "ANDROID_HOME=$HOME/Android/sdk" >> $GITHUB_ENV
|
||||||
|
echo "PATH=$HOME/Android/sdk/platform-tools:$PATH" >> $GITHUB_ENV
|
||||||
|
|
||||||
- name: Build Release APK
|
- name: Build Release APK
|
||||||
env:
|
env:
|
||||||
KEYSTORE_PASSWORD: ${{ secrets.KEYSTORE_PASSWORD }}
|
KEYSTORE_PASSWORD: ${{ secrets.KEYSTORE_PASSWORD }}
|
||||||
KEY_ALIAS: ${{ secrets.KEY_ALIAS }}
|
KEY_ALIAS: ${{ secrets.KEY_ALIAS }}
|
||||||
KEY_PASSWORD: ${{ secrets.KEY_PASSWORD }}
|
KEY_PASSWORD: ${{ secrets.KEY_PASSWORD }}
|
||||||
run: |
|
run: |
|
||||||
|
VERSION=$(cat version.txt)
|
||||||
./gradlew assembleRelease \
|
./gradlew assembleRelease \
|
||||||
-Pandroid.injected.signing.store.file=release.keystore \
|
-Pandroid.injected.signing.store.file=release.keystore \
|
||||||
-Pandroid.injected.signing.store.password=$KEYSTORE_PASSWORD \
|
-Pandroid.injected.signing.store.password=$KEYSTORE_PASSWORD \
|
||||||
@@ -64,8 +78,9 @@ jobs:
|
|||||||
|
|
||||||
- name: Create git tag
|
- name: Create git tag
|
||||||
run: |
|
run: |
|
||||||
git tag ${{ steps.version.outputs.version }}
|
VERSION=$(cat version.txt)
|
||||||
git push origin ${{ steps.version.outputs.version }}
|
git tag $VERSION
|
||||||
|
git push origin $VERSION
|
||||||
|
|
||||||
- name: Create Gitea Release
|
- name: Create Gitea Release
|
||||||
uses: https://git.daemonlord.ru/actions/gitea-release-action@v1
|
uses: https://git.daemonlord.ru/actions/gitea-release-action@v1
|
||||||
@@ -73,9 +88,9 @@ jobs:
|
|||||||
server_url: https://git.daemonlord.ru
|
server_url: https://git.daemonlord.ru
|
||||||
repository: ${{ gitea.repository }}
|
repository: ${{ gitea.repository }}
|
||||||
token: ${{ secrets.API_TOKEN }}
|
token: ${{ secrets.API_TOKEN }}
|
||||||
tag_name: ${{ steps.version.outputs.version }}
|
tag_name: $(cat version.txt)
|
||||||
name: Release ${{ steps.version.outputs.version }}
|
name: Release $(cat version.txt)
|
||||||
body: |
|
body: |
|
||||||
Android release ${{ steps.version.outputs.version }}
|
Android release $(cat version.txt)
|
||||||
files: |
|
files: |
|
||||||
app/build/outputs/apk/release/*.apk
|
app/build/outputs/apk/release/*.apk
|
||||||
|
|||||||
Reference in New Issue
Block a user