diff --git a/.devcontainer/Dockerfile b/.devcontainer/Dockerfile new file mode 100644 index 0000000..1c46341 --- /dev/null +++ b/.devcontainer/Dockerfile @@ -0,0 +1,3 @@ +FROM ghcr.io/gdscparuluniversity/flutterdevcontainer:latest + +ENV DEVCONTAINER="true" diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json new file mode 100644 index 0000000..a4f9733 --- /dev/null +++ b/.devcontainer/devcontainer.json @@ -0,0 +1,26 @@ +{ + "name": "Ubuntu", + "build": { + "dockerfile": "Dockerfile", + // Update 'VARIANT' to pick an Ubuntu version: jammy / ubuntu-22.04, focal / ubuntu-20.04, bionic /ubuntu-18.04 + // Use ubuntu-22.04 or ubuntu-18.04 on local arm64/Apple Silicon. + "args": { "VARIANT": "ubuntu-22.04" } + }, + + "extensions": [ + "Dart-Code.flutter", + "alexisvt.flutter-snippets", + "lizebang.bash-extension-pack", + "shakram02.bash-beautify" + ], + + + // Use 'forwardPorts' to make a list of ports inside the container available locally. + // "forwardPorts": [], + + // Use 'postCreateCommand' to run commands after the container is created. + // "postCreateCommand": "uname -a", + + // Comment out to connect as root instead. More info: https://aka.ms/vscode-remote/containers/non-root. + "remoteUser": "vscode" +} diff --git a/.github/scripts/release_number.sh b/.github/scripts/release_number.sh new file mode 100644 index 0000000..8ad3212 --- /dev/null +++ b/.github/scripts/release_number.sh @@ -0,0 +1,15 @@ +#!/usr/bin/env bash + +repo_link="https://github.com/GDSCParulUniversity/Habit-Tracker-App" + +current_verision=$(git -c 'versionsort.suffix=-' ls-remote --tags --sort='v:refname' \ + $repo_link | tail -n1 | cut -d / -f 3 | cut -d V -f 2-) + +[[ -z $current_verision ]] && { + echo "NO release found?" + echo "Fallback to V0000" + current_verision=00 +} + +new_release="V$(($current_verision + 1))" +echo "VERSIONTAG=$new_release" diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci-pr-test.yaml similarity index 76% rename from .github/workflows/ci.yaml rename to .github/workflows/ci-pr-test.yaml index 2082753..30eb79d 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci-pr-test.yaml @@ -1,11 +1,5 @@ name: Habit Tracker App CI -on: - push: - branches: - - main - pull_request: - branches: - - main +on: pull_request jobs: @@ -28,4 +22,4 @@ jobs: - uses: actions/upload-artifact@v1 with: name: release-apk - path: build/app/outputs/apk/release/app-release.apk + path: build/app/outputs/flutter-apk/app-release.apk diff --git a/.github/workflows/ci-release.yaml b/.github/workflows/ci-release.yaml new file mode 100644 index 0000000..05bff8c --- /dev/null +++ b/.github/workflows/ci-release.yaml @@ -0,0 +1,67 @@ +name: Habit Tracker App CI +on: + push: + branches: + - main + + +jobs: + flutter_build: + name: Run flutter build + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - uses: actions/setup-java@v1 + with: + java-version: "12.x" + - uses: subosito/flutter-action@v2.6.1 + - name: "Flutter clean | get | build" + run: | + flutter pub get + flutter clean + flutter build apk --release + + - uses: actions/upload-artifact@v1 + with: + name: release-apk + path: build/app/outputs/flutter-apk/app-release.apk + + - name: Compute release tag + run: | + repo_link="https://github.com/GDSCParulUniversity/Habit-Tracker-App" + + current_verision=$(git -c 'versionsort.suffix=-' ls-remote --tags --sort='v:refname' \ + $repo_link | tail -n1 | cut -d / -f 3 | cut -d V -f 2-) + + [[ -z $current_verision ]] && { + echo "NO release found?" + echo "Fallback to V0" + current_verision=0 + } + + new_release="V$(($current_verision + 1))" + echo "VERSIONTAG=$new_release" >> $GITHUB_ENV + + - name: Generate release notes + run: | + echo "Habit Tracker ${VERSIONTAG}" > release.md + + - name: Create Release + id: create_release + uses: actions/create-release@v1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + tag_name: ${{ env.VERSIONTAG }} + release_name: ${{ env.VERSIONTAG }} + body_path: release.md + draft: false + prerelease: false + + - name: Upload assets + run: | + set -x + sleep 10 + hub release edit -F release.md -a build/app/outputs/flutter-apk/app-release.apk -m "$VERSIONTAG" "$VERSIONTAG" + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/pubspec.lock b/pubspec.lock index 7e362d1..8a47f76 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -7,7 +7,7 @@ packages: name: async url: "https://pub.dartlang.org" source: hosted - version: "2.8.2" + version: "2.9.0" bloc: dependency: transitive description: @@ -35,21 +35,14 @@ packages: name: characters url: "https://pub.dartlang.org" source: hosted - version: "1.2.0" - charcode: - dependency: transitive - description: - name: charcode - url: "https://pub.dartlang.org" - source: hosted - version: "1.3.1" + version: "1.2.1" clock: dependency: transitive description: name: clock url: "https://pub.dartlang.org" source: hosted - version: "1.1.0" + version: "1.1.1" collection: dependency: transitive description: @@ -57,13 +50,6 @@ packages: url: "https://pub.dartlang.org" source: hosted version: "1.16.0" - crypto: - dependency: transitive - description: - name: crypto - url: "https://pub.dartlang.org" - source: hosted - version: "3.0.2" cupertino_icons: dependency: "direct main" description: @@ -84,21 +70,7 @@ packages: name: fake_async url: "https://pub.dartlang.org" source: hosted - version: "1.3.0" - ffi: - dependency: transitive - description: - name: ffi - url: "https://pub.dartlang.org" - source: hosted - version: "2.0.1" - file: - dependency: transitive - description: - name: file - url: "https://pub.dartlang.org" - source: hosted - version: "6.1.4" + version: "1.3.1" flutter: dependency: "direct main" description: flutter @@ -118,53 +90,18 @@ packages: url: "https://pub.dartlang.org" source: hosted version: "2.0.1" - flutter_screenutil: - dependency: "direct main" - description: - name: flutter_screenutil - url: "https://pub.dartlang.org" - source: hosted - version: "5.5.4" - flutter_svg: - dependency: "direct main" - description: - name: flutter_svg - url: "https://pub.dartlang.org" - source: hosted - version: "1.1.5" flutter_test: dependency: "direct dev" description: flutter source: sdk version: "0.0.0" - google_fonts: - dependency: "direct main" - description: - name: google_fonts - url: "https://pub.dartlang.org" - source: hosted - version: "3.0.1" - http: - dependency: transitive - description: - name: http - url: "https://pub.dartlang.org" - source: hosted - version: "0.13.5" - http_parser: + js: dependency: transitive description: - name: http_parser + name: js url: "https://pub.dartlang.org" source: hosted - version: "4.0.1" - intl: - dependency: "direct main" - description: - name: intl - url: "https://pub.dartlang.org" - source: hosted - version: "0.17.0" + version: "0.6.4" lints: dependency: transitive description: @@ -178,21 +115,21 @@ packages: name: matcher url: "https://pub.dartlang.org" source: hosted - version: "0.12.11" + version: "0.12.12" material_color_utilities: dependency: transitive description: name: material_color_utilities url: "https://pub.dartlang.org" source: hosted - version: "0.1.4" + version: "0.2.0" meta: dependency: transitive description: name: meta url: "https://pub.dartlang.org" source: hosted - version: "1.7.0" + version: "1.8.0" nested: dependency: transitive description: @@ -206,98 +143,7 @@ packages: name: path url: "https://pub.dartlang.org" source: hosted - version: "1.8.1" - path_drawing: - dependency: transitive - description: - name: path_drawing - url: "https://pub.dartlang.org" - source: hosted - version: "1.0.1" - path_parsing: - dependency: transitive - description: - name: path_parsing - url: "https://pub.dartlang.org" - source: hosted - version: "1.0.1" - path_provider: - dependency: transitive - description: - name: path_provider - url: "https://pub.dartlang.org" - source: hosted - version: "2.0.11" - path_provider_android: - dependency: transitive - description: - name: path_provider_android - url: "https://pub.dartlang.org" - source: hosted - version: "2.0.20" - path_provider_ios: - dependency: transitive - description: - name: path_provider_ios - url: "https://pub.dartlang.org" - source: hosted - version: "2.0.11" - path_provider_linux: - dependency: transitive - description: - name: path_provider_linux - url: "https://pub.dartlang.org" - source: hosted - version: "2.1.7" - path_provider_macos: - dependency: transitive - description: - name: path_provider_macos - url: "https://pub.dartlang.org" - source: hosted - version: "2.0.6" - path_provider_platform_interface: - dependency: transitive - description: - name: path_provider_platform_interface - url: "https://pub.dartlang.org" - source: hosted - version: "2.0.5" - path_provider_windows: - dependency: transitive - description: - name: path_provider_windows - url: "https://pub.dartlang.org" - source: hosted - version: "2.1.3" - petitparser: - dependency: transitive - description: - name: petitparser - url: "https://pub.dartlang.org" - source: hosted - version: "5.0.0" - platform: - dependency: transitive - description: - name: platform - url: "https://pub.dartlang.org" - source: hosted - version: "3.1.0" - plugin_platform_interface: - dependency: transitive - description: - name: plugin_platform_interface - url: "https://pub.dartlang.org" - source: hosted - version: "2.1.3" - process: - dependency: transitive - description: - name: process - url: "https://pub.dartlang.org" - source: hosted - version: "4.2.4" + version: "1.8.2" provider: dependency: transitive description: @@ -316,7 +162,7 @@ packages: name: source_span url: "https://pub.dartlang.org" source: hosted - version: "1.8.2" + version: "1.9.1" stack_trace: dependency: transitive description: @@ -330,57 +176,35 @@ packages: name: stream_channel url: "https://pub.dartlang.org" source: hosted - version: "2.1.0" + version: "2.1.1" string_scanner: dependency: transitive description: name: string_scanner url: "https://pub.dartlang.org" source: hosted - version: "1.1.0" + version: "1.1.1" term_glyph: dependency: transitive description: name: term_glyph url: "https://pub.dartlang.org" source: hosted - version: "1.2.0" + version: "1.2.1" test_api: dependency: transitive description: name: test_api url: "https://pub.dartlang.org" source: hosted - version: "0.4.9" + version: "0.4.14" vector_math: dependency: transitive description: name: vector_math url: "https://pub.dartlang.org" source: hosted - version: "2.1.2" - win32: - dependency: transitive - description: - name: win32 - url: "https://pub.dartlang.org" - source: hosted - version: "3.0.0" - xdg_directories: - dependency: transitive - description: - name: xdg_directories - url: "https://pub.dartlang.org" - source: hosted - version: "0.2.0+2" - xml: - dependency: transitive - description: - name: xml - url: "https://pub.dartlang.org" - source: hosted - version: "6.1.0" + version: "2.1.4" sdks: - dart: ">=2.17.5 <3.0.0" - flutter: ">=3.0.0" - + dart: ">=2.18.0 <3.0.0" + flutter: ">=1.16.0"