This commit is contained in:
@@ -0,0 +1,30 @@
|
|||||||
|
name: Auto Tag on Version Change
|
||||||
|
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
branches:
|
||||||
|
- main
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
check-version:
|
||||||
|
runs-on: docker-compose
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- name: Checkout source code
|
||||||
|
uses: actions/checkout@v4
|
||||||
|
with:
|
||||||
|
fetch-depth: 0
|
||||||
|
token: ${{ secrets.PAT_GITEA }}
|
||||||
|
|
||||||
|
- name: Create tag if version changed
|
||||||
|
run: |
|
||||||
|
VERSION=$(grep 'versionName = ' app/build.gradle.kts | sed 's/.*versionName = "\(.*\)".*/\1/')
|
||||||
|
echo "Current version: $VERSION"
|
||||||
|
|
||||||
|
if git tag -l | grep -q "^v${VERSION}$"; then
|
||||||
|
echo "Tag v${VERSION} already exists, skipping"
|
||||||
|
else
|
||||||
|
git tag "v${VERSION}"
|
||||||
|
git push origin "v${VERSION}"
|
||||||
|
echo "Created and pushed tag v${VERSION}"
|
||||||
|
fi
|
||||||
@@ -0,0 +1,38 @@
|
|||||||
|
name: Build and Release APK
|
||||||
|
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
tags:
|
||||||
|
- 'v*'
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
build:
|
||||||
|
runs-on: docker-compose
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- name: Checkout source code
|
||||||
|
uses: actions/checkout@v4
|
||||||
|
|
||||||
|
- name: Setup keystore and environment
|
||||||
|
run: |
|
||||||
|
echo "${{ secrets.KEYSTORE_BASE64 }}" | base64 -d > app/key.jks
|
||||||
|
echo "${{ secrets.DOTENV_BASE64 }}" | base64 -d > .build/release/.env
|
||||||
|
|
||||||
|
- name: Build APK
|
||||||
|
working-directory: .build/release
|
||||||
|
run: docker compose run --rm release
|
||||||
|
|
||||||
|
- name: Extract changelog
|
||||||
|
run: bash .build/release/extract-changelog.sh ${{ gitea.ref_name }}
|
||||||
|
|
||||||
|
- name: Create Gitea Release
|
||||||
|
env:
|
||||||
|
GITEA_SERVER_URL: ${{ gitea.server_url }}
|
||||||
|
GITEA_REPOSITORY: ${{ gitea.repository }}
|
||||||
|
GITEA_TOKEN: ${{ secrets.PAT_GITEA }}
|
||||||
|
run: |
|
||||||
|
bash .build/release/create-release.sh \
|
||||||
|
"${{ gitea.ref_name }}" \
|
||||||
|
"ISODroid ${{ gitea.ref_name }}" \
|
||||||
|
"release_notes.md" \
|
||||||
|
".build/release/release/ISODroid-${{ gitea.ref_name }}.apk"
|
||||||
Reference in New Issue
Block a user