Skip to content

Commit

Permalink
Merge pull request #118 from D4ryl00/chore/eas-support
Browse files Browse the repository at this point in the history
fix: get push token + EAS build
  • Loading branch information
D4ryl00 authored Jul 17, 2024
2 parents 76c7a58 + fdc0da9 commit ed77dad
Show file tree
Hide file tree
Showing 11 changed files with 282 additions and 69 deletions.
2 changes: 2 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@ jobs:
uses: cycjimmy/semantic-release-action@v4
with:
working_directory: ./mobile
extra_plugins: |
semantic-release-expo
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
9 changes: 8 additions & 1 deletion .releaserc
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
{
"branches": ["main"]
"branches": ["main"],
"plugins": [
"semantic-release-expo",
"@semantic-release/commit-analyzer",
"@semantic-release/release-notes-generator",
"@semantic-release/npm",
"@semantic-release/github"
],
}
3 changes: 3 additions & 0 deletions mobile/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -41,3 +41,6 @@ ios/
# Firebase config files
google-services.json
GoogleService-Info.plist

# Google Cloud Platform
dsocial-fed6b-firebase-adminsdk-7sjg7-b2b5c052c3.json
14 changes: 3 additions & 11 deletions mobile/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -85,15 +85,7 @@ release.android: node_modules
.PHONY: elease.android

help:
@echo "Usage: make [target]"
@echo ""
@echo "Targets:"
@echo " ios - Build the iOS app"
@echo " ios.release - Build the iOS app in release mode"
@echo " android - Build the Android app"
@echo " start - Start the metro server"
@echo " clean - Clean the project"
@echo " clean_install - Clean the project and install dependencies"
@echo " release - Build the app for production"
@echo " help - Show this help message"
@echo "Available make commands:"
@cat Makefile | grep '^[a-z]' | grep -v '=' | cut -d: -f1 | sort | sed 's/^/ /'
.PHONY: help

19 changes: 19 additions & 0 deletions mobile/app.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
export default ({ config }) => {
if (process.env.MY_ENVIRONMENT === "production") {
return {
...config,
ios: {
...config.ios,
googleServicesFile: process.env.GOOGLESERVICES_INFO_PLIST || "./GoogleService-Info.plist",
},
android: {
...config.android,
googleServicesFile: process.env.GOOGLE_SERVICES_JSON || "./google-services.json",
},
};
} else {
return {
...config,
};
}
};
7 changes: 3 additions & 4 deletions mobile/app.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"name": "dsocial",
"slug": "dsocial",
"platforms": ["ios", "android"],
"version": "1.0.5",
"version": "1.0.0",
"orientation": "portrait",
"scheme": "tech.berty.dsocial",
"icon": "./assets/images/icon.png",
Expand All @@ -28,16 +28,15 @@
}
}
},
"googleServicesFile": "./GoogleService-Info.plist"
"buildNumber": "9"
},
"android": {
"adaptiveIcon": {
"foregroundImage": "./assets/images/adaptive-icon.png",
"backgroundColor": "#ffffff"
},
"package": "tech.berty.dsocial.android",
"versionCode": 8,
"googleServicesFile": "./google-services.json"
"versionCode": "9"
},
"web": {
"favicon": "./assets/images/favicon.png"
Expand Down
7 changes: 0 additions & 7 deletions mobile/app/_layout.tsx
Original file line number Diff line number Diff line change
@@ -1,10 +1,3 @@
// order matters here
import "react-native-polyfill-globals/auto";

// Polyfill async.Iterator. For some reason, the Babel presets and plugins are not doing the trick.
// Code from here: https://www.typescriptlang.org/docs/handbook/release-notes/typescript-2-3.html#caveats
(Symbol as any).asyncIterator = Symbol.asyncIterator || Symbol.for("Symbol.asyncIterator");

import { Stack } from "expo-router";

import { DefaultTheme, ThemeProvider } from "@react-navigation/native";
Expand Down
24 changes: 21 additions & 3 deletions mobile/eas.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,30 @@
"developmentClient": true,
"distribution": "internal"
},
"ios-simulator": {
"extends": "development",
"ios": {
"simulator": true
}
},
"preview": {
"distribution": "internal"
"distribution": "internal",
"env": {
"MY_ENVIRONMENT": "production"
}
},
"production": {}
"production": {
"env": {
"MY_ENVIRONMENT": "production"
}
}
},
"submit": {
"production": {}
"production": {
"android": {
"serviceAccountKeyPath": "./dsocial-fed6b-firebase-adminsdk-7sjg7-b2b5c052c3.json",
"track": "internal"
}
}
}
}
113 changes: 113 additions & 0 deletions mobile/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 4 additions & 1 deletion mobile/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,10 @@
"react-redux": "^9.1.0",
"styled-components": "^6.1.8",
"text-encoding": "^0.7.0",
"web-streams-polyfill": "^3.3.2"
"web-streams-polyfill": "^3.3.2",
"expo-application": "~5.9.1",
"expo-linear-gradient": "~13.0.2",
"expo-dev-client": "~4.0.18"
},
"devDependencies": {
"@babel/core": "^7.20.0",
Expand Down
Loading

0 comments on commit ed77dad

Please sign in to comment.