Skip to content

stability

stability #1

Workflow file for this run

name: Android CI
on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]
permissions:
contents: write
packages: write
deployments: write
issues: write
pull-requests: write
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up JDK 17
uses: actions/setup-java@v4
with:
java-version: '17'
distribution: 'temurin'
cache: gradle
- name: Grant execute permission for gradlew
run: chmod +x gradlew
- name: Replace secrets in Secrets.kt
run: |
cp app/src/main/java/luph/vulcanizerv3/updates/data/sectrets.kt.tmp app/src/main/java/luph/vulcanizerv3/updates/data/sectrets.kt
sed -i "s|val TELEGRAM_BOT_API = \"\"|val TELEGRAM_BOT_API = \"${{ secrets.TELEGRAM_BOT_TOKEN }}\"|" app/src/main/java/luph/vulcanizerv3/updates/data/sectrets.kt
sed -i "s|val TELEGRAM_FEEDBACK_CHANNEL = \"\"|val TELEGRAM_FEEDBACK_CHANNEL = \"${{ secrets.TELEGRAM_FEEDBACK_CHANNEL }}\"|" app/src/main/java/luph/vulcanizerv3/updates/data/sectrets.kt
- name: Build with Gradle (Debug)
run: ./gradlew assembleDebug
- name: Get commit messages
id: get_commit_messages
run: |
echo "COMMIT_MESSAGES<<EOF" >> $GITHUB_ENV
git log --format="- %s" $(git describe --tags --abbrev=0)..HEAD >> $GITHUB_ENV
echo "EOF" >> $GITHUB_ENV
- name: Get version from build.gradle
id: get_version
run: |
VERSION=$(grep 'version ' app/build.gradle | awk '{print $2}' | tr -d "'\"")
echo "VERSION=$VERSION" >> $GITHUB_ENV
- name: Create release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
tag: ${{ env.VERSION }}
run: |
gh release create "$tag" \
--repo="$GITHUB_REPOSITORY" \
--title="${GITHUB_REPOSITORY#*/} ${tag}" \
--body="${{ env.COMMIT_MESSAGES }}" \
app/build/outputs/apk/debug/app-debug.apk \
--generate-notes