forked from casdoor/casdoor-authenticator
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
8 changed files
with
406 additions
and
30 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
name: Build preview for pull requests | ||
|
||
on: | ||
push: | ||
# REQUIRED: push main(default) branch is necessary for this action to update its fingerprint database | ||
branches: [master] | ||
pull_request: | ||
types: [opened, synchronize] | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
# REQUIRED: limit concurrency when pushing main(default) branch to prevent conflict for this action to update its fingerprint database | ||
concurrency: fingerprint-${{ github.event_name != 'pull_request' && 'master' || github.run_id }} | ||
permissions: | ||
# REQUIRED: Allow comments of PRs | ||
pull-requests: write # Allow comments on PRs | ||
# REQUIRED: Allow updating fingerprint in acton caches | ||
actions: write | ||
# Following permissions are required for private repos | ||
contents: read | ||
packages: write | ||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v4 | ||
|
||
- 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 | ||
if: ${{ github.event_name == 'pull_request' }} | ||
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 }} | ||
|
||
- name: Create preview builds if needed | ||
uses: expo/expo-github-action/preview-build@main | ||
with: | ||
command: eas build --profile development --platform all | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,114 @@ | ||
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 }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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": {} | ||
} | ||
} |
Oops, something went wrong.