Skip to content

feat: use flutter templates repository #155

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
57 changes: 8 additions & 49 deletions .github/workflows/create-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,52 +18,11 @@ env:

jobs:
create_release:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
with:
token: ${{ secrets.BOT_ACCESS_TOKEN }}
fetch-depth: 0
- name: Setup git
run: |
git config user.name "nesquikm"
git config user.email "[email protected]"
- uses: subosito/flutter-action@v2
with:
flutter-version: '3.10.2'
channel: 'stable'
cache: true
cache-key: flutter-:os:-:channel:-:version:-:arch:-:hash:-${{ hashFiles('**/pubspec.lock') }}
- uses: bluefireteam/melos-action@v2

- name: Create the new version(s)
run: melos version -a --yes ${{ inputs.version_parameters }}

- name: Create Pull Request
uses: peter-evans/[email protected]
with:
token: ${{ secrets.BOT_ACCESS_TOKEN }}
commit-message: "chore: version bump"
committer: nesquikm <[email protected]>
author: ${{ github.actor }} <${{ github.actor }}@users.noreply.github.com>
signoff: false
branch: version-bump
delete-branch: true
title: "chore: version bump"
body: |
## Description

This is an automated PR to bump the version of the package.

## Type of Change

- [x] 🗑️ Chore

labels: |
version_bump
automated_pr
draft: false

- name: Push modified tags
run: git push --tags
uses: broxus/flutter_templates/.github/workflows/version.yaml@main
with:
version_parameters: ${{ inputs.version_parameters }}
user_name: 'nesquikm'
user_email: '[email protected]'
push_tags: true
secrets:
token: ${{ secrets.BOT_ACCESS_TOKEN }}
65 changes: 5 additions & 60 deletions .github/workflows/publish-release-fnb.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,66 +13,11 @@ permissions:

jobs:
publish_github_release:
# macOS because we can cross-compile to all other platforms from it
runs-on: macos-latest

steps:
- uses: actions/checkout@v3
- uses: subosito/flutter-action@v2
with:
flutter-version: '3.10.2'
channel: 'stable'
cache: true
cache-key: flutter-:os:-:channel:-:version:-:arch:-:hash:-${{ hashFiles('**/pubspec.lock') }}
- uses: bluefireteam/melos-action@v2
- uses: goto-bus-stop/setup-zig@v2
- uses: KyleMayes/install-llvm-action@v1
with:
version: "15"
- uses: actions-rs/toolchain@v1
with:
toolchain: stable
- name: Set up cargo cache
uses: actions/cache@v3
continue-on-error: false
with:
path: |
~/.cargo/bin/
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
target/
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
restore-keys: ${{ runner.os }}-cargo-
- uses: nttld/setup-ndk@v1
with:
ndk-version: r25b

- name: Build all library binaries
run: melos run build

- name: Create GitHub release
uses: softprops/action-gh-release@v1
with:
files: platform-build/*
uses: ./.github/workflows/publish-release-gh.yml

publish_pub_release:
needs: publish_github_release
runs-on: ubuntu-latest
permissions:
id-token: write # This is required for authentication using OIDC

steps:
- uses: actions/checkout@v3
- uses: dart-lang/setup-dart@v1
- uses: subosito/flutter-action@v2
with:
flutter-version: '3.10.2'
channel: 'stable'
cache: true
cache-key: flutter-:os:-:channel:-:version:-:arch:-:hash:-${{ hashFiles('**/pubspec.lock') }}
- uses: bluefireteam/melos-action@v2
- name: Dry-run publish to pub.dev
run: melos publish -y --dry-run --scope="flutter_nekoton_bridge"
- name: Publish to pub.dev
run: melos publish -y --no-dry-run --scope="flutter_nekoton_bridge"
uses: broxus/flutter_templates/.github/workflows/publish-package.yaml@main
with:
publish_gh: false
melos_params: '--scope="flutter_nekoton_bridge"'
55 changes: 55 additions & 0 deletions .github/workflows/publish-release-gh.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
name: Publish GitHub release

on:
workflow_call:

env:
CARGO_INCREMENTAL: "1"

permissions:
contents: write

jobs:
publish_github_release:
# macOS because we can cross-compile to all other platforms from it
runs-on: macos-latest

steps:
- uses: actions/checkout@v3
- uses: subosito/flutter-action@v2
with:
flutter-version: '3.10.2'
channel: 'stable'
cache: true
cache-key: flutter-:os:-:channel:-:version:-:arch:-:hash:-${{ hashFiles('**/pubspec.lock') }}
- uses: bluefireteam/melos-action@v2
- uses: goto-bus-stop/setup-zig@v2
- uses: KyleMayes/install-llvm-action@v1
with:
version: "15"
- uses: actions-rs/toolchain@v1
with:
toolchain: stable
- name: Set up cargo cache
uses: actions/cache@v3
continue-on-error: false
with:
path: |
~/.cargo/bin/
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
target/
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
restore-keys: ${{ runner.os }}-cargo-
- uses: nttld/setup-ndk@v1
with:
ndk-version: r25b

- name: Build all library binaries
run: melos run build

- name: Create GitHub release
uses: softprops/action-gh-release@v1
with:
files: platform-build/*
65 changes: 5 additions & 60 deletions .github/workflows/publish-release-nb.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,66 +13,11 @@ permissions:

jobs:
publish_github_release:
# macOS because we can cross-compile to all other platforms from it
runs-on: macos-latest

steps:
- uses: actions/checkout@v3
- uses: subosito/flutter-action@v2
with:
flutter-version: '3.10.2'
channel: 'stable'
cache: true
cache-key: flutter-:os:-:channel:-:version:-:arch:-:hash:-${{ hashFiles('**/pubspec.lock') }}
- uses: bluefireteam/melos-action@v2
- uses: goto-bus-stop/setup-zig@v2
- uses: KyleMayes/install-llvm-action@v1
with:
version: "15"
- uses: actions-rs/toolchain@v1
with:
toolchain: stable
- name: Set up cargo cache
uses: actions/cache@v3
continue-on-error: false
with:
path: |
~/.cargo/bin/
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
target/
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
restore-keys: ${{ runner.os }}-cargo-
- uses: nttld/setup-ndk@v1
with:
ndk-version: r25b

- name: Build all library binaries
run: melos run build

- name: Create GitHub release
uses: softprops/action-gh-release@v1
with:
files: platform-build/*
uses: ./.github/workflows/publish-release-gh.yml

publish_pub_release:
needs: publish_github_release
runs-on: ubuntu-latest
permissions:
id-token: write # This is required for authentication using OIDC

steps:
- uses: actions/checkout@v3
- uses: dart-lang/setup-dart@v1
- uses: subosito/flutter-action@v2
with:
flutter-version: '3.10.2'
channel: 'stable'
cache: true
cache-key: flutter-:os:-:channel:-:version:-:arch:-:hash:-${{ hashFiles('**/pubspec.lock') }}
- uses: bluefireteam/melos-action@v2
- name: Dry-run publish to pub.dev
run: melos publish -y --dry-run --scope="nekoton_bridge"
- name: Publish to pub.dev
run: melos publish -y --no-dry-run --scope="nekoton_bridge"
uses: broxus/flutter_templates/.github/workflows/publish-package.yaml@main
with:
publish_gh: false
melos_params: '--scope="nekoton_bridge"'
121 changes: 1 addition & 120 deletions packages/flutter_nekoton_bridge/analysis_options.yaml
Original file line number Diff line number Diff line change
@@ -1,123 +1,4 @@
include: package:flutter_lints/flutter.yaml

# # Additional information about this file can be found at
# # https://dart.dev/guides/language/analysis-options

include: package:broxus_flutter_analysis/analysis_options.yaml
analyzer:
exclude:
- '**.freezed.dart'
- '**.g.dart'
- '**_generated**.dart'
- '**.reflectable.dart'
language:
strict-inference: true
strict-raw-types: true
errors:
invalid_annotation_target: ignore

linter:
rules:
# Custom lints
- prefer_single_quotes

# Core Dart lints
- avoid_empty_else
- avoid_relative_lib_imports
- avoid_shadowing_type_parameters
- avoid_types_as_parameter_names
- await_only_futures
- camel_case_extensions
- camel_case_types
- curly_braces_in_flow_control_structures
- depend_on_referenced_packages
- empty_catches
- file_names
- hash_and_equals
- iterable_contains_unrelated_type
- list_remove_unrelated_type
- no_duplicate_case_values
- non_constant_identifier_names
- null_check_on_nullable_type_parameter
- package_prefixed_library_names
- prefer_generic_function_type_aliases
- prefer_is_empty
- prefer_is_not_empty
- prefer_iterable_whereType
- prefer_typing_uninitialized_variables
- provide_deprecation_message
- unnecessary_overrides
- unrelated_type_equality_checks
- valid_regexps
- void_checks

# Recommended Dart lints
- always_require_non_null_named_parameters
- annotate_overrides
- avoid_function_literals_in_foreach_calls
- avoid_init_to_null
- avoid_null_checks_in_equality_operators
- avoid_renaming_method_parameters
- avoid_return_types_on_setters
- avoid_returning_null_for_void
- avoid_single_cascade_in_expression_statements
- constant_identifier_names
- control_flow_in_finally
- empty_constructor_bodies
- empty_statements
- exhaustive_cases
- implementation_imports
- library_names
- library_prefixes
- library_private_types_in_public_api
- no_leading_underscores_for_library_prefixes
- no_leading_underscores_for_local_identifiers
- null_closures
- overridden_fields
- package_names
- prefer_adjacent_string_concatenation
- prefer_collection_literals
- prefer_conditional_assignment
- prefer_contains
- prefer_final_fields
- prefer_for_elements_to_map_fromIterable
- prefer_function_declarations_over_variables
- prefer_if_null_operators
- prefer_initializing_formals
- prefer_inlined_adds
- prefer_interpolation_to_compose_strings
- prefer_is_not_operator
- prefer_null_aware_operators
- prefer_spread_collections
- prefer_void_to_null
- recursive_getters
- slash_for_doc_comments
- type_init_formals
- unnecessary_brace_in_string_interps
- unnecessary_const
- unnecessary_constructor_name
- unnecessary_getters_setters
- unnecessary_late
- unnecessary_new
- unnecessary_null_aware_assignments
- unnecessary_null_in_if_null_operators
- unnecessary_nullable_for_final_variable_declarations
- unnecessary_string_escapes
- unnecessary_string_interpolations
- unnecessary_this
- use_function_type_syntax_for_parameters
- use_rethrow_when_possible

# Flutter lints
- avoid_print
- avoid_unnecessary_containers
- avoid_web_libraries_in_flutter
- no_logic_in_create_state
- prefer_const_constructors
- prefer_const_constructors_in_immutables
- prefer_const_declarations
- prefer_const_literals_to_create_immutables
- sized_box_for_whitespace
- sort_child_properties_last
- use_build_context_synchronously
- use_full_hex_values_for_flutter_colors
- use_key_in_widget_constructors
Original file line number Diff line number Diff line change
@@ -1 +1 @@
include: ../analysis_options.yaml
include: package:broxus_flutter_analysis/analysis_options.yaml
Loading