Skip to content

Commit

Permalink
chore: Update Pub modules and dependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
PlugFox committed Aug 7, 2024
1 parent 050a7a8 commit 77b1258
Show file tree
Hide file tree
Showing 2 changed files with 41 additions and 23 deletions.
60 changes: 39 additions & 21 deletions .github/workflows/example-deploy-production.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,34 +13,54 @@ jobs:
options: --user root
timeout-minutes: 30
env:
pub-cache-name: pub
working-directory: ./example
steps:
- name: 🚂 Get latest code
uses: actions/checkout@v3

- name: 🗄️ Export pub cache directory
run: |
git config --global --add safe.directory /opt/flutter
export PUB_CACHE=$PWD/.pub_cache/
id: checkout
uses: actions/checkout@v4
with:
sparse-checkout: |
.github
pubspec.yaml
lib
test
analysis_options.yaml
CHANGELOG.md
example
- name: 🚃 Cache pub modules
id: cache-pub-modules
uses: actions/cache@v3
env:
cache-name: cache-pub-modules
- name: 📤 Restore Pub modules
id: cache-pub-restore
uses: actions/cache/restore@v4
with:
key: ${{ runner.os }}-pub-${{ env.cache-name }}-${{ hashFiles('**/pubspec.lock') }}
path: |
$PWD/.pub_cache/
$PWD/.dart_tool/
$PWD/.flutter-plugins
$PWD/.flutter-plugins-dependencies
$PWD/.packages
$HOME/.pub-cache
key: ${{ runner.os }}-${{ env.pub-cache-name }}-${{ hashFiles('**/pubspec.yaml') }}

- name: 👷 Get dependencies
- name: 🗄️ Export Pub cache directory
id: export-pub-cache
timeout-minutes: 1
run: |
export PUB_CACHE=$PWD/.pub_cache/
export PATH="$PATH":"$HOME/.pub-cache/bin"
echo "${HOME}/.pub-cache/bin" >> $GITHUB_PATH
- name: 👷 Install Dependencies
id: install-dependencies
timeout-minutes: 1
run: |
apt-get update && apt-get install -y lcov
flutter pub get
timeout-minutes: 5
dart pub global activate intl_utils
dart pub global run intl_utils:generate
- name: 📥 Save Pub modules
id: cache-pub-save
uses: actions/cache/save@v4
with:
path: |
$HOME/.pub-cache
key: ${{ runner.os }}-${{ env.pub-cache-name }}-${{ hashFiles('**/pubspec.yaml') }}

- name: 🖼️ Move images from assets to web
working-directory: ${{ env.working-directory }}
Expand All @@ -51,8 +71,6 @@ jobs:
- name: 🏗️ Codegen
working-directory: ${{ env.working-directory }}
run: |
dart pub global activate intl_utils
dart pub global run intl_utils:generate
flutter gen-l10n --arb-dir lib/src/common/localization --output-dir lib/src/common/localization/generated --template-arb-file intl_en.arb
dart run build_runner build --delete-conflicting-outputs --release
timeout-minutes: 5
Expand Down
4 changes: 2 additions & 2 deletions example/lib/src/common/widget/app_error.dart
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ class AppError extends StatelessWidget {
/// {@macro app_error}
const AppError({
this.error,
Key? key,
}) : super(key: key);
super.key,
});

/// Error
final Object? error;
Expand Down

0 comments on commit 77b1258

Please sign in to comment.