diff --git a/.github/workflows/android.yml b/.github/workflows/android.yml index 50aa1210..98eb0445 100644 --- a/.github/workflows/android.yml +++ b/.github/workflows/android.yml @@ -18,48 +18,39 @@ jobs: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v3 - - name: Set current date as env variable - run: echo "date_today=$(date +'%Y-%m-%d')" >> $GITHUB_ENV + - name: Set current date as env variable + run: echo "date_today=$(date +'%Y-%m-%d')" >> $GITHUB_ENV - - name: Set repository name as env variable - run: echo "repository_name=$(echo '${{ github.repository }}' | awk -F '/' '{print $2}')" >> $GITHUB_ENV + - name: Set repository name as env variable + run: echo "repository_name=$(echo '${{ github.repository }}' | awk -F '/' '{print $2}')" >> $GITHUB_ENV - - name: Set up JDK - uses: actions/setup-java@v3 - with: - distribution: 'zulu' # See 'Supported distributions' for available options - java-version: '17' - cache: 'gradle' + - name: Set up JDK + uses: actions/setup-java@v3 + with: + distribution: 'zulu' # See 'Supported distributions' for available options + java-version: '17' + cache: 'gradle' - - name: Get app version - id: get_version - run: echo "version_name=$(grep -m1 "versionName" app/build.gradle | awk '{print $2}' | tr -d '\''"\'')" >> $GITHUB_ENV + - name: Get app version + id: get_version + run: echo "VERSION_NAME=$(grep -m1 "versionName" app/build.gradle | awk '{print $2}' | tr -d \''"\')" >> $GITHUB_ENV - - name: Change wrapper permissions - run: chmod +x ./gradlew + - name: Change wrapper permissions + run: chmod +x ./gradlew - - name: Build Debug APK - run: ./gradlew assembleDebug + - name: Build debug APK + run: ./gradlew assembleDebug - - name: Create Release - id: create_release - uses: actions/create-release@v1 - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - with: - tag_name: v${{ steps.get_version.outputs.version_name }} - release_name: Release ${{ github.ref }} - draft: false - prerelease: false - - - name: Upload Debug APK - uses: actions/upload-release-asset@v1 - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - with: - upload_url: ${{ steps.create_release.outputs.upload_url }} - asset_path: app/build/outputs/apk/debug/*.apk - asset_name: debug-${{ env.repository_name }}-${{ env.date_today }}.apk - asset_content_type: application/vnd.android.package-archive + - name: Create release + uses: softprops/action-gh-release@v2 + if: startsWith(github.ref, 'refs/tags/') + with: + files: | + app/build/outputs/apk/debug/*.apk + name: Release ${{ github.ref }} + body: | + ## Changes + - new version: ${{ env.VERSION_NAME }} + - date: ${{ env.date_today }}