-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: daily deals, rewards and circuit items now open the codex (#548)
ci: bump version direclty semantic-release-pub just broke out of now where so for the time being new pipline with more control
- Loading branch information
1 parent
c147175
commit 9a531a7
Showing
29 changed files
with
496 additions
and
442 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -48,16 +48,11 @@ jobs: | |
path: "build/app/outputs/flutter-apk/app-*-dev-release.apk" | ||
|
||
ios: | ||
runs-on: macos-13 | ||
runs-on: macos-latest | ||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v4 | ||
|
||
- name: Setup Xcode version | ||
uses: maxim-lobanov/[email protected] | ||
with: | ||
xcode-version: "^15.0.1" | ||
|
||
- uses: ruby/setup-ruby@v1 | ||
with: | ||
ruby-version: 3.3.0 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -11,12 +11,47 @@ jobs: | |
with: | ||
fetch-tags: true | ||
token: ${{ secrets.GH_TOKEN }} | ||
|
||
- name: Semantic Release | ||
id: semantic | ||
uses: cycjimmy/[email protected] | ||
env: | ||
GH_TOKEN: ${{ secrets.GH_TOKEN }} | ||
with: | ||
extra_plugins: | | ||
@semantic-release/git | ||
semantic-release-pub | ||
semantic_version: 24.2.0 | ||
|
||
- name: Bump version | ||
if: steps.semantic.outputs.new_release_published == 'true' | ||
env: | ||
NEW_RELEASE: ${{ steps.semantic.outputs.new_release_version }} | ||
run: | | ||
version=$(grep '^version:' pubspec.yaml | awk '{print $2}') | ||
version_code=$(echo $version | sed 's/.*+//') | ||
new_version="${NEW_RELEASE}+$((version_code + 1))" | ||
sed -i "s/^version: .*/version: ${new_version}/" pubspec.yaml | ||
- name: Commit and push changes | ||
if: steps.semantic.outputs.new_release_published == 'true' | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
RELEASE_NOTES: ${{ steps.semantic.outputs.new_release_notes}} | ||
NEW_RELEASE: ${{ steps.semantic.outputs.new_release_version }} | ||
run: | | ||
git config user.name "github-actions[bot]" | ||
git config user.email "github-actions[bot]@users.noreply.github.com" | ||
git add pubspec.yaml | ||
git commit -m "chore(release): $NEW_RELEASE [skip ci]" -m "$RELEASE_NOTES" --no-verify | ||
git push | ||
- name: Create Release | ||
if: steps.semantic.outputs.new_release_published == 'true' | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
RELEASE_NOTES: ${{ steps.semantic.outputs.new_release_notes }} | ||
NEW_RELEASE: ${{ steps.semantic.outputs.new_release_version }} | ||
PRERELEASE: ${{ contains(steps.semantic.outputs.new_release_channel, 'beta') }} | ||
run: gh release create v$NEW_RELEASE --notes "$RELEASE_NOTES" --target ${{ github.sha }} $([ "$PRERELEASE" = "true" ] && echo "--prerelease") | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,37 +1,85 @@ | ||
import 'package:bloc/bloc.dart'; | ||
import 'dart:async'; | ||
|
||
import 'package:collection/collection.dart'; | ||
import 'package:equatable/equatable.dart'; | ||
import 'package:hydrated_bloc/hydrated_bloc.dart'; | ||
import 'package:navis/utils/utils.dart'; | ||
import 'package:sentry_flutter/sentry_flutter.dart'; | ||
import 'package:warframestat_client/warframestat_client.dart'; | ||
import 'package:warframestat_repository/warframestat_repository.dart'; | ||
|
||
part 'item_state.dart'; | ||
|
||
class ItemCubit extends Cubit<ItemState> { | ||
ItemCubit(this.repo) : super(ItemInitial()); | ||
class ItemCubit extends HydratedCubit<ItemState> { | ||
ItemCubit(this.name, this.repo) : super(ItemInitial()); | ||
|
||
final String name; | ||
final WarframestatRepository repo; | ||
|
||
Future<void> fetchItem(String uniqueName) async { | ||
try { | ||
Item item; | ||
if (await ConnectionManager.hasInternetConnection) { | ||
item = await repo.fetchItem(uniqueName); | ||
} | ||
Future<void> fetchItem() async { | ||
final item = await _handleItemFetch(() async => repo.fetchItem(name)); | ||
|
||
item = await ConnectionManager.call( | ||
() async => repo.fetchItem(uniqueName), | ||
); | ||
emit(ItemFetchSuccess(item)); | ||
} | ||
|
||
Future<void> fetchByName() async { | ||
final items = await _handleItemFetch(() async => repo.searchItems(name)); | ||
|
||
final item = items | ||
.where((item) => item.imageName != null) | ||
.firstWhereOrNull((item) => name == item.name); | ||
|
||
if (item == null) return emit(const NoItemFound()); | ||
|
||
emit(ItemFetchSuccess(item)); | ||
} | ||
|
||
Future<void> fetchIncarnonGenesis() async { | ||
final items = await _handleItemFetch( | ||
() async => repo.searchItems('Incarnon'), | ||
); | ||
|
||
final item = items.where((item) => item.imageName != null).firstWhereOrNull( | ||
(item) { | ||
return name.replaceAll(' ', '') == item.name.replaceAll(' ', ''); | ||
}, | ||
); | ||
|
||
if (item == null) return emit(const NoItemFound()); | ||
|
||
emit(ItemFetchSucess(item)); | ||
emit(ItemFetchSuccess(item)); | ||
} | ||
|
||
Future<T> _handleItemFetch<T>(FutureOr<T> Function() compute) async { | ||
try { | ||
return ConnectionManager.call(compute); | ||
} catch (e, s) { | ||
await Sentry.captureException( | ||
e, | ||
stackTrace: s, | ||
hint: Hint.withMap({'uniqueName': uniqueName}), | ||
hint: Hint.withMap({'query': name}), | ||
); | ||
|
||
emit(const ItemFetchFailure('Failed to parse item')); | ||
|
||
rethrow; | ||
} | ||
} | ||
|
||
@override | ||
String get id => name; | ||
|
||
@override | ||
ItemState? fromJson(Map<String, dynamic> json) { | ||
final item = MinimalItem.fromJson(json); | ||
|
||
return ItemFetchSuccess(item); | ||
} | ||
|
||
@override | ||
Map<String, dynamic>? toJson(ItemState state) { | ||
if (state is! ItemFetchSuccess) return null; | ||
|
||
return state.item.toJson(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.