From 7124b135cf9a2950af0cb412446549b6a5f5f1b4 Mon Sep 17 00:00:00 2001 From: ethicnology Date: Thu, 26 Oct 2023 15:08:39 +0200 Subject: [PATCH] feat: github action --- .github/workflows/crossplatform.yml | 100 ++++++++++++++++++++++++++++ lib/widgets/add_torrent.dart | 12 ++-- pubspec.lock | 7 -- pubspec.yaml | 46 +------------ 4 files changed, 108 insertions(+), 57 deletions(-) create mode 100644 .github/workflows/crossplatform.yml diff --git a/.github/workflows/crossplatform.yml b/.github/workflows/crossplatform.yml new file mode 100644 index 0000000..56d7d68 --- /dev/null +++ b/.github/workflows/crossplatform.yml @@ -0,0 +1,100 @@ +name: flutter +on: [push] +env: + APP_NAME: magneto + +jobs: + linux: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - uses: subosito/flutter-action@v2 + with: + channel: 'stable' + - run: | + sudo apt-get update -y + sudo apt-get install -y ninja-build libgtk-3-dev + - run: flutter config --enable-linux-desktop + - run: flutter build linux --release + - uses: actions/upload-artifact@v3 + with: + name: linux_x64_${{ env.APP_NAME }} + path: build/linux/x64/release/bundle + + android: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - uses: actions/setup-java@v2 + with: + distribution: 'zulu' + java-version: '11' + - uses: subosito/flutter-action@v2 + with: + channel: 'stable' + - run: flutter pub get + - run: flutter build apk --release + - run: flutter build appbundle --release + - uses: actions/upload-artifact@v3 + with: + name: android_${{ env.APP_NAME }} + path: build/app/outputs/flutter-apk/app-release.apk + + windows: + runs-on: windows-latest + steps: + - uses: actions/checkout@v3 + - uses: subosito/flutter-action@v2 + with: + channel: 'beta' + - run: flutter config --enable-windows-desktop + - run: flutter build windows --release + - uses: actions/upload-artifact@v3 + with: + name: windows_x64_${{ env.APP_NAME }} + path: build\windows\x64\runner\Release + + ios: + runs-on: macos-latest + steps: + - uses: actions/checkout@v3 + - uses: subosito/flutter-action@v2 + with: + channel: 'stable' + architecture: x64 + - run: flutter pub get + - run: flutter build ios --release --no-codesign + - uses: actions/upload-artifact@v3 + with: + name: ios_x64_${{ env.APP_NAME }} + path: build/ios/iphoneos/Runner.app + + macos: + runs-on: macos-latest + steps: + - uses: actions/checkout@v3 + - uses: subosito/flutter-action@v2 + with: + channel: 'stable' + architecture: x64 + - run: flutter config --enable-macos-desktop + - run: flutter build macos --release + - uses: actions/upload-artifact@v3 + with: + name: macos_x64_${{ env.APP_NAME }} + path: build/macos/Build/Products/Release/${{ env.APP_NAME }}.app/Contents + + # macos_arm: + # runs-on: macos-latest + # steps: + # - uses: actions/checkout@v3 + # - uses: subosito/flutter-action@v2 + # with: + # channel: 'stable' + # architecture: arm64 + # - run: flutter config --enable-macos-desktop + # - run: flutter build macos --release + # - uses: actions/upload-artifact@v3 + # with: + # name: macos_arm64_${{ env.APP_NAME }} + # path: build/macos/Build/Products/Release/${{ env.APP_NAME }}.app/Contents diff --git a/lib/widgets/add_torrent.dart b/lib/widgets/add_torrent.dart index b3f02b8..42f1119 100644 --- a/lib/widgets/add_torrent.dart +++ b/lib/widgets/add_torrent.dart @@ -3,7 +3,7 @@ import 'dart:convert'; import 'package:file_picker/file_picker.dart'; import 'package:flutter/material.dart'; import 'package:flutter/services.dart'; -import 'package:freeleech/freeleech.dart'; +// import 'package:freeleech/freeleech.dart'; import 'package:magneto/models/global.dart'; import 'package:provider/provider.dart'; @@ -111,11 +111,11 @@ class _EditTorrentState extends State { print(e); } } - var ids = [ - for (var t in addedTorrents) - if (t.$2.isNotEmpty) t.$2 - ]; - if (isLeech) freeleech(global.transmission, ids); + // var ids = [ + // for (var t in addedTorrents) + // if (t.$2.isNotEmpty) t.$2 + // ]; + // if (isLeech) freeleech(global.transmission, ids); setState(() {}); } }, diff --git a/pubspec.lock b/pubspec.lock index 888cfb2..2eb5eb3 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -128,13 +128,6 @@ packages: description: flutter source: sdk version: "0.0.0" - freeleech: - dependency: "direct main" - description: - path: "../freeleech" - relative: true - source: path - version: "1.0.0" http_parser: dependency: transitive description: diff --git a/pubspec.yaml b/pubspec.yaml index 525c06d..18dd398 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -21,12 +21,6 @@ version: 1.0.0+1 environment: sdk: '>=3.1.0 <4.0.0' -# Dependencies specify other packages that your package needs in order to work. -# To automatically upgrade your package dependencies to the latest versions -# consider running `flutter pub upgrade --major-versions`. Alternatively, -# dependencies can be manually updated by changing the version numbers below to -# the latest version available on pub.dev. To see which dependencies have newer -# versions available, run `flutter pub outdated`. dependencies: flutter: sdk: flutter @@ -34,8 +28,8 @@ dependencies: git: url: https://github.com/ethicnology/dart-transmission ref: main - freeleech: - path: ../freeleech + # freeleech: + # path: ../freeleech shared_preferences: ^2.2.1 file_picker: ^5.5.0 percent_indicator: ^4.2.3 @@ -45,12 +39,6 @@ dependencies: dev_dependencies: flutter_test: sdk: flutter - - # The "flutter_lints" package below contains a set of recommended lints to - # encourage good coding practices. The lint set provided by the package is - # activated in the `analysis_options.yaml` file located at the root of your - # package. See that file for information about deactivating specific lint - # rules and activating additional ones. flutter_lints: ^2.0.0 # For information on the generic Dart part of this file, see the @@ -58,39 +46,9 @@ dev_dependencies: # The following section is specific to Flutter packages. flutter: - - # The following line ensures that the Material Icons font is - # included with your application, so that you can use the icons in - # the material Icons class. uses-material-design: true # To add assets to your application, add an assets section, like this: assets: - assets/communities.svg - assets/clock_loader_40.svg - - # An image asset can refer to one or more resolution-specific "variants", see - # https://flutter.dev/assets-and-images/#resolution-aware - - # For details regarding adding assets from package dependencies, see - # https://flutter.dev/assets-and-images/#from-packages - - # To add custom fonts to your application, add a fonts section here, - # in this "flutter" section. Each entry in this list should have a - # "family" key with the font family name, and a "fonts" key with a - # list giving the asset and other descriptors for the font. For - # example: - # fonts: - # - family: Schyler - # fonts: - # - asset: fonts/Schyler-Regular.ttf - # - asset: fonts/Schyler-Italic.ttf - # style: italic - # - family: Trajan Pro - # fonts: - # - asset: fonts/TrajanPro.ttf - # - asset: fonts/TrajanPro_Bold.ttf - # weight: 700 - # - # For details regarding fonts from package dependencies, - # see https://flutter.dev/custom-fonts/#from-packages