Skip to content

Commit

Permalink
Merge branch 'master' of github.com:IZUMI-Zu/casdoor-app
Browse files Browse the repository at this point in the history
  • Loading branch information
IZUMI-Zu committed Jul 31, 2024
2 parents cfa6735 + 0291bbf commit d728eac
Showing 1 changed file with 114 additions and 0 deletions.
114 changes: 114 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -112,3 +112,117 @@
# run: npm run release
# env:
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
name: EAS Build and Release

on:
workflow_dispatch:
push:
branches:
- master
pull_request:
branches:
- master

jobs:
build:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [macos-latest, ubuntu-latest]
build: [development, production]
include:
- os: macos-latest
platform: ios
- os: ubuntu-latest
platform: android

steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Setup JDK 21
if: matrix.platform == 'android'
uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: '21'
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: 20.x
cache: npm
- name: Setup Expo and EAS
uses: expo/expo-github-action@v8
with:
eas-version: latest
token: ${{ secrets.EXPO_TOKEN }}
- name: Install dependencies
run: npm ci
- name: Build Locally
run: eas build --profile ${{ matrix.build }} --platform ${{ matrix.platform }} --no-wait --non-interactive --local

- name: Archive iOS build artifacts
if: matrix.platform == 'ios'
run: |
tar -xzvf build-*.tar.gz
mkdir -p Payload
mv $(find . -name "*.app" | head -n 1) Payload/casdoorapp.app
zip -r casdoor-app-ios-${{ matrix.build }}.ipa Payload/
- name: Upload iOS build artifacts
uses: actions/upload-artifact@v4
if: matrix.platform == 'ios'
with:
name: casdoor-app-ios-${{ matrix.build }}
path: casdoor-app-ios-${{ matrix.build }}.ipa

- name: Archive Android build artifacts
if: matrix.platform == 'android'
run: |
mv $(find . -name "*.apk" | head -n 1) casdoor-app-android-${{ matrix.build }}.apk
- name: Upload Android build artifacts
if: matrix.platform == 'android'
uses: actions/upload-artifact@v4
with:
name: casdoor-app-android-${{ matrix.build }}
path: casdoor-app-android-${{ matrix.build }}.apk

semantic-release:
needs: build
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: 20.x

- name: Download iOS build artifacts (development)
uses: actions/download-artifact@v4
with:
name: casdoor-app-ios-development
path: release/ios/

- name: Download iOS build artifacts (production)
uses: actions/download-artifact@v4
with:
name: casdoor-app-ios-production
path: release/ios/

- name: Download Android build artifacts (development)
uses: actions/download-artifact@v4
with:
name: casdoor-app-android-development
path: release/android/

- name: Download Android build artifacts (production)
uses: actions/download-artifact@v4
with:
name: casdoor-app-android-production
path: release/android/

- name: Run semantic-release
run: npm run release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

0 comments on commit d728eac

Please sign in to comment.