build android #21
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: | |
description: "version to release" | |
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: set env | |
env: | |
SUPABASE_URL: ${{ secrets.SUPABASE_URL }} | |
SUPABASE_ANON_KEY: ${{ secrets.SUPABASE_ANON_KEY }} | |
run: | | |
sed -i "s|process.env.EXPO_PUBLIC_SUPABASE_URL as string;|\"$SUPABASE_URL\";|g" lib/supabase.ts; | |
sed -i "s|process.env.EXPO_PUBLIC_SUPABASE_ANON_KEY as string;|\"$SUPABASE_ANON_KEY\";|g" lib/supabase.ts; | |
- 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: "TrackMyTransits ${{ 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 }} |