123 lines
2.9 KiB
YAML
123 lines
2.9 KiB
YAML
name: Luggage List Build
|
|
on:
|
|
push:
|
|
branches:
|
|
- main
|
|
|
|
jobs:
|
|
build-android:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: 🏗 Setup repo
|
|
uses: actions/checkout@v4
|
|
|
|
- name: 🏗 Setup Node
|
|
uses: actions/setup-node@v4
|
|
with:
|
|
node-version: 22
|
|
cache: pnpm
|
|
|
|
- name: 🏗 Setup pnpm
|
|
uses: pnpm/action-setup@v4
|
|
with:
|
|
version: latest
|
|
|
|
- name: 🏗 Setup Java
|
|
uses: actions/setup-java@v4
|
|
with:
|
|
distribution: temurin
|
|
java-version: 17
|
|
|
|
- name: 🏗 Setup Android SDK
|
|
uses: android-actions/setup-android@v3
|
|
|
|
- name: 📦 Install dependencies
|
|
run: pnpm install --frozen-lockfile
|
|
|
|
- name: 🧱 Generate native Android project
|
|
run: npx expo prebuild --platform android --non-interactive
|
|
|
|
- name: 👷 Build release APK
|
|
run: |
|
|
cd android
|
|
./gradlew assembleRelease --no-daemon
|
|
|
|
- name: 📝 Rename build to APK
|
|
run: cp android/app/build/outputs/apk/release/app-release.apk luggage-list-release.apk
|
|
|
|
- name: 📤 Upload build artifact
|
|
uses: actions/upload-artifact@v4
|
|
with:
|
|
name: luggage-list-android-preview-build
|
|
path: luggage-list-release.apk
|
|
if-no-files-found: error
|
|
|
|
build-web:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: 🏗 Setup repo
|
|
uses: actions/checkout@v4
|
|
|
|
- name: 🏗 Setup Node
|
|
uses: actions/setup-node@v4
|
|
with:
|
|
node-version: 22
|
|
cache: pnpm
|
|
|
|
- name: 🏗 Setup pnpm
|
|
uses: pnpm/action-setup@v4
|
|
with:
|
|
version: latest
|
|
|
|
- name: 📦 Install dependencies
|
|
run: pnpm install --frozen-lockfile
|
|
|
|
- name: 👷 Build web
|
|
run: npx expo export --platform web
|
|
|
|
- name: 📦 Zip dist
|
|
run: cd dist && zip -r ../luggage-list-dist.zip .
|
|
|
|
- name: 📤 Upload build artifact
|
|
uses: actions/upload-artifact@v4
|
|
with:
|
|
name: luggage-list-web-build
|
|
path: luggage-list-dist.zip
|
|
if-no-files-found: error
|
|
|
|
release:
|
|
runs-on: ubuntu-latest
|
|
needs: [build-android, build-web]
|
|
steps:
|
|
- name: 🏗 Setup repo
|
|
uses: actions/checkout@v4
|
|
|
|
- name: 📥 Download Android artifact
|
|
uses: actions/download-artifact@v4
|
|
with:
|
|
name: luggage-list-android-preview-build
|
|
|
|
- name: 📥 Download Web artifact
|
|
uses: actions/download-artifact@v4
|
|
with:
|
|
name: luggage-list-web-build
|
|
|
|
- name: 🏷 Create tag
|
|
run: |
|
|
TAG="luggage-list-build-$(git rev-parse --short HEAD)"
|
|
git tag "$TAG"
|
|
git push origin "$TAG"
|
|
echo "RELEASE_TAG=$TAG" >> $GITHUB_ENV
|
|
|
|
- name: 🚀 Create release
|
|
uses: softprops/action-gh-release@v1
|
|
with:
|
|
tag_name: ${{ env.RELEASE_TAG }}
|
|
name: ${{ env.RELEASE_TAG }}
|
|
files: |
|
|
luggage-list-release.apk
|
|
luggage-list-dist.zip
|
|
generate_release_notes: true
|
|
env:
|
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|