From a23f98842fcf4da7956836b179f3a5759541ffd3 Mon Sep 17 00:00:00 2001 From: Zhiyuan Zheng Date: Sun, 14 Mar 2021 21:48:28 +0100 Subject: [PATCH] Update branching --- .envrc.example | 2 +- .../workflows/{development.yml => build.yml} | 13 ++--- .github/workflows/production.yml | 33 ------------ .github/workflows/staging.yml | 53 ------------------- Gemfile.lock | 24 ++++----- README.md | 3 ++ app.config.ts | 3 +- fastlane/Fastfile | 33 +++++++----- src/components/Parse/HTML.tsx | 2 +- src/components/Timeline/Default.tsx | 2 +- src/components/Timeline/Notifications.tsx | 5 +- .../Timeline/Shared/FullConversation.tsx | 8 ++- src/startup/sentry.ts | 1 - 13 files changed, 54 insertions(+), 128 deletions(-) rename .github/workflows/{development.yml => build.yml} (94%) delete mode 100644 .github/workflows/production.yml delete mode 100644 .github/workflows/staging.yml diff --git a/.envrc.example b/.envrc.example index e5077692..0cf681c7 100644 --- a/.envrc.example +++ b/.envrc.example @@ -1,4 +1,4 @@ -export TOOOT_ENVIRONMENT="" +export ENVIRONMENT="development" export SENTRY_ORGANIZATION="" export SENTRY_PROJECT="" diff --git a/.github/workflows/development.yml b/.github/workflows/build.yml similarity index 94% rename from .github/workflows/development.yml rename to .github/workflows/build.yml index 55fe10b3..a0c7eb85 100644 --- a/.github/workflows/development.yml +++ b/.github/workflows/build.yml @@ -1,8 +1,5 @@ -name: Build development -on: - push: - branches: - - development +on: push + jobs: build: runs-on: macos-latest @@ -27,13 +24,13 @@ jobs: run: bundle install - name: -- Step 6 -- Run fastlane env: - TOOOT_ENVIRONMENT: development + ENVIRONMENT: ${{ secrets.ENVIRONMENT }} + LC_ALL: en_US.UTF-8 + LANG: en_US.UTF-8 SENTRY_ORGANIZATION: ${{ secrets.SENTRY_ORGANIZATION }} SENTRY_PROJECT: ${{ secrets.SENTRY_PROJECT }} SENTRY_AUTH_TOKEN: ${{ secrets.SENTRY_AUTH_TOKEN }} SENTRY_DSN: ${{ secrets.SENTRY_DSN }} - LC_ALL: en_US.UTF-8 - LANG: en_US.UTF-8 FASTLANE_USER: ${{ secrets.FASTLANE_USER }} MATCH_PASSWORD: ${{ secrets.MATCH_PASSWORD }} MATCH_GIT_URL: ${{ secrets.MATCH_GIT_URL }} diff --git a/.github/workflows/production.yml b/.github/workflows/production.yml deleted file mode 100644 index 9f484300..00000000 --- a/.github/workflows/production.yml +++ /dev/null @@ -1,33 +0,0 @@ -name: Publish production -on: - push: - branches: - - main -jobs: - publish: - runs-on: ubuntu-latest - steps: - - name: -- Step 1 -- Checkout code - uses: actions/checkout@v2 - with: - submodules: true - - name: -- Step 2 -- Setup node - uses: actions/setup-node@v2 - with: - node-version: 14.x - - name: -- Step 3 -- Use Expo action - uses: expo/expo-github-action@v5 - with: - expo-version: 4.x - expo-username: ${{ secrets.EXPO_USERNAME }} - expo-token: ${{ secrets.EXPO_TOKEN }} - - name: -- Step 4 -- Install dependencies - run: yarn install - - name: -- Step 5 -- Publish - env: - SENTRY_ORGANIZATION: ${{ secrets.SENTRY_ORGANIZATION }} - SENTRY_PROJECT: ${{ secrets.SENTRY_PROJECT }} - SENTRY_AUTH_TOKEN: ${{ secrets.SENTRY_AUTH_TOKEN }} - SENTRY_DSN: ${{ secrets.SENTRY_DSN }} - SENTRY_DEPLOY_ENV: production - run: expo publish --release-channel=${GITHUB_REF#refs/heads/} diff --git a/.github/workflows/staging.yml b/.github/workflows/staging.yml deleted file mode 100644 index 9925e39d..00000000 --- a/.github/workflows/staging.yml +++ /dev/null @@ -1,53 +0,0 @@ -name: Build staging -on: - push: - branches: - - staging -jobs: - build: - runs-on: macos-latest - steps: - - name: -- Step 1 -- Checkout code - uses: actions/checkout@v2 - with: - submodules: true - - name: -- Step 2 -- Setup node - uses: actions/setup-node@v2 - with: - node-version: 14.x - - name: -- Step 3 -- Use Expo action - uses: expo/expo-github-action@v5 - with: - expo-version: 4.x - expo-username: ${{ secrets.EXPO_USERNAME }} - expo-token: ${{ secrets.EXPO_TOKEN }} - - name: -- Step 4 -- Install node dependencies - run: yarn install - - name: -- Step 5 -- Install native dependencies - run: npx pod-install - - name: -- Step 6 -- Install ruby dependencies - run: bundle install - - name: -- Step 7 -- Run fastlane - env: - TOOOT_ENVIRONMENT: staging - SENTRY_ORGANIZATION: ${{ secrets.SENTRY_ORGANIZATION }} - SENTRY_PROJECT: ${{ secrets.SENTRY_PROJECT }} - SENTRY_AUTH_TOKEN: ${{ secrets.SENTRY_AUTH_TOKEN }} - SENTRY_DSN: ${{ secrets.SENTRY_DSN }} - LC_ALL: en_US.UTF-8 - LANG: en_US.UTF-8 - FASTLANE_USER: ${{ secrets.FASTLANE_USER }} - MATCH_PASSWORD: ${{ secrets.MATCH_PASSWORD }} - MATCH_GIT_URL: ${{ secrets.MATCH_GIT_URL }} - MATCH_GIT_BASIC_AUTHORIZATION: ${{ secrets.MATCH_GIT_BASIC_AUTHORIZATION }} - APP_STORE_CONNECT_API_KEY_KEY_ID: ${{ secrets.APP_STORE_CONNECT_API_KEY_KEY_ID }} - APP_STORE_CONNECT_API_KEY_ISSUER_ID: ${{ secrets.APP_STORE_CONNECT_API_KEY_ISSUER_ID }} - APP_STORE_CONNECT_API_KEY_KEY: ${{ secrets.APP_STORE_CONNECT_API_KEY_KEY }} - ANDROID_KEYSTORE: ${{ secrets.ANDROID_KEYSTORE }} - ANDROID_KEYSTORE_PASSWORD: ${{ secrets.ANDROID_KEYSTORE_PASSWORD }} - ANDROID_KEYSTORE_ALIAS: ${{ secrets.ANDROID_KEYSTORE_ALIAS }} - ANDROID_KEYSTORE_KEY_PASSWORD: ${{ secrets.ANDROID_KEYSTORE_KEY_PASSWORD }} - SUPPLY_JSON_KEY_DATA: ${{ secrets.SUPPLY_JSON_KEY_DATA }} - GH_PAT_GET_RELEASE: ${{ secrets.GH_PAT_GET_RELEASE }} - FL_GITHUB_RELEASE_API_BEARER: ${{ secrets.GITHUB_TOKEN }} - run: yarn app:build diff --git a/Gemfile.lock b/Gemfile.lock index aae7b9aa..3181cf5c 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -7,16 +7,16 @@ GEM artifactory (3.0.15) atomos (0.1.3) aws-eventstream (1.1.1) - aws-partitions (1.431.1) - aws-sdk-core (3.112.1) + aws-partitions (1.432.0) + aws-sdk-core (3.113.0) aws-eventstream (~> 1, >= 1.0.2) aws-partitions (~> 1, >= 1.239.0) aws-sigv4 (~> 1.1) jmespath (~> 1.0) - aws-sdk-kms (1.42.0) + aws-sdk-kms (1.43.0) aws-sdk-core (~> 3, >= 3.112.0) aws-sigv4 (~> 1.1) - aws-sdk-s3 (1.89.0) + aws-sdk-s3 (1.91.0) aws-sdk-core (~> 3, >= 3.112.0) aws-sdk-kms (~> 1) aws-sigv4 (~> 1.1) @@ -48,7 +48,7 @@ GEM faraday_middleware (1.0.0) faraday (~> 1.0) fastimage (2.2.3) - fastlane (2.176.0) + fastlane (2.178.0) CFPropertyList (>= 2.3, < 4.0.0) addressable (>= 2.3, < 3.0.0) artifactory (~> 3.0) @@ -98,7 +98,7 @@ GEM representable (~> 3.0) retriable (>= 2.0, < 4.0) signet (~> 0.12) - google-apis-core (0.2.1) + google-apis-core (0.3.0) addressable (~> 2.5, >= 2.5.1) googleauth (~> 0.14) httpclient (>= 2.8.1, < 3.0) @@ -108,17 +108,17 @@ GEM rexml signet (~> 0.14) webrick - google-apis-iamcredentials_v1 (0.1.0) + google-apis-iamcredentials_v1 (0.2.0) google-apis-core (~> 0.1) - google-apis-storage_v1 (0.2.0) + google-apis-storage_v1 (0.3.0) google-apis-core (~> 0.1) - google-cloud-core (1.5.0) + google-cloud-core (1.6.0) google-cloud-env (~> 1.0) google-cloud-errors (~> 1.0) - google-cloud-env (1.4.0) + google-cloud-env (1.5.0) faraday (>= 0.17.3, < 2.0) - google-cloud-errors (1.0.1) - google-cloud-storage (1.30.0) + google-cloud-errors (1.1.0) + google-cloud-storage (1.31.0) addressable (~> 2.5) digest-crc (~> 0.4) google-apis-iamcredentials_v1 (~> 0.1) diff --git a/README.md b/README.md index e69de29b..baa9c50d 100644 --- a/README.md +++ b/README.md @@ -0,0 +1,3 @@ +# [tooot](https://tooot.app/) app for Mastodon + +[![GPL-3.0](https://img.shields.io/github/license/tooot-app/push?style=flat-square)](LICENSE) ![GitHub Workflow Status](https://img.shields.io/github/workflow/status/tooot-app/app/build?style=flat-square) ![GitHub issues](https://img.shields.io/github/issues/tooot-app/app?style=flat-square) ![GitHub package.json version](https://img.shields.io/github/package-json/v/tooot-app/app?style=flat-square) ![Code Climate maintainability](https://img.shields.io/codeclimate/maintainability/tooot-app/app?style=flat-square) diff --git a/app.config.ts b/app.config.ts index 21412afe..692a247b 100644 --- a/app.config.ts +++ b/app.config.ts @@ -13,7 +13,6 @@ export default (): ExpoConfig => ({ privacy: 'hidden', assetBundlePatterns: ['assets/*'], extra: { - toootEnvironment: process.env.TOOOT_ENVIRONMENT, sentryDSN: process.env.SENTRY_DSN }, hooks: { @@ -25,7 +24,7 @@ export default (): ExpoConfig => ({ project: process.env.SENTRY_PROJECT, authToken: process.env.SENTRY_AUTH_TOKEN, setCommits: process.env.GITHUB_SHA || undefined, - deployEnv: process.env.TOOOT_ENVIRONMENT + deployEnv: process.env.ENVIRONMENT } } ] diff --git a/fastlane/Fastfile b/fastlane/Fastfile index f66ae8dd..89af0988 100644 --- a/fastlane/Fastfile +++ b/fastlane/Fastfile @@ -1,12 +1,12 @@ -fastlane_version "2.173.0" +fastlane_version "2.178.0" skip_docs ensure_env_vars( - env_vars: ["TOOOT_ENVIRONMENT", "SENTRY_ORGANIZATION", "SENTRY_PROJECT", "SENTRY_AUTH_TOKEN"] + env_vars: ["ENVIRONMENT", "SENTRY_ORGANIZATION", "SENTRY_PROJECT", "SENTRY_AUTH_TOKEN"] ) VERSIONS = read_json( json_path: "./package.json" )[:versions] -ENVIRONMENT = ENV["TOOOT_ENVIRONMENT"] +ENVIRONMENT = ENV["ENVIRONMENT"] VERSION = "#{VERSIONS[:major]}.#{VERSIONS[:minor]}" RELEASE_CHANNEL = "#{VERSIONS[:major]}-#{VERSIONS[:minor]}-#{ENVIRONMENT}" BUILD_NUMBER = ENV["GITHUB_RUN_NUMBER"] @@ -14,9 +14,9 @@ GITHUB_REPO = "tooot-app/app" case ENVIRONMENT when "development" GITHUB_RELEASE= "" -when "staging" +when "candidate" GITHUB_RELEASE = "v#{VERSION}-#{VERSIONS[:patch]}" -when "production" +when "release" GITHUB_RELEASE = "v#{VERSION}" end @@ -34,7 +34,7 @@ private_lane :prepare_appstore_ios do "NSAllowsArbitraryLoads" => false } ) - increment_build_number( xcodeproj: XCODEPROJ, build_number: BUILD_NUMBER ) + increment_build_number( xcodeproj: XCODEPROJ, build_number: BUILD_NUMBER, skip_info_plist: true ) app_store_connect_api_key end @@ -44,6 +44,11 @@ private_lane :update_expo_ios do set_info_plist_value( path: EXPO_PLIST, key: "EXUpdatesReleaseChannel", value: RELEASE_CHANNEL ) end +desc 'IOS: Install pods' +private_lane :install_pods_ios do + cocoapods(podfile: "./ios/", deployment: true) +end + desc "ANDROID: Prepare play store" private_lane :prepare_playstore_android do android_set_version_name( version_name: VERSION, gradle_file: "./android/app/build.gradle" ) @@ -81,17 +86,19 @@ private_lane :build_ios do build_ios_app( export_method: "development", output_directory: BUILD_DIRECTORY ) install_on_device( skip_wifi: true ) end - when "staging" + when "candidate" + install_pods_ios prepare_appstore_ios match( type: "appstore", readonly: true ) build_ios_app( export_method: "app-store", include_symbols: true, include_bitcode: true ) upload_to_testflight( demo_account_required: true, distribute_external: true, - groups: "内测用户", + groups: "测试用户", changelog: "Ready for testing" ) - when "production" + when "release" + install_pods_ios prepare_appstore_ios match( type: "appstore", readonly: true, include_bitcode: true ) build_ios_app( export_method: "app-store" ) @@ -114,7 +121,7 @@ private_lane :build_android do command: "install #{lane_context[SharedValues::GRADLE_APK_OUTPUT_PATH]}" ) end - when "staging" + when "candidate" prepare_playstore_android build_android_app( task: 'clean bundle', @@ -138,7 +145,7 @@ private_lane :build_android do skip_upload_images: true, skip_upload_screenshots: true ) - when "production" + when "release" end end @@ -151,9 +158,9 @@ lane :build do build_ios build_android case ENVIRONMENT - when "staging" + when "candidate" github_release(prerelease: true) - when "production" + when "release" github_release(prerelease: false) end end diff --git a/src/components/Parse/HTML.tsx b/src/components/Parse/HTML.tsx index 2ceabe2d..456daf09 100644 --- a/src/components/Parse/HTML.tsx +++ b/src/components/Parse/HTML.tsx @@ -83,7 +83,7 @@ const renderNode = ({ = ({ {!disableDetails && actualStatus.card && ( )} - + {queryKey && !disableDetails && ( diff --git a/src/components/Timeline/Notifications.tsx b/src/components/Timeline/Notifications.tsx index 36af6fd0..f09ac682 100644 --- a/src/components/Timeline/Notifications.tsx +++ b/src/components/Timeline/Notifications.tsx @@ -121,7 +121,10 @@ const TimelineNotifications: React.FC = ({ {notification.status.card && ( )} - + ) : null} diff --git a/src/components/Timeline/Shared/FullConversation.tsx b/src/components/Timeline/Shared/FullConversation.tsx index 16be2d91..b69a71cf 100644 --- a/src/components/Timeline/Shared/FullConversation.tsx +++ b/src/components/Timeline/Shared/FullConversation.tsx @@ -1,3 +1,4 @@ +import { QueryKeyTimeline } from '@utils/queryHooks/timeline' import { StyleConstants } from '@utils/styles/constants' import { useTheme } from '@utils/styles/ThemeManager' import React from 'react' @@ -5,15 +6,18 @@ import { useTranslation } from 'react-i18next' import { Text } from 'react-native' export interface Props { + queryKey?: QueryKeyTimeline status: Mastodon.Status } const TimelineFullConversation = React.memo( - ({ status }: Props) => { + ({ queryKey, status }: Props) => { const { t } = useTranslation('componentTimeline') const { theme } = useTheme() - return status.in_reply_to_account_id && + return queryKey && + queryKey[1].page !== 'Toot' && + status.in_reply_to_account_id && (status.mentions.length === 0 || status.mentions.filter( mention => mention.id !== status.in_reply_to_account_id diff --git a/src/startup/sentry.ts b/src/startup/sentry.ts index 38122a5c..fe9b06b3 100644 --- a/src/startup/sentry.ts +++ b/src/startup/sentry.ts @@ -7,7 +7,6 @@ const sentry = () => { log('log', 'Sentry', 'initializing') Sentry.init({ dsn: Constants.manifest.extra.sentryDSN, - environment: Constants.manifest.extra.toootEnvironment, enableInExpoDevelopment: false, debug: __DEV__ ||