Skip to content

Oke

Oke #17

Workflow file for this run

name: Android CI
on:
push:
branches: ["main"]
pull_request:
branches: [ "main" ]
jobs:
build:
runs-on: ubuntu-latest
permissions:
contents: write
env:
TAG: Release
PROJECT_NAME: ${{github.event.repository.name}}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
FILE_OUTPUT: ./app/build/outputs/apk/debug/app-debug.apk
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
run: chmod +x gradlew
- name: Build debug Apk
run: bash ./gradlew assembleDebug --stacktrace
- name: Upload Ke dalam Artifact
uses: actions/[email protected]
with:
name: ${{env.PROJECT_NAME}}
path: ${{env.FILE_OUTPUT}}
- name: Pembuatan Membuat Tag Rilis
id: release-id
uses: actions/create-release@v1
with:
tag_name: "${{env.TAG}}-${{github.run_number}}"
release_name: ${{env.PROJECT_NAME}}
body: "Aplikasi ini otomatis dirilis sesuai dengan Artefact"
draft: false
prerelease: false
- name: Upload Release
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
asset_content_type: application/vnd.android.package-archive