Skip to content

Commit

Permalink
feat: update share copy (#585)
Browse files Browse the repository at this point in the history
* feat: update share copy

* chore: remove env dependent game url
  • Loading branch information
jsgalarraga authored Jun 25, 2024
1 parent 4ed5052 commit f2c359f
Show file tree
Hide file tree
Showing 7 changed files with 11 additions and 23 deletions.
5 changes: 1 addition & 4 deletions .github/workflows/deploy_app_dev.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,6 @@ on:
branches:
- main

env:
CROSSWORD_URL: https://e7b2896c65fabc0480edc6c0e.web.app

jobs:
deploy-dev:
runs-on: ubuntu-latest
Expand All @@ -32,7 +29,7 @@ jobs:
channel: beta
flutter-version: 3.23.0-0.1.pre
- run: flutter packages get
- run: flutter build web -t lib/main_development.dart --dart-define CROSSWORD_URL=${{ env.CROSSWORD_URL }} --dart-define RECAPTCHA_KEY=${{ secrets.RECAPTCHA_KEY }} --wasm
- run: flutter build web -t lib/main_development.dart --dart-define RECAPTCHA_KEY=${{ secrets.RECAPTCHA_KEY }} --wasm

- name: Move build files to public folder
run: |
Expand Down
5 changes: 1 addition & 4 deletions .github/workflows/deploy_app_prod.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,6 @@ name: deploy_app_prod

on: workflow_dispatch

env:
CROSSWORD_URL: https://crossword.withgoogle.com

jobs:
deploy-dev:
runs-on: ubuntu-latest
Expand All @@ -29,7 +26,7 @@ jobs:
channel: beta
flutter-version: 3.23.0-0.1.pre
- run: flutter packages get
- run: flutter build web -t lib/main_production.dart --dart-define CROSSWORD_URL=${{ env.CROSSWORD_URL }} --dart-define RECAPTCHA_KEY=${{ secrets.RECAPTCHA_KEY_PROD }} --wasm
- run: flutter build web -t lib/main_production.dart --dart-define RECAPTCHA_KEY=${{ secrets.RECAPTCHA_KEY_PROD }} --wasm

- name: Move build files to public folder
run: |
Expand Down
5 changes: 1 addition & 4 deletions .github/workflows/deploy_app_staging.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,6 @@ name: deploy_app_staging

on: workflow_dispatch

env:
CROSSWORD_URL: https://stg-e7b2896c65fabc0480edc6c0e.web.app

jobs:
deploy-dev:
runs-on: ubuntu-latest
Expand All @@ -29,7 +26,7 @@ jobs:
channel: beta
flutter-version: 3.23.0-0.1.pre
- run: flutter packages get
- run: flutter build web -t lib/main_staging.dart --dart-define CROSSWORD_URL=${{ env.CROSSWORD_URL }} --dart-define RECAPTCHA_KEY=${{ secrets.RECAPTCHA_KEY }} --wasm
- run: flutter build web -t lib/main_staging.dart --dart-define RECAPTCHA_KEY=${{ secrets.RECAPTCHA_KEY }} --wasm

- name: Move build files to public folder
run: |
Expand Down
10 changes: 5 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,33 +22,33 @@ This project has different entry points.
- `main_local.dart` that targets a local api that should be run first (see how to do it [here][api_readme]).

```sh
$ flutter run -d chrome --target lib/main_local.dart --web-port 24514 --dart-define RECAPTCHA_KEY=<RECAPTCHA_KEY> --dart-define APPCHECK_DEBUG_TOKEN=<APPCHECK_DEBUG_TOKEN> --dart-define CROSSWORD_URL=https://crossword.withgoogle.com
$ flutter run -d chrome --target lib/main_local.dart --web-port 24514 --dart-define RECAPTCHA_KEY=<RECAPTCHA_KEY> --dart-define APPCHECK_DEBUG_TOKEN=<APPCHECK_DEBUG_TOKEN>
```

The specified web port is just an example that matches with the one set in the [helper script][start_api_script] to run the api.

- `main_development.dart` that targets the dev api.

```sh
$ flutter run -d chrome --target lib/main_development.dart --dart-define RECAPTCHA_KEY=<RECAPTCHA_KEY> --dart-define APPCHECK_DEBUG_TOKEN=<APPCHECK_DEBUG_TOKEN> --dart-define CROSSWORD_URL=https://crossword.withgoogle.com
$ flutter run -d chrome --target lib/main_development.dart --dart-define RECAPTCHA_KEY=<RECAPTCHA_KEY> --dart-define APPCHECK_DEBUG_TOKEN=<APPCHECK_DEBUG_TOKEN>
```

- `main_debug.dart` that targets the dev api and adds a visual layer to debug the crossword sections, their position, fps and other items.

```sh
$ flutter run -d chrome --target lib/main_debug.dart --dart-define RECAPTCHA_KEY=<RECAPTCHA_KEY> --dart-define APPCHECK_DEBUG_TOKEN=<APPCHECK_DEBUG_TOKEN> --dart-define CROSSWORD_URL=https://crossword.withgoogle.com
$ flutter run -d chrome --target lib/main_debug.dart --dart-define RECAPTCHA_KEY=<RECAPTCHA_KEY> --dart-define APPCHECK_DEBUG_TOKEN=<APPCHECK_DEBUG_TOKEN>
```

- `main_staging.dart` that targets the staging api.

```sh
$ flutter run -d chrome --target lib/main_staging.dart --dart-define RECAPTCHA_KEY=<RECAPTCHA_KEY> --dart-define CROSSWORD_URL=https://crossword.withgoogle.com
$ flutter run -d chrome --target lib/main_staging.dart --dart-define RECAPTCHA_KEY=<RECAPTCHA_KEY>
```

- `main_production.dart` that targets the production api.

```sh
$ flutter run -d chrome --target lib/main_production.dart --dart-define RECAPTCHA_KEY=<RECAPTCHA_KEY> --dart-define CROSSWORD_URL=https://crossword.withgoogle.com
$ flutter run -d chrome --target lib/main_production.dart --dart-define RECAPTCHA_KEY=<RECAPTCHA_KEY>
```

_\*I/O Crossword works on Web._
Expand Down
2 changes: 1 addition & 1 deletion lib/extensions/context_ext.dart
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ extension ContextExt on BuildContext {

Future<void> shareTwitter({required String shareUrl}) {
final content = _encode([
'Check out IOCrossword #GoogleIO!',
'Check out #IOCrossword built for Google I/O 2024!',
shareUrl,
]);

Expand Down
5 changes: 1 addition & 4 deletions lib/project_details/link/project_details_links.dart
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,7 @@ class ProjectDetailsLinks {
static const claimBadge =
'https://developers.google.com/profile/badges/events/io/2024/crossword/award';
static const googleAI = 'https://ai.google.dev/';
static const crossword = String.fromEnvironment(
'CROSSWORD_URL',
defaultValue: 'https://crossword.withgoogle.com',
);
static const crossword = 'https://crossword.withgoogle.com';
static const developerPathway =
'https://developers.google.com/learn/pathways/solution-crossword';
static const geminiDeveloperCompetition = 'https://ai.google.dev/competition';
Expand Down
2 changes: 1 addition & 1 deletion test/share/widgets/share_dialog_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ void main() {

verify(
() => urlLauncher.launchUrl(
'https://twitter.com/intent/tweet?text=Check%20out%20IOCrossword%20%23GoogleIO!%0A$url',
'https://twitter.com/intent/tweet?text=Check%20out%20%23IOCrossword%20built%20for%20Google%20I/O%202024!%0A$url',
any(),
),
).called(1);
Expand Down

0 comments on commit f2c359f

Please sign in to comment.