Skip to content

Auto release (#4)

Auto release (#4) #68

Workflow file for this run

name: Android CI
on:
workflow_dispatch:
push:
branches: [master, main]
paths-ignore: ['*.md']
pull_request:
branches: [master, main]
paths-ignore: ['*.md']
release:
types: [published]
jobs:
validation:
name: Gradle Validation
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: gradle/actions/wrapper-validation@v3
build:
needs: validation
if: ${{ needs.validation.result == 'success' }}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: local-build-action
uses: ./.github/actions/build-android
with:
KEYSTORE_BASE_64: ${{ secrets.KEYSTORE_BASE_64 }}
RELEASE_KEYSTORE_ALIAS: ${{ secrets.RELEASE_KEYSTORE_ALIAS }}
RELEASE_KEYSTORE_PASSWORD: ${{ secrets.RELEASE_KEYSTORE_PASSWORD }}
RELEASE_KEY_PASSWORD: ${{ secrets.RELEASE_KEY_PASSWORD }}
- name: Determine Last Tag
id: last_tag
uses: 'WyriHaximus/github-action-get-previous-tag@v1'
with:
fallback: 1.0.0
- name: Get Current Version
id: current_version
shell: bash
run: |
echo "version=$(./gradlew :app:properties | grep archivesBaseName | cut -d "_" -f 2)" >> $GITHUB_OUTPUT
- shell: bash
if: ${{ steps.current_version.outputs.version != steps.last_tag.outputs.tag }}
run: echo "new_version=${{ steps.current_version.outputs.version}}" >> $GITHUB_OUTPUT
- name: Compare Versions and Trigger Release
if: ${{ steps.current_version.outputs.version != steps.last_tag.outputs.tag }}
uses: ncipollo/release-action@v1
with:
name: 'WiFi List ${{steps.current_version.outputs.version}}'
tag: '${{steps.current_version.outputs.version}}'
generateReleaseNotes: true
upload:
name: Upload release
runs-on: ubuntu-latest
needs: build
if: ${{ github.event_name == 'release' && needs.build.result == 'success' || needs.build.outputs.new_version }}
steps:
- uses: actions/download-artifact@v4
- name: Build debug apk
run: mv **/*.apk ./${{ github.event.repository.name }}-${{ github.event.release.tag_name }}.apk
- uses: termux/[email protected]
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: ./${{ github.event.repository.name }}-${{ github.event.release.tag_name }}.apk
tag: ${{ github.event.release.tag_name }}
checksums: sha256,sha512,md5