Skip to content

Commit

Permalink
Update android-ci-cd.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
MRfantastic3DGamer authored Dec 23, 2024
1 parent dc26e81 commit 528e531
Showing 1 changed file with 23 additions and 34 deletions.
57 changes: 23 additions & 34 deletions .github/workflows/android-ci-cd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,43 +7,32 @@ on:
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.
- uses: actions/checkout@v1
- name: set up JDK 1.8
uses: actions/setup-java@v1
with:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
java-version: 1.8
- name: "Permission to gradle File"
run: chmod +x gradlew
- name: Build with Gradle
run: ./gradlew assemble
- name: Commit files
run: |
echo ${{ github.ref }}
git add .
git config --local user.email "test@test.com"
git config --local user.name "test123"
git commit -m "ci: Automated build push" -a | exit 0
- name: Push changes
if: github.ref == 'refs/heads/master'
uses: ad-m/github-push-action@master
with:
github_token: ${{ secrets.GITHUB_TOKEN }}

0 comments on commit 528e531

Please sign in to comment.