restore original CI workflow and update triggers
Some checks failed
Build App / build-web (push) Has been cancelled
Build App / release (push) Has been cancelled
Build App / build-android (push) Has been cancelled
Build App / build-web (pull_request) Has been cancelled
Build App / release (pull_request) Has been cancelled
Build App / build-android (pull_request) Has been cancelled
Some checks failed
Build App / build-web (push) Has been cancelled
Build App / release (push) Has been cancelled
Build App / build-android (push) Has been cancelled
Build App / build-web (pull_request) Has been cancelled
Build App / release (pull_request) Has been cancelled
Build App / build-android (pull_request) Has been cancelled
This commit is contained in:
@@ -1,15 +1,138 @@
|
|||||||
name: CI
|
name: Build App
|
||||||
|
on:
|
||||||
on: [push, pull_request]
|
push:
|
||||||
|
branches:
|
||||||
|
- main
|
||||||
|
- luna-dev
|
||||||
|
pull_request:
|
||||||
|
types: [opened, synchronize, reopened]
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
build:
|
build-android:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- name: 🏗 Setup repo
|
||||||
- name: Setup Node.js
|
uses: actions/checkout@v2
|
||||||
uses: actions/setup-node@v4
|
|
||||||
with:
|
- name: 🏗 Setup Node
|
||||||
node-version: '22'
|
uses: actions/setup-node@v2
|
||||||
- name: Install dependencies
|
with:
|
||||||
run: npm install
|
node-version: 22
|
||||||
|
|
||||||
|
- 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: 🏗 Setup Expo and EAS
|
||||||
|
uses: expo/expo-github-action@v8
|
||||||
|
with:
|
||||||
|
token: ${{ secrets.EXPO_TOKEN }}
|
||||||
|
eas-version: latest
|
||||||
|
packager: pnpm
|
||||||
|
|
||||||
|
- name: 📦 Install dependencies
|
||||||
|
run: pnpm install
|
||||||
|
|
||||||
|
- name: 👷 Build app
|
||||||
|
run: |
|
||||||
|
eas build --local \
|
||||||
|
--non-interactive \
|
||||||
|
--output=./app-build \
|
||||||
|
--platform=android \
|
||||||
|
--profile=preview
|
||||||
|
|
||||||
|
- name: 📝 Rename build to APK
|
||||||
|
run: mv app-build app-release.apk
|
||||||
|
|
||||||
|
- name: 📤 Upload build artifact
|
||||||
|
uses: actions/upload-artifact@v3
|
||||||
|
with:
|
||||||
|
name: android-preview-build
|
||||||
|
path: app-release.apk
|
||||||
|
if-no-files-found: error
|
||||||
|
|
||||||
|
build-web:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- name: 🏗 Setup repo
|
||||||
|
uses: actions/checkout@v2
|
||||||
|
|
||||||
|
- name: 🏗 Setup Node
|
||||||
|
uses: actions/setup-node@v2
|
||||||
|
with:
|
||||||
|
node-version: 22
|
||||||
|
|
||||||
|
- name: 🏗 Setup pnpm
|
||||||
|
uses: pnpm/action-setup@v4
|
||||||
|
with:
|
||||||
|
version: latest
|
||||||
|
|
||||||
|
- name: 🏗 Setup Expo and EAS
|
||||||
|
uses: expo/expo-github-action@v8
|
||||||
|
with:
|
||||||
|
token: ${{ secrets.EXPO_TOKEN }}
|
||||||
|
eas-version: latest
|
||||||
|
packager: pnpm
|
||||||
|
|
||||||
|
- name: 📦 Install dependencies
|
||||||
|
run: pnpm install
|
||||||
|
|
||||||
|
- name: 👷 Build web
|
||||||
|
run: npx expo export --platform web
|
||||||
|
|
||||||
|
- name: 📦 Zip dist
|
||||||
|
run: cd dist && zip -r ../dist.zip .
|
||||||
|
|
||||||
|
- name: 📤 Upload build artifact
|
||||||
|
uses: actions/upload-artifact@v3
|
||||||
|
with:
|
||||||
|
name: web-build
|
||||||
|
path: dist.zip
|
||||||
|
if-no-files-found: error
|
||||||
|
|
||||||
|
release:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
needs: [build-android, build-web]
|
||||||
|
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
|
||||||
|
steps:
|
||||||
|
- name: 🏗 Setup repo
|
||||||
|
uses: actions/checkout@v2
|
||||||
|
|
||||||
|
- name: 📥 Download Android artifact
|
||||||
|
uses: actions/download-artifact@v3
|
||||||
|
with:
|
||||||
|
name: android-preview-build
|
||||||
|
|
||||||
|
- name: 📥 Download Web artifact
|
||||||
|
uses: actions/download-artifact@v3
|
||||||
|
with:
|
||||||
|
name: web-build
|
||||||
|
|
||||||
|
- name: 🏷 Create tag
|
||||||
|
run: |
|
||||||
|
TAG="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: |
|
||||||
|
app-release.apk
|
||||||
|
dist.zip
|
||||||
|
generate_release_notes: true
|
||||||
|
env:
|
||||||
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
|||||||
Reference in New Issue
Block a user