build android #5
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: build android | |
on: | |
workflow_dispatch: | |
inputs: | |
version: | |
required: true | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
permissions: | |
contents: write | |
steps: | |
- name: checkout | |
uses: actions/checkout@v4 | |
- name: setup java | |
uses: actions/setup-java@v4 | |
with: | |
distribution: 'temurin' | |
java-version: 17 | |
- name: cache | |
uses: actions/cache@v4 | |
with: | |
path: | | |
~/.gradle/caches | |
~/.gradle/wrapper | |
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }} | |
restore-keys: | | |
${{ runner.os }}-gradle- | |
- name: setup pnpm | |
uses: pnpm/action-setup@v3 | |
- name: install packages | |
run: pnpm install | |
- name: prebuild | |
run: pnpx expo prebuild --platform android | |
- name: build | |
run: cd android && ./gradlew assembleRelease | |
- name: release | |
uses: ncipollo/release-action@v1 | |
with: | |
allowUpdates: true | |
name: "ShivShakti Transit ${{ github.event.inputs.version }}" | |
body: "Check the assets for the APK." | |
artifacts: "android/app/build/outputs/apk/release/*.apk" | |
token: ${{ secrets.GITHUB_TOKEN }} | |
tag: ${{ github.event.inputs.version }} | |