Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Action #3

Merged
merged 16 commits into from
Jul 29, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
16 commits
Select commit Hold shift + click to select a range
2926eb1
chore: update app.json and package.json for EAS build and cloud sync
IZUMI-Zu Jul 28, 2024
5c74b12
chore: update npm dependency to latest stable version
IZUMI-Zu Jul 28, 2024
282ce61
chore: update npm dependency to latest stable version
IZUMI-Zu Jul 28, 2024
c9e9772
feat: Update EAS build configuration for JavaScript files and package…
IZUMI-Zu Jul 28, 2024
f60ace0
chore: Update EAS build configuration for JavaScript files and packag…
IZUMI-Zu Jul 28, 2024
c477916
chore: Update EAS build configuration for JavaScript files and packag…
IZUMI-Zu Jul 28, 2024
0c91219
chore: Update EAS build configuration for JavaScript files and packag…
IZUMI-Zu Jul 29, 2024
0cb7ea2
chore: Update EAS build configuration for JavaScript files and packag…
IZUMI-Zu Jul 29, 2024
809b359
chore: Update EAS build configuration for JavaScript files and packag…
IZUMI-Zu Jul 29, 2024
4c8a11d
chore: Update EAS build configuration for JavaScript files and packag…
IZUMI-Zu Jul 29, 2024
61df9aa
chore: Update EAS build configuration for JavaScript files and packag…
IZUMI-Zu Jul 29, 2024
28e6318
chore: Update Node.js version to 20.x in GitHub workflow files
IZUMI-Zu Jul 29, 2024
b09bc76
chore: Update EAS build configuration for JavaScript files and packag…
IZUMI-Zu Jul 29, 2024
efc25ba
Delete .releaserc.json
IZUMI-Zu Jul 29, 2024
105ae53
chore: Update Node.js version to 20.x in GitHub workflow files
IZUMI-Zu Jul 29, 2024
93626d1
Merge branch 'action' of github.com:IZUMI-Zu/casdoor-app into action
IZUMI-Zu Jul 29, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions .github/semantic.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# Always validate the PR title AND all the commits
titleAndCommits: true
# Require at least one commit to be valid
# this is only relevant when using commitsOnly: true or titleAndCommits: true,
# which validate all commits by default
anyCommit: true
# Allow use of Merge commits (eg on github: "Merge branch 'master' into feature/ride-unicorns")
# this is only relevant when using commitsOnly: true (or titleAndCommits: true)
allowMergeCommits: false
# Allow use of Revert commits (eg on github: "Revert "feat: ride unicorns"")
# this is only relevant when using commitsOnly: true (or titleAndCommits: true)
allowRevertCommits: false
31 changes: 31 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: EAS Build

on:
workflow_dispatch:
pull_request:
paths:
- "*.js"
- "package.json"
- "eas.json"
- "app.json"

jobs:
build:
name: Install and build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
# - uses: actions/setup-node@v4
# with:
# node-version: 18.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 on EAS
# run: eas build --platform all --non-interactive --no-wait
41 changes: 41 additions & 0 deletions .github/workflows/preview.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
name: EXPO Preview

on:
pull_request:
paths:
- '*.js'
- 'package.json'
- 'eas.json'
- 'app.json'
- '.github/workflows/preview.yml'

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

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

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

- name: 📦 Install dependencies
run: npm install

- name: 🚀 Create preview
uses: expo/expo-github-action/preview@v8
with:
command: eas update --auto --branch ${{ github.event.pull_request.head.ref }}
comment: true
qr-target: 'expo-go'
working-directory: ${{ github.workspace }}
github-token: ${{ secrets.GITHUB_TOKEN }}
122 changes: 122 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,122 @@
name: EAS Build and Release

on:
workflow_dispatch:
push:
branches:
- master
paths:
- '*.js'
- 'package.json'
- 'eas.json'
- 'app.json'
- '.github/workflows/release.yml'
pull_request:
branches:
- master
paths:
- '*.js'
- 'package.json'
- 'eas.json'
- 'app.json'
- '.github/workflows/release.yml'

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 casdoorapp-${{ github.run_number }}.ipa Payload/
- name: Upload iOS build artifacts
uses: actions/upload-artifact@v4
if: matrix.platform == 'ios'
with:
name: casdoor-app-ios-${{ matrix.build }}-${{ github.run_number }}.ipa
path: casdoorapp-${{ github.run_number }}.ipa

- name: Upload Android build artifacts
if: matrix.platform == 'android'
uses: actions/upload-artifact@v4
with:
name: casdoor-app-android-${{ matrix.build }}-${{ github.run_number }}.apk
path: 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: Create Release Directory
run: mkdir -p release

- name: Download iOS build artifacts (development)
uses: actions/download-artifact@v4
with:
name: casdoor-app-ios-development-${{ github.run_number }}.ipa
path: release/ios/development

- name: Download iOS build artifacts (production)
uses: actions/download-artifact@v4
with:
name: casdoor-app-ios-production-${{ github.run_number }}.ipa
path: release/ios/production

- name: Download Android build artifacts (development)
uses: actions/download-artifact@v4
with:
name: casdoor-app-android-development-${{ github.run_number }}.apk
path: release/android/development

- name: Download Android build artifacts (production)
uses: actions/download-artifact@v4
with:
name: casdoor-app-android-production-${{ github.run_number }}.apk
path: release/android/production

- name: Run semantic-release
run: npm run release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
14 changes: 11 additions & 3 deletions app.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,16 +15,24 @@
"**/*"
],
"ios": {
"supportsTablet": true
"supportsTablet": true,
"bundleIdentifier": "com.zzbs.casdoorapp"
},
"android": {
"adaptiveIcon": {
"foregroundImage": "./assets/adaptive-icon.png",
"backgroundColor": "#ffffff"
}
},
"package": "com.zzbs.casdoorapp"
},
"web": {
"favicon": "./assets/favicon.png"
}
},
"extra": {
"eas": {
"projectId": "d0ddea88-9be6-46db-8aa5-ea6d80cef527"
}
},
"owner": "zzbs"
}
}
45 changes: 45 additions & 0 deletions eas.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
{
"cli": {
"version": ">= 10.2.1"
},
"build": {
"base": {
"android": {
"image": "latest",
"buildType": "apk"
},
"ios": {
"image": "latest",
"simulator": true
}
},
"development": {
"extends": "base",
"channel": "development",
"developmentClient": true,
"distribution": "internal",
"android": {
"withoutCredentials": true
},
"ios": {
"buildConfiguration": "Debug"
}
},
"preview": {
"extends": "base",
"channel": "preview",
"distribution": "internal",
"ios": {
"simulator": true
}
},
"production": {
"extends": "base",
"channel": "production",
"autoIncrement": true
}
},
"submit": {
"production": {}
}
}
Loading
Loading