diff --git a/.github/workflows/auto_release.yml b/.github/workflows/auto_release.yml index 31d23a4..fe69d10 100644 --- a/.github/workflows/auto_release.yml +++ b/.github/workflows/auto_release.yml @@ -12,19 +12,45 @@ jobs: steps: - uses: actions/checkout@v2.3.4 - - name: set up JDK 11 + - name: Set up JDK 11 uses: actions/setup-java@v2.2.0 with: java-version: '11' distribution: 'adopt' cache: gradle + + - name: Set up Android SDK + uses: android-actions/setup-android@v2 + + - name: Add API_URL + run: echo "API_URL=\""${{ secrets.API_URL }}"\"" >> ./local.properties - name: Grant execute permission for gradlew run: chmod +x gradlew + + - name: Build with Gradle + run: ./gradlew build + + - name: Build release APK + id: buildRelease + run: bash ./gradlew assembleRelease --stacktrace - - name: Test with Gradle - run: ./gradlew --info test + - name: Sign APK + id: sign + uses: r0adkll/sign-android-release@v1 + with: + releaseDirectory: app/build/outputs/apk/release + signingKeyBase64: ${{ secrets.SIGNING_KEY }} + alias: ${{ secrets.ALIAS }} + keyStorePassword: ${{ secrets.KEY_STORE_PASSWORD }} + keyPassword: ${{ secrets.KEY_PASSWORD }} + - name: Upload APK + uses: actions/upload-artifact@v3 + with: + name: app + path: app/build/outputs/apk/release/app-release-unsigned-signed.apk + - name: Get version from tag id: tag_name run: | @@ -48,4 +74,14 @@ jobs: release_name: Release ${{ github.ref }} body: ${{ steps.changelog_reader.outputs.changes }} draft: false - prerelease: false \ No newline at end of file + prerelease: false + + - name: Upload Release Asset + 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/release/app-release-unsigned-signed.apk + asset_name: App.apk + asset_content_type: application/zip \ No newline at end of file