Skip to content

Merge pull request #9 from 3o14-com/iac #9

Merge pull request #9 from 3o14-com/iac

Merge pull request #9 from 3o14-com/iac #9

Workflow file for this run

name: Android APK Build
on:
push:
branches:
- main
permissions:
contents: write
jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
node: [18.x]
steps:
- name: πŸ— Checkout repository
uses: actions/checkout@v3
- name: πŸ— Setup Node
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node }}
cache: npm
cache-dependency-path: 3o14/package-lock.json
- name: πŸ— Setup Expo and EAS
uses: expo/expo-github-action@v7
with:
token: ${{ secrets.EXPO_TOKEN }}
expo-version: latest
eas-version: latest
- name: πŸ“¦ Install dependencies
run: npm install
working-directory: 3o14
- name: πŸ— Setup Java 17
uses: actions/setup-java@v3
with:
distribution: 'temurin'
java-version: '17'
# βœ… Decode and Save Keystore Securely
- name: πŸ›‘οΈ Decode and Prepare Keystore
run: |
mkdir -p 3o14/android/keystores
echo "${{ secrets.ANDROID_KEYSTORE_BASE64 }}" | base64 -d > 3o14/android/keystores/release.keystore
# βœ… Generate credentials.json with Secrets
- name: πŸ›‘οΈ Generate credentials.json
run: |
echo '{
"android": {
"keystore": {
"keystorePath": "android/keystores/release.keystore",
"keystorePassword": "${{ secrets.ANDROID_KEYSTORE_PASSWORD }}",
"keyAlias": "${{ secrets.ANDROID_KEY_ALIAS }}",
"keyPassword": "${{ secrets.ANDROID_KEY_PASSWORD }}"
}
}
}' > 3o14/credentials.json
- name: πŸ— Extract Version from app.json
id: get_version
run: echo "version=$(jq -r '.expo.version' 3o14/app.json)" >> $GITHUB_ENV
- name: πŸ‘· Build APK
run: |
eas build --local \
--non-interactive \
--output=./3o14.apk \
--platform=android \
--profile=production
working-directory: 3o14
- name: πŸš€ Upload APK to GitHub Releases
uses: ncipollo/release-action@v1
with:
artifacts: 3o14/3o14.apk
tag: v${{ env.version }}
name: 3o14 v${{ env.version }}
body: "Automated build for version ${{ env.version }}"
token: ${{ secrets.GITHUB_TOKEN }}
- name: βœ… Clean up build artifacts and credentials
run: |
rm -rf 3o14/3o14.apk
rm -rf 3o14/android/keystores/release.keystore
rm -rf 3o14/credentials.json