Skip to content

Commit

Permalink
chore: added ci
Browse files Browse the repository at this point in the history
  • Loading branch information
siradji committed Mar 3, 2024
1 parent af6ed82 commit cb2115d
Show file tree
Hide file tree
Showing 3 changed files with 116 additions and 1 deletion.
50 changes: 50 additions & 0 deletions .github/workflows/eas-build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
name: EAS Build

on:
workflow_dispatch:

concurrency:
group: ${{ github.workflow }}-${{ github.event_name }}-${{ github.ref }}
cancel-in-progress: true

jobs:
eas-build:
name: EAS Build
environment: EAS Release
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # v3.5.3

- uses: actions/github-script@d7906e4ad0b1822421a7e6a35d5ca353c962f410 # v6.4.1
id: version
with:
script: |
const [date] = new Date().toISOString().split('T')
const build = '0.0.' + date.replace(/[^0-9]/g, '')
console.log(build)
return build
result-encoding: string

- uses: actions/setup-node@64ed1c7eab4cce3362f8c340dee64e5eaeef8f7c # v3.6.0
with:
node-version: 20

- uses: expo/expo-github-action@4479f0b3692e25169fa71a02c30d6586ec2f5601 # tag=v7.2.0
with:
eas-version: latest
expo-version: 4.x
packager: yarn
token: ${{ secrets.EXPO_TOKEN }}

- run: yarn install --frozen-lockfile

- run: |
git config --global user.email "[email protected]"
git config --global user.name "defichain-bot"
npx standard-version --release-as ${{steps.version.outputs.result}}
- name: EAS Build - iOS & Android
run: eas build --platform all --non-interactive --wait --profile preview
env:
EAS_PROJECT_ID: ${{ secrets.EAS_PROJECT_ID }}
66 changes: 66 additions & 0 deletions .github/workflows/eas-publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
name: EAS Publish

on:
release:
types: [published]

concurrency:
group: ${{ github.workflow }}-${{ github.event_name }}-${{ github.ref }}
cancel-in-progress: true

jobs:
version:
name: Version
runs-on: ubuntu-latest
outputs:
version: ${{ steps.version.outputs.result }}
steps:
- uses: actions/github-script@d7906e4ad0b1822421a7e6a35d5ca353c962f410 # v6.4.1
id: version
with:
script: |
const semver = context.ref.replace('refs/tags/v', '')
if (semver.match(/^[0-9]+\.[0-9]+\.[0-9]+$/)) {
return semver
}
throw new Error('not semver')
result-encoding: string

eas-release-android:
name: EAS Release Android
environment: EAS Release
runs-on: ubuntu-latest
needs: [version]
steps:
- uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # v3.5.3
- uses: actions/setup-node@64ed1c7eab4cce3362f8c340dee64e5eaeef8f7c # v3.6.0
with:
node-version: 20

- uses: expo/expo-github-action@4479f0b3692e25169fa71a02c30d6586ec2f5601 # tag=v7.2.0
with:
eas-version: latest
expo-version: latest
packager: yarn
token: ${{ secrets.EXPO_TOKEN }}

- run: yarn install --frozen-lockfile

- run: |
git config --global user.email "[email protected]"
git config --global user.name "defichain-bot"
npx standard-version --release-as ${{needs.version.outputs.version}}
- name: EAS Build - Android
run: eas build --platform android --non-interactive --wait --clear-cache
env:
EAS_PROJECT_ID: ${{ secrets.EAS_PROJECT_ID }}

- run: sleep 10s

- name: EAS Submit - Android - Submit
run: eas submit --platform android --latest
env:
EAS_PROJECT_ID: ${{ secrets.EAS_PROJECT_ID }}

Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ import {TextInputWithLabel} from "@components/commons/inputs/TextInputWithLabel"
import {useAnalytics} from "@segment/analytics-react-native";
import {OnboardingScreenName} from "@screens/OnboardingNavigator/ScreenName.enum";


interface LoginForm {
email: string
password: string
Expand Down

0 comments on commit cb2115d

Please sign in to comment.