ci-cd #14
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Android CI/CD | |
on: | |
push: | |
branches: | |
- master | |
pull_request: | |
branches: | |
- master | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v2 | |
- name: Set up JDK 17 | |
uses: actions/setup-java@v2 | |
with: | |
java-version: '17' | |
- name: Set up Android SDK | |
uses: android-actions/setup-android@v2 | |
with: | |
sdk-version: '34.0.0' | |
- name: Build APK | |
run: ./gradlew assembleRelease | |
- name: Upload APK as artifact | |
uses: actions/upload-artifact@v3 | |
with: | |
name: app-release-apk | |
path: app/build/outputs/apk/release/app-release.apk | |
# Step 6: Upload APK to GitHub Release | |
- name: Upload APK to GitHub Release | |
uses: ncipollo/release-action@v1 | |
with: | |
artifacts: app/build/outputs/apk/release/app-release.apk | |
token: ${{ secrets.GITHUB_TOKEN }} | |
tag: ${{ github.ref_name }} | |
name: Release ${{ github.ref_name }} | |
body: | | |
🚀 New release is available! | |
- **Version**: ${{ github.ref_name }} | |
- **APK File**: Attached below. |