-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
40 additions
and
49 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,72 +1,63 @@ | ||
name: Android CI | ||
me: 'Android CI' | ||
description: 'Build, test, and release Android apps' | ||
|
||
|
||
on: | ||
push: | ||
branches: [main] | ||
inputs: | ||
body_release: | ||
default: "Aplikasi ini otomatis dirilis sesuai dengan Artefact" | ||
description: "Body Release" | ||
|
||
gradle_cmd: | ||
default: bash ./gradlew assembleDebug --stacktrace | ||
description: "Build Apk with ${{gradle_cmd.default}}" | ||
|
||
env: | ||
TAG: Release | ||
PROJECT_NAME: ${{github.repository}} | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
FILE_OUTPUT: ./app/build/outputs/apk/debug/app-debug.apk | ||
|
||
|
||
jobs: | ||
using: composite | ||
build: | ||
runs-on: ubuntu-latest | ||
permissions: | ||
contents: write | ||
steps: | ||
description: 'Gradle command to execute' | ||
required: true | ||
default: 'assembleDebug' | ||
tag: | ||
description: 'Release tag prefix' | ||
required: true | ||
default: 'Release' | ||
body_release: | ||
description: 'Release body' | ||
required: true | ||
default: 'Aplikasi ini otomatis dirilis.' | ||
file_output: | ||
description: 'Path to APK file' | ||
required: true | ||
default: './app/build/outputs/apk/debug/app-debug.apk' | ||
|
||
runs: | ||
using: 'composite' | ||
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
- name: Setting JDK 17 | ||
uses: actions/setup-java@v3 | ||
with: | ||
java-version: '17' | ||
distribution: 'temurin' | ||
cache: gradle | ||
- name: memberikan Perizinan gradlew | ||
|
||
- name: Memberikan Perizinan gradlew | ||
run: chmod +x gradlew | ||
|
||
- name: ${{inputs.gradle.gradle_cmd.description}} | ||
run: ${{inputs.gradle.gradle_cmd}} | ||
|
||
- name: Build APK | ||
run: bash ./gradlew ${{ inputs.gradle_cmd }} --stacktrace | ||
|
||
- name: Upload Ke dalam Artifact | ||
- name: Upload APK to Artifacts | ||
uses: actions/upload-artifact@v3.1.3 | ||
with: | ||
name: ${{env.PROJECT_NAME}} | ||
path: ${{env.FILE_OUTPUT}} | ||
name: ${{ github.repository }} | ||
path: ${{ inputs.file_output }} | ||
|
||
- name: Pembuatan Membuat Tag Rilis | ||
- name: Create Release | ||
id: release-id | ||
uses: actions/create-release@v1 | ||
with: | ||
tag_name: "${{env.TAG}}-${{github.run_number}}" | ||
release_name: ${{env.PROJECT_NAME}} | ||
body: ${{inputs.body_release}} | ||
draft: false | ||
prerelease: false | ||
- name: Upload Release | ||
tag_name: "${{ inputs.tag }}-${{ github.run_number }}" | ||
release_name: ${{ github.repository }} | ||
body: ${{ inputs.body_release }} | ||
draft: false | ||
prerelease: false | ||
|
||
- name: Upload Release Asset | ||
needs: release-id | ||
uses: actions/upload-release-asset@v1 | ||
with: | ||
upload_url: ${{steps.release-id.outputs.upload_url}} | ||
asset_path: ${{env.FILE_OUTPUT}} | ||
asset_name: ${{env.PROJECT_NAME}}-${{github.run_number}}.apk | ||
upload_url: ${{ steps.release-id.outputs.upload_url }} | ||
asset_path: ${{ inputs.file_output }} | ||
asset_name: ${{ github.repository }}-${{ github.run_number }}.apk | ||
asset_content_type: application/vnd.android.package-archive | ||
|
||
|
||
|