Skip to content

Commit

Permalink
build android apks (#71)
Browse files Browse the repository at this point in the history
* change projectId to match new alby-go project in eas

* add initial build

* use java 17

* add production_apk profile

* fix: revert app id

* Revert "change projectId to match new alby-go project in eas"

This reverts commit 31a2688.

* add production_apk profile

* upload artifact

* upload artifact

* add pr & release workflows

* cleanup

---------

Co-authored-by: René Aaron <[email protected]>
  • Loading branch information
frnandu and reneaaron authored Sep 2, 2024
1 parent 0e45975 commit 90c773f
Show file tree
Hide file tree
Showing 3 changed files with 130 additions and 1 deletion.
39 changes: 39 additions & 0 deletions .github/workflows/pull_requests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
name: PR build
on: [pull_request]

jobs:
build:
runs-on: ubuntu-latest
steps:
- name: 🏗 Setup repo
uses: actions/checkout@v3

- name: Set up Java
uses: actions/setup-java@v2
with:
java-version: 17
distribution: "temurin"

- name: 🏗 Setup Node
uses: actions/setup-node@v3
with:
node-version: 18.x
cache: yarn

- name: 🏗 Setup EAS
uses: expo/expo-github-action@v8
with:
eas-version: latest
token: ${{ secrets.EXPO_TOKEN }}

- name: 📦 Install dependencies
run: yarn install

- name: 🚀 Build app
run: eas build --non-interactive --platform android --local --profile production_apk --output=./app-release.apk

- name: Upload Artifact
uses: actions/upload-artifact@v2
with:
name: alby-go-android.apk
path: ./app-release.apk
85 changes: 85 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
name: Release tag

on:
push:
tags:
- 'v*' # Push events to matching v*, i.e. v1.0, v20.15.10

jobs:
draft_release:
runs-on: ubuntu-latest
outputs:
upload_url: ${{ steps.create_release.outputs.upload_url }}
id: ${{ steps.create_release.outputs.id }}
steps:
# Create Release
- name: Create Release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ github.ref }}
release_name: Release ${{ github.ref }}
draft: true
# prerelease: true

build_android:
needs: [draft_release]
runs-on: ubuntu-latest
steps:
- name: 🏗 Setup repo
uses: actions/checkout@v3

- name: Set up Java
uses: actions/setup-java@v2
with:
java-version: 17
distribution: "temurin"

- name: 🏗 Setup Node
uses: actions/setup-node@v3
with:
node-version: 18.x
cache: yarn

- name: 🏗 Setup EAS
uses: expo/expo-github-action@v8
with:
eas-version: latest
token: ${{ secrets.EXPO_TOKEN }}

- name: 📦 Install dependencies
run: yarn install

- name: 🚀 Build app
run: eas build --non-interactive --platform android --local --profile production_apk --output=./app-release.apk

- name: Upload Artifact
uses: actions/upload-artifact@v2
with:
name: alby-go-android.apk
path: ./app-release.apk

# APK
- name: Upload APK to release
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ needs.draft_release.outputs.upload_url }}
asset_path: ./app-release.apk
asset_name: alby-go-${{ github.ref_name }}-android.apk
asset_content_type: application/vnd.android.package-archive

# publish-release:
# needs: [release, build_android]
# runs-on: ubuntu-latest
#
# steps:
# - uses: eregon/publish-release@v1
# env:
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# with:
# release_id: ${{ needs.release.outputs.id }}
#
7 changes: 6 additions & 1 deletion eas.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,12 @@
"preview": {
"distribution": "internal"
},
"production": {}
"production": {},
"production_apk": {
"android": {
"buildType": "apk"
}
}
},
"submit": {
"production": {}
Expand Down

0 comments on commit 90c773f

Please sign in to comment.