Skip to content

Commit

Permalink
Merge pull request #197 from yssk22/develop
Browse files Browse the repository at this point in the history
[workflow] refactor and fixes.
  • Loading branch information
yssk22 authored Dec 24, 2024
2 parents 19c9284 + 280cbfc commit e47775f
Show file tree
Hide file tree
Showing 10 changed files with 313 additions and 36 deletions.
77 changes: 71 additions & 6 deletions .github/workflows/eas-build-android.yml
Original file line number Diff line number Diff line change
Expand Up @@ -64,30 +64,95 @@ jobs:
distribution: "temurin"
- uses: android-actions/setup-android@v3
- run: cd expo && rm ./config/${{ matrix.target }}/.gitignore
- run: cd expo && rm ./.gitignore
- run: cd expo && yarn install
- run: cd expo && envsubst < ./.env > ./.env.local
env:
APP_CHECK_DEBUG_TOKEN: ${{ secrets.APP_CHECK_DEBUG_TOKEN }}
GRAPHQL_ENDPOINT: ${{ secrets.GRAPHQL_ENDPOINT }}
- run: cd expo && ./scripts/eas.sh build --profile ${{ matrix.target }} --platform android --local --output ./build/hpapp-${{ matrix.target }}.apk
- run: cd expo && ./scripts/eas.sh build --profile ${{ matrix.target }} --platform android --local --output ${{ github.workspace }}/expo/build/hpapp-${{ matrix.target }}.apk
if: ${{ matrix.target == 'dev' }}
env:
HPAPP_CONFIG_NAME: ${{ matrix.target }}
SECRETS_JSON: ${{ secrets.SECRETS_JSON }}
GOOGLE_SERVICES_INFO_PLIST: ${{ secrets.GOOGLE_SERVICES_INFO_PLIST }}
GOOGLE_SERVICES_JSON: ${{ secrets.GOOGLE_SERVICES_JSON }}
- run: cd expo && ./scripts/eas.sh build --profile ${{ matrix.target }} --platform android --local --output ./build/hpapp-${{ matrix.target }}.aab
- run: cd expo && ./scripts/eas.sh build --profile ${{ matrix.target }} --platform android --local --output ${{ github.workspace }}/expo/build/hpapp-${{ matrix.target }}.aab
if: ${{ matrix.target != 'dev' }}
env:
HPAPP_CONFIG_NAME: ${{ matrix.target }}
GOOGLE_SERVICES_INFO_PLIST: ${{ secrets.GOOGLE_SERVICES_INFO_PLIST }}
GOOGLE_SERVICES_JSON: ${{ secrets.GOOGLE_SERVICES_JSON }}
# [dev] upload artifacts
- uses: actions/upload-artifact@v4
if: ${{ matrix.target == 'dev' }}
with:
name: hpapp-${{ matrix.target }}.apk
path: ${{ github.workspace }}/expo/build/hpapp-${{ matrix.target }}.apk
# [beta/prod] submit
- run: cd expo && envsubst < ./config/eas.json.env > ./config/eas.json
- uses: actions/upload-artifact@v4
if: ${{ matrix.target != 'dev' }}
with:
name: hpapp-${{ matrix.target }}.aab
path: ${{ github.workspace }}/expo/build/hpapp-${{ matrix.target }}.aab
submit:
if: ${{ github.event.inputs.beta == 'true' || github.event.inputs.prod == 'true' }}
needs: [generate-matrix, build]
strategy:
matrix:
target: ${{ fromJson(needs.generate-matrix.outputs.target) }}
exclude:
- target: dev
runs-on: ubuntu-latest
environment:
name: eas-${{ matrix.target }}
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: ${{ env.NODE_VERSION }}
cache: "yarn"
cache-dependency-path: "expo/package.json"
- uses: expo/expo-github-action@v8
with:
eas-version: ${{ env.EAS_VERSION }}
token: ${{ secrets.EXPO_TOKEN }}
- uses: actions/download-artifact@v4
with:
name: hpapp-${{ matrix.target }}.aab
path: ${{ github.workspace }}/expo/build/
- run: cd expo && yarn install
- run: cd expo && rm ./config/${{ matrix.target }}/.gitignore
- run: cd expo && rm ./.gitignore
- run: cd expo && envsubst < ./config/eas.json.env > ./config/eas.json
env:
EAS_SUBMIT: ${{ secrets.EAS_SUBMIT }}
- run: cd expo && envsubst < ./config/PlayStoreKey.json.env > ./config/PlayStoreKey.json
env:
EAS_SUBMIT: ${{ secrets.EAS_SUBMIT }}
PLAY_STORE_KEY: ${{ secrets.PLAY_STORE_KEY }}
- run: cd expo && ./scripts/eas.sh submit --profile ${{ matrix.target }} --platform android --non-interactive --path ${{ github.workspace }}/expo/build/hpapp-${{ matrix.target }}.aab
if: ${{ matrix.target != 'dev' }}
env:
HPAPP_CONFIG_NAME: ${{ matrix.target }}
EXPO_APPLE_APP_SPECIFIC_PASSWORD: ${{ secrets.EXPO_APPLE_APP_SPECIFIC_PASSWORD }}
upload-cloud-storage:
if: ${{ github.event.inputs.dev == 'true' }}
needs: [generate-matrix, build]
runs-on: ubuntu-latest
permissions:
contents: "read"
id-token: "write"
environment:
name: gcp-go
steps:
- uses: actions/checkout@v3
- uses: "google-github-actions/auth@v2"
with:
workload_identity_provider: ${{ secrets.GCP_WORKLOAD_IDENTITY_PROVIDER }}
service_account: ${{ secrets.GCLOUD_USER }}
- uses: actions/download-artifact@v4
with:
name: hpapp-dev.apk
path: ${{ github.workspace }}/expo/build/
- uses: "google-github-actions/upload-cloud-storage@v2"
with:
path: ${{ github.workspace }}/expo/build/hpapp-dev.apk
destination: "hpapp.yssk22.dev/artifacts"
75 changes: 75 additions & 0 deletions .github/workflows/eas-build-debug.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
name: Debug
on:
workflow_dispatch:
inputs:
dev:
description: "HPAPP_CONFIG_NAME=dev"
required: false
type: boolean
default: false
beta:
description: "HPAPP_CONFIG_NAME=beta"
required: false
type: boolean
default: false
prod:
description: "HPAPP_CONFIG_NAME=prod"
required: false
type: boolean
default: false
env:
NODE_VERSION: 22.3.0
EAS_VERSION: 13.4.2
JAVA_VERSION: 17
jobs:
generate-matrix:
runs-on: ubuntu-latest
outputs:
target: ${{ steps.generatematrix.outputs.target }}
steps:
- id: generatematrix
run: |
inputs='${{ toJson(github.event.inputs) }}'
targets=()
for key in $(echo "$inputs" | jq -r 'keys[]'); do
if [ "$(echo "$inputs" | jq -r ".\"$key\"")" == "true" ]; then
targets+=("$key")
fi
done
targets_str=$(printf ',"%s"' "${targets[@]}")
targets_str="[${targets_str:1}]"
echo "target=$targets_str" >> $GITHUB_OUTPUT
build:
needs: generate-matrix
strategy:
matrix:
target: ${{ fromJson(needs.generate-matrix.outputs.target) }}
runs-on: macos-latest
environment:
name: eas-${{ matrix.target }}
steps:
- run: echo ${{ matrix.target }}
submit:
if: ${{ github.event.inputs.beta == 'true' || github.event.inputs.prod == 'true' }}
needs: [generate-matrix, build]
strategy:
matrix:
target: ${{ fromJson(needs.generate-matrix.outputs.target) }}
exclude:
- target: dev
runs-on: ubuntu-latest
environment:
name: eas-${{ matrix.target }}
steps:
- run: echo ${{ matrix.target }}
upload-cloud-storage:
if: ${{ github.event.inputs.dev == 'true' }}
needs: [generate-matrix, build]
runs-on: ubuntu-latest
permissions:
contents: "read"
id-token: "write"
environment:
name: gcp-go
steps:
- run: echo dev
67 changes: 60 additions & 7 deletions .github/workflows/eas-build-ios.yml
Original file line number Diff line number Diff line change
Expand Up @@ -59,33 +59,86 @@ jobs:
eas-version: ${{ env.EAS_VERSION }}
token: ${{ secrets.EXPO_TOKEN }}
- run: cd expo && rm ./config/${{ matrix.target }}/.gitignore
- run: cd expo && rm ./.gitignore
- run: cd expo && yarn install
- run: cd expo && envsubst < ./.env > ./.env.local
env:
APP_CHECK_DEBUG_TOKEN: ${{ secrets.APP_CHECK_DEBUG_TOKEN }}
GRAPHQL_ENDPOINT: ${{ secrets.GRAPHQL_ENDPOINT }}
- run: cd expo && ./scripts/eas.sh build --profile ${{ matrix.target }} --platform ios --non-interactive --local --output ./build/hpapp-${{ matrix.target }}.ipa
- run: cd expo && ./scripts/eas.sh build --profile ${{ matrix.target }} --platform ios --non-interactive --local --output ${{ github.workspace }}/expo/build/hpapp-${{ matrix.target }}.ipa
env:
HPAPP_CONFIG_NAME: ${{ matrix.target }}
GOOGLE_SERVICES_INFO_PLIST: ${{ secrets.GOOGLE_SERVICES_INFO_PLIST }}
GOOGLE_SERVICES_JSON: ${{ secrets.GOOGLE_SERVICES_JSON }}
# upload artifacts
- uses: actions/upload-artifact@v4
with:
name: hpapp-${{ matrix.target }}.ipa
path: ${{ github.workspace }}/expo/build/hpapp-${{ matrix.target }}.ipa
# [beta/prod] submit
submit:
if: ${{ github.event.inputs.beta == 'true' || github.event.inputs.prod == 'true' }}
needs: [generate-matrix, build]
strategy:
matrix:
target: ${{ fromJson(needs.generate-matrix.outputs.target) }}
exclude:
- target: dev
runs-on: ubuntu-latest
environment:
name: eas-${{ matrix.target }}
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: ${{ env.NODE_VERSION }}
cache: "yarn"
cache-dependency-path: "expo/package.json"
- uses: expo/expo-github-action@v8
with:
eas-version: ${{ env.EAS_VERSION }}
token: ${{ secrets.EXPO_TOKEN }}
- uses: actions/download-artifact@v4
with:
name: hpapp-${{ matrix.target }}.ipa
path: ${{ github.workspace }}/expo/build/
- run: cd expo && yarn install
- run: cd expo && rm ./config/${{ matrix.target }}/.gitignore
- run: cd expo && rm ./.gitignore
- run: cd expo && envsubst < ./config/eas.json.env > ./config/eas.json
if: ${{ matrix.target != 'dev' }}
env:
EAS_SUBMIT: ${{ secrets.EAS_SUBMIT }}
- run: cd expo && envsubst < ./config/AppStoreKey.p8.env > ./config/AppStoreKey.p8
if: ${{ matrix.target != 'dev' }}
env:
EAS_SUBMIT: ${{ secrets.EAS_SUBMIT }}
APP_STORE_KEY: ${{ secrets.APP_STORE_KEY }}
- run: cd expo && ./scripts/eas.sh submit --profile ${{ matrix.target }} --platform ios --non-interactive --path ./build/hpapp-${{ matrix.target }}.ipa
- run: cd expo && ./scripts/eas.sh submit --profile ${{ matrix.target }} --platform ios --non-interactive --path ${{ github.workspace }}/expo/build/hpapp-${{ matrix.target }}.ipa
if: ${{ matrix.target != 'dev' }}
env:
HPAPP_CONFIG_NAME: ${{ matrix.target }}
EXPO_APPLE_APP_SPECIFIC_PASSWORD: ${{ secret.EXPO_APPLE_APP_SPECIFIC_PASSWORD }}
EXPO_APPLE_APP_SPECIFIC_PASSWORD: ${{ secrets.EXPO_APPLE_APP_SPECIFIC_PASSWORD }}
upload-cloud-storage:
if: ${{ github.event.inputs.dev == 'true' }}
needs: [generate-matrix, build]
runs-on: ubuntu-latest
permissions:
contents: "read"
id-token: "write"
environment:
name: gcp-go
steps:
- uses: actions/checkout@v3
- uses: "google-github-actions/auth@v2"
with:
workload_identity_provider: ${{ secrets.GCP_WORKLOAD_IDENTITY_PROVIDER }}
service_account: ${{ secrets.GCLOUD_USER }}
- uses: actions/download-artifact@v4
with:
name: hpapp-dev.ipa
path: ${{ github.workspace }}/expo/build/
- uses: "google-github-actions/upload-cloud-storage@v2"
with:
path: ${{ github.workspace }}/expo/config/dev/hpapp-dev.plist
destination: "hpapp.yssk22.dev/artifacts"
- uses: "google-github-actions/upload-cloud-storage@v2"
with:
path: ${{ github.workspace }}/expo/build/hpapp-dev.ipa
destination: "hpapp.yssk22.dev/artifacts"
8 changes: 5 additions & 3 deletions .github/workflows/eas-ota-update-auto.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,17 +17,19 @@ jobs:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: "22.3.0"
node-version: ${{ env.NODE_VERSION }}
cache: "yarn"
cache-dependency-path: "expo/package.json"
- uses: expo/expo-github-action@v8
with:
eas-version: 13.4.2
eas-version: ${{ env.EAS_VERSION }}
token: ${{ secrets.EXPO_TOKEN }}
- run: cd expo && rm ./config/${{ matrix.target }}/.gitignore
- run: cd expo && rm ./.gitignore
- run: cd expo && yarn install
- run: cd expo && envsubst < ./.env > ./.env.local
- run: cd expo && ./scripts/eas.sh update --channel beta --non-interactive --auto
env:
HPAPP_CONFIG_NAME: beta
SECRETS_JSON: ${{ secrets.SECRETS_JSON }}
GOOGLE_SERVICES_INFO_PLIST: ${{ secrets.GOOGLE_SERVICES_INFO_PLIST }}
GOOGLE_SERVICES_JSON: ${{ secrets.GOOGLE_SERVICES_JSON }}
13 changes: 10 additions & 3 deletions .github/workflows/eas-ota-update-manual.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,10 @@ on:
- beta
- prod

env:
NODE_VERSION: 22.3.0
EAS_VERSION: 13.4.2
JAVA_VERSION: 17
jobs:
update:
runs-on: ubuntu-latest
Expand All @@ -20,17 +24,20 @@ jobs:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: "22.3.0"
node-version: ${{ env.NODE_VERSION }}
cache: "yarn"
cache-dependency-path: "expo/package.json"
- uses: expo/expo-github-action@v8
with:
eas-version: 13.4.2
eas-version: ${{ env.EAS_VERSION }}
token: ${{ secrets.EXPO_TOKEN }}
- run: cd expo && yarn install
- run: cd expo && rm ./config/${{ matrix.target }}/.gitignore
- run: cd expo && rm ./.gitignore
- run: cd expo && yarn install
- run: cd expo && envsubst < ./.env > ./.env.local
- run: cd expo && ./scripts/eas.sh update --channel ${{inputs.config}} --non-interactive --auto
env:
HPAPP_CONFIG_NAME: ${{inputs.config}}
SECRETS_JSON: ${{ secrets.SECRETS_JSON }}
GOOGLE_SERVICES_INFO_PLIST: ${{ secrets.GOOGLE_SERVICES_INFO_PLIST }}
GOOGLE_SERVICES_JSON: ${{ secrets.GOOGLE_SERVICES_JSON }}
36 changes: 36 additions & 0 deletions docs/expo/development.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
# iOS/Android development

## Install development build

### for iOS

Scan the QR code below or open [iTunes Link](itms-services://?action=download-manifest;url=https://storage.googleapis.com/hpapp.yssk22.dev/hpapp-dev.plist) to install the development build.

![iOS QR code](https://storage.googleapis.com/hpapp.yssk22.dev/artifacts/QR-hpapp-dev.png)

### for Android

Scan the QR code below or open [iTunes Link](itms-services://?action=download-manifest;url=https://storage.googleapis.com/hpapp.yssk22.dev/hpapp-dev.plist) to install the development build.

![Android QR](https://storage.googleapis.com/hpapp.yssk22.dev/artifacts/QR-hpapp-android-dev.png)

## Start a development server

```bash
$ cloud_sql_proxy -instances=${GCP_PROJECT}:asia-northeast1:${GCP_DB}=tcp:3306
$ cd go
$ go run ./cmd/ --prod httpserver
```

## Start a metro bundler

```bash
$ cd expo
$ yarn install
$ export APP_CHECK_DEBUG_TOKEN=****
$ export GRAPHQL_ENDPOINT=http://{development_server}:8080
$ envsubst < ./.env > ./.env.local
$ yarn start
```

now you can launch the app on your device and connect to the metro bundler
Loading

0 comments on commit e47775f

Please sign in to comment.