Skip to content

Commit

Permalink
build: add release workflow and build settings (#44)
Browse files Browse the repository at this point in the history
* refactor(api): improve the api parameter call
* build(app): add build configuration
* test: fix tests after using wallaby and quokka
* ci(sematic-release): add the release workflow
* ci(semantic-release): fix the path of the config file
  • Loading branch information
mheob committed Dec 3, 2020
1 parent aedbd8b commit 7daa803
Show file tree
Hide file tree
Showing 26 changed files with 57 additions and 39 deletions.
Binary file added .deployment/android-screenshot-1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added .deployment/android-screenshot-2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added .deployment/android-screenshot-3.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added .deployment/iphone-55-screenshot-1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added .deployment/iphone-55-screenshot-2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added .deployment/iphone-55-screenshot-3.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added .deployment/iphone-65-screenshot-1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added .deployment/iphone-65-screenshot-2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added .deployment/iphone-65-screenshot-3.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added .deployment/magazine.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
6 changes: 2 additions & 4 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,8 @@ name: Release CI

on:
push:
branches-ignore:
- '**'
# branches:
# - main
branches:
- main

jobs:
release:
Expand Down
15 changes: 10 additions & 5 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,17 +1,22 @@
# macOS
.DS_Store

# DeepCode
.dccache

# expo
node_modules/**/*
.expo/
npm-debug.*
.expo-creds/
pc-api-*.json
*.jks
*.p8
*.p12
*.key
*.mobileprovision
*.orig.*
web-build/

# macOS
.DS_Store
npm-debug.*

# testing
/coverage
coverage
27 changes: 18 additions & 9 deletions app.json
Original file line number Diff line number Diff line change
@@ -1,25 +1,34 @@
{
"expo": {
"entryPoint": "./src/App.tsx",
"name": "convention-app",
"slug": "convention-app",
"name": "Convention International",
"slug": "convention-international",
"description": "Trends, developments and current news from the MICE industry. Everything around meetings, incentives, congresses and events.",
"version": "1.0.0",
"orientation": "portrait",
"icon": "./assets/icon.png",
"icon": "./assets/logo.png",
"splash": {
"image": "./assets/splash.png",
"image": "./assets/logo.png",
"resizeMode": "contain",
"backgroundColor": "#ffffff"
"backgroundColor": "#111111"
},
"updates": {
"fallbackToCacheTimeout": 0
},
"assetBundlePatterns": ["**/*"],
"ios": {
"supportsTablet": true
"android": {
"adaptiveIcon": {
"foregroundImage": "./assets/logo-transparent.png",
"backgroundColor": "#111111"
},
"permissions": [],
"package": "de.convention_net",
"versionCode": 3
},
"web": {
"favicon": "./assets/favicon.png"
"ios": {
"supportsTablet": false,
"bundleIdentifier": "de.convention-net",
"buildNumber": "1.0.0"
}
}
}
Binary file removed assets/favicon.png
Binary file not shown.
Binary file removed assets/icon.png
Binary file not shown.
Binary file added assets/logo-transparent.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/logo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed assets/splash.png
Binary file not shown.
2 changes: 1 addition & 1 deletion jest.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ module.exports = {
setupFilesAfterEnv: ['<rootDir>/config/jest.setup.after.js'],

automock: false,
coveragePathIgnorePatterns: ['<rootDir>/src/styles/'],
coveragePathIgnorePatterns: ['<rootDir>/config/', '<rootDir>/src/styles/'],
testRegex: '(/__tests__/.*|(\\.|/)(test|spec))\\.tsx?$',
transformIgnorePatterns: [
'node_modules/(?!(jest-)?react-native|react-clone-referenced-element|@react-native-community|expo(nent)?|@expo(nent)?/.*|react-navigation|@react-navigation/.*|@unimodules/.*|unimodules|sentry-expo|native-base|@sentry/.*)',
Expand Down
6 changes: 5 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
"main": "node_modules/expo/AppEntry.js",
"scripts": {
"android": "expo start --android",
"build:android": "expo build:android -t app-bundle",
"build:ios": "expo build:ios",
"commit": "git-cz",
"dev": "expo start",
"eject": "expo eject",
Expand All @@ -13,6 +15,8 @@
"test": "jest --detectOpenHandles --forceExit",
"test:cov": "jest --coverage --detectOpenHandles --forceExit",
"test:watch": "jest -u --watch --detectOpenHandles --forceExit",
"upload:android": "expo upload:android --latest",
"upload:ios": "expo upload:ios --latest --language German",
"web": "expo start --web"
},
"husky": {
Expand Down Expand Up @@ -98,6 +102,6 @@
"access": "restricted"
},
"release": {
"extends": "./config/release.config.js"
"extends": "./config/.releaserc.json"
}
}
File renamed without changes.
1 change: 1 addition & 0 deletions src/screens/HomeScreen.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,7 @@ interface Style extends DefaultStyles {

const styles = StyleSheet.create<Style>({
...defaultStyles,
// TODO: Can this get removed?
sectionHeaderContainer: {},
title: {
...defaultStyles.title,
Expand Down
5 changes: 3 additions & 2 deletions src/screens/SettingsScreen.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
import React from 'react'
import { ScrollView, StyleSheet, View } from 'react-native'

import SettingsList from '@components/Settings/SettingsList'
// TODO: Reactivate this setting after adding the push notifications
// import SettingsList from '@components/Settings/SettingsList'
import LegalList from '@components/Settings/LegalList'
import SocialList from '@components/Settings/SocialList'
import { socialMediaChannels } from '@data/social'
Expand All @@ -20,7 +21,7 @@ const SettingsScreen: React.FC = () => {
return (
<View style={styles.container}>
<ScrollView>
<SettingsList data={settingArray} />
{/* <SettingsList data={settingArray} /> */}
<LegalList data={legalScreens} />
<SocialList data={socialMediaChannels} />
</ScrollView>
Expand Down
4 changes: 2 additions & 2 deletions src/utils/__tests__/styling.test.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import { hexToRgb } from '../styling'

describe('Styling utils Testings', () => {
test('return the rgb colors as comma separated string', () => {
it('return the rgb colors as comma separated string', () => {
expect(hexToRgb('#00ff00')).toBe('0, 255, 0')
})

test('return the rgb colors as comma separated string', () => {
it('return the rgb colors as comma separated string', () => {
expect(hexToRgb('#ggDDTT')).toBeNull()
})
})
30 changes: 15 additions & 15 deletions src/utils/api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,27 +37,27 @@ export const fetchPostAsync = async (postId: number): Promise<Response> => {
*
* @param parameter The parameter for the WordPress REST API query.
*/
export const fetchPostsAsync = async (parameter?: {
categoryId?: number | string
page?: number | string
perPage?: number | string
}): Promise<Response> => {
const categoryQuery = parameter?.categoryId ? '&categories=' + parameter.categoryId : ''
const perPageQuery = '&per_page=' + (parameter?.perPage ? parameter.perPage : '20')
const pageQuery = parameter?.page ? '&page=' + parameter.page : ''
export const fetchPostsAsync = async ({
categoryId,
page,
perPage,
}: { categoryId?: number | string; page?: number | string; perPage?: number | string } = {}): Promise<Response> => {
const categoryQuery = categoryId ? '&categories=' + categoryId : ''
const perPageQuery = '&per_page=' + (perPage ? perPage : '20')
const pageQuery = page ? '&page=' + page : ''
return await fetch(API_URL_WP + API_WP_TYPE.POSTS + API_WP_FIELDS.POSTS + categoryQuery + perPageQuery + pageQuery)
}

/**
* Fetches the categories from the WordPress API.
*
* @param parameter The parameter for the WordPress REST API query.
* @param The parameter for the WordPress REST API query.
*/
export const fetchCategoriesAsync = async (parameter?: {
perPage?: number | string
orderBy?: string
}): Promise<Response> => {
const perPageQuery = '&per_page=' + (parameter?.perPage ? parameter.perPage : '99')
const orderByQuery = '&orderby=' + (parameter?.orderBy ? parameter.orderBy : 'description')
export const fetchCategoriesAsync = async ({
perPage,
orderBy,
}: { perPage?: number | string; orderBy?: string } = {}): Promise<Response> => {
const perPageQuery = '&per_page=' + (perPage ? perPage : '99')
const orderByQuery = '&orderby=' + (orderBy ? orderBy : 'description')
return await fetch(API_URL_WP + API_WP_TYPE.CATEGORIES + API_WP_FIELDS.CATEGORIES + perPageQuery + orderByQuery)
}

0 comments on commit 7daa803

Please sign in to comment.