Skip to content

Commit

Permalink
September 2024 Release (#1321)
Browse files Browse the repository at this point in the history
  • Loading branch information
limwa authored Sep 13, 2024
2 parents 66e9b81 + 8240868 commit bd57543
Show file tree
Hide file tree
Showing 567 changed files with 6,715 additions and 3,903 deletions.
3 changes: 1 addition & 2 deletions .github/dependabot.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,9 @@ version: 2

updates:
- package-ecosystem: "pub"
directory: "/uni"
directory: "/packages/uni_app"
schedule:
interval: "daily"
ignore:
- dependency-name: "*"
update-types: ["version-update:semver-patch"]

2 changes: 1 addition & 1 deletion .github/workflows/app_version_integrity.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ jobs:
name: "Version integrity"
runs-on: ubuntu-latest
env:
APP_VERSION_PATH: "uni/app_version.txt"
APP_VERSION_PATH: "packages/uni_app/app_version.txt"
steps:
- uses: actions/checkout@v4

Expand Down
41 changes: 22 additions & 19 deletions .github/workflows/deploy.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,13 @@ jobs:
environment:
name: ${{ github.ref_name }}
env:
PROPERTIES_PATH: "android/key.properties"
JAVA_VERSION: "17.x"
FLUTTER_VERSION: "3.13.7"
APP_VERSION_PATH: "app_version.txt"
PUBSPEC_PATH: "pubspec.yaml"
PROPERTIES_PATH: android/key.properties
JAVA_VERSION: 21.x
APP_VERSION_PATH: app_version.txt
PUBSPEC_PATH: pubspec.yaml
defaults:
run:
working-directory: ./uni
working-directory: ./packages/uni_app
steps:
- uses: actions/checkout@v4
with:
Expand All @@ -39,7 +38,7 @@ jobs:
git fetch origin develop
git pull origin master
echo "DEVELOP_HASH=$(git rev-parse origin/develop)" >> $GITHUB_ENV
echo "MASTER_HASH=$(git rev-parse origin/master^2)" >> $GITHUB_ENV
echo "MASTER_HASH=$(git rev-parse origin/master^2)" >> $GITHUB_ENV
- name: Get latest version (develop)
if: github.ref != 'refs/heads/master'
Expand All @@ -49,15 +48,15 @@ jobs:
google_service_account_json: ${{ secrets.GOOGLE_SERVICE_ACCOUNT_JSON }}
package_name: ${{ secrets.ANDROID_PACKAGE_NAME }}
track: "beta"

- name: Get latest production version
uses: LuisDuarte1/[email protected]
id: latest-production-version
with:
google_service_account_json: ${{ secrets.GOOGLE_SERVICE_ACCOUNT_JSON }}
package_name: ${{ secrets.ANDROID_PACKAGE_NAME }}
track: "production"

- name: Bump beta version
uses: LuisDuarte1/[email protected]
if: github.ref != 'refs/heads/master'
Expand All @@ -67,7 +66,7 @@ jobs:
production_version: ${{ steps.latest-production-version.outputs.latest_version_name }}
staging_version: ${{ steps.latest-beta-version.outputs.latest_version_name }}
bump_type: prerelease

- name: Bump prod version (from develop)
uses: LuisDuarte1/[email protected]
if: github.ref == 'refs/heads/master' && env.MASTER_HASH == env.DEVELOP_HASH
Expand All @@ -85,7 +84,7 @@ jobs:
current_environment: production
production_version: ${{ steps.latest-production-version.outputs.latest_version_name }}
bump_type: patch

- name: Combine output and write new version into file
run: |
export NEW_VERSION_NAME=${{
Expand All @@ -102,13 +101,17 @@ jobs:
with:
commit_message: "Bump app version [no ci]"

- uses: actions/setup-java@v3
- uses: actions/setup-java@v4
with:
java-version: ${{env.JAVA_VERSION}}
distribution: "zulu"
- uses: subosito/flutter-action@v2

- name: Set up Flutter
uses: subosito/flutter-action@v2
with:
flutter-version: ${{ env.FLUTTER_VERSION }}
channel: stable
flutter-version-file: packages/uni_app/pubspec.yaml
cache: true

- name: Download Android keystore
run: echo "${{ secrets.ANDROID_KEYSTORE_BASE64 }}" | base64 --decode > /tmp/key.jks
Expand All @@ -124,18 +127,18 @@ jobs:
- name: Create .env file
run: echo "${{vars.UNI_ENV_FILE}}" > ./assets/env/.env

- name: Build Android App Bundle
run: |
flutter pub get
flutter build appbundle
- name: Upload App Bundle
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: appbundle
if-no-files-found: error
path: uni/build/app/outputs/bundle/release/app-release.aab
path: packages/uni_app/build/app/outputs/bundle/release/app-release.aab

deploy_play_store:
name: "Deploy to Google Play Store"
Expand All @@ -144,7 +147,7 @@ jobs:
steps:
- uses: actions/checkout@v4
- name: Get App Bundle
uses: actions/download-artifact@v3
uses: actions/download-artifact@v4
with:
name: appbundle

Expand Down Expand Up @@ -174,4 +177,4 @@ jobs:
if: github.ref == 'refs/heads/master'
run: |
echo '${{ secrets.NIAEFEUPBOT_PAT }}' | gh auth login --with-token
gh workflow run 'Deploy Action' --ref develop
gh workflow run 'Deploy Action' --ref develop
67 changes: 39 additions & 28 deletions .github/workflows/format_lint_test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,72 +4,83 @@ on:
branches: [master, develop]

env:
FLUTTER_VERSION: 3.13.7
JAVA_VERSION: 17.x
JAVA_VERSION: 21.x

jobs:
format:
name: "Format"
name: Format
runs-on: ubuntu-latest
defaults:
run:
working-directory: ./uni
working-directory: ./packages/uni_app
steps:
- uses: actions/checkout@v4
- uses: subosito/flutter-action@v2
- name: Clone repository
uses: actions/checkout@v4

- name: Set up Flutter
uses: subosito/flutter-action@v2
with:
flutter-version: ${{ env.FLUTTER_VERSION }}
channel: stable
flutter-version-file: packages/uni_app/pubspec.yaml
cache: true

- run: dart format $(find . -type f -name "*.dart" -a -not -name "*.g.dart" -a -not -name "*.mocks.dart") --set-exit-if-changed

lint:
name: "Lint"
name: Lint
runs-on: ubuntu-latest
needs: format
defaults:
run:
working-directory: ./uni
working-directory: ./packages/uni_app
steps:
- uses: actions/checkout@v4
- uses: actions/setup-java@v3
- name: Clone repository
uses: actions/checkout@v4

- uses: actions/setup-java@v4
with:
java-version: ${{ env.JAVA_VERSION }}
distribution: "zulu"
- uses: subosito/flutter-action@v2
with:
flutter-version: ${{ env.FLUTTER_VERSION }}
distribution: zulu

- name: Cache pub dependencies
uses: actions/cache@v3
- name: Set up Flutter
uses: subosito/flutter-action@v2
with:
path: ${{ env.FLUTTER_HOME }}/.pub-cache
key: ${{ runner.os }}-pub-${{ github.ref }}-${{ hashFiles('**/pubspec.lock') }}
restore-keys: ${{ runner.os }}-pub-${{ github.ref }}-
channel: stable
flutter-version-file: packages/uni_app/pubspec.yaml
cache: true

- run: flutter pub get

- run: flutter analyze .
- run: |
flutter analyze .
dart run custom_lint
test:
name: "Test"
name: Test
runs-on: ubuntu-latest
needs: lint
defaults:
run:
working-directory: ./uni
working-directory: ./packages/uni_app
steps:
- uses: actions/checkout@v4
- uses: actions/setup-java@v3
- uses: actions/setup-java@v4
with:
java-version: ${{ env.JAVA_VERSION }}
distribution: "zulu"
- uses: subosito/flutter-action@v2
distribution: zulu

- name: Set up Flutter
uses: subosito/flutter-action@v2
with:
flutter-version: ${{ env.FLUTTER_VERSION }}
channel: stable
flutter-version-file: packages/uni_app/pubspec.yaml
cache: true

- name: Test with coverage
run: flutter test --coverage

- name: Upload coverage to Codecov
uses: codecov/codecov-action@v1
uses: codecov/codecov-action@v4
with:
token: ${{ secrets.CODECOV_TOKEN }}
fail_ci_if_error: true
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@

## Overview

**uni** is a project developed by [NIAEFEUP](https://ni.fe.up.pt/) to help students of the [University of Porto](https://up.pt) to manage their academic life, including useful features such as upcoming classes and exams. It is a mobile app that is available for both Android and iOS, and is developed using the [Flutter](https://flutter.dev/) framework.
**uni** is a project developed by [NIAEFEUP](https://niaefeup.pt/) to help students of the [University of Porto](https://up.pt) to manage their academic life, including useful features such as upcoming classes and exams. It is a mobile app that is available for both Android and iOS, and is developed using the [Flutter](https://flutter.dev/) framework.

Some of the features are only available to students of [FEUP](https://fe.up.pt). The reliability of the information provided by the app is not guaranteed, and the app is not affiliated with the University of Porto or any of its faculties.

Expand All @@ -34,4 +34,4 @@ This application is licensed under the [GNU General Public License v3.0](./LICEN

Contributions are welcome, and can be made by opening a pull request. Please note, however, that a university's account is required to access most of the app's features.

For further information about the project structure, please refer to [the app's README file](./uni/README.md).
For further information about the project structure, please refer to [the app's README file](./packages/uni_app/README.md).
File renamed without changes.
File renamed without changes.
11 changes: 7 additions & 4 deletions uni/README.md → packages/uni_app/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,13 +48,16 @@ dart run build_runner watch

## Translation files

Intl package allows the internationalization of the app, currently supporting Portuguese ('pt_PT') and English ('en_EN). This package creates `.arb` files (one for each language), mapping a key to the correspondent translated string.
In order to access those translations through getters, you must add the translations you want to the `.arb` files and run:
Intl package allows the internationalization of the app, currently supporting Portuguese ('pt_PT') and English ('en_EN'), by generating `.dart` files (one for each language), mapping a key to the correspondent translated string as you can see at ```generated/intl``` files.
To generate these files, you must add the translations you want in the `.arb` files of the ```I10n``` folder and run:
```
dart pub global activate intl_utils 2.1.0
```
```
dart pub global run intl_utils:generate
```
This will generate `.dart` files with the getters you need to access the translations.
You must include `'package:uni/generated/l10n.dart'` and, depending on the locale of the application, `S.of(context).{key_of_translation}` will get you the translated string.

To use the translation import `'package:uni/generated/l10n.dart'` and use `S.of(context).{key_of_translation}`.

## Project structure

Expand Down
10 changes: 10 additions & 0 deletions packages/uni_app/analysis_options.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
include: package:leancode_lint/analysis_options.yaml

analyzer:
# Exclude auto-generated files from dart analysis
exclude:
- "**.g.dart"
- "**.mocks.dart"
- "**generated/**"
plugins:
- custom_lint
File renamed without changes.
92 changes: 92 additions & 0 deletions packages/uni_app/android/app/build.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,92 @@
plugins {
id "com.android.application"
id "org.jetbrains.kotlin.android"
id "dev.flutter.flutter-gradle-plugin"
}

def localProperties = new Properties()
def localPropertiesFile = rootProject.file("local.properties")
if (localPropertiesFile.exists()) {
localPropertiesFile.withReader("UTF-8") { reader ->
localProperties.load(reader)
}
}

def flutterVersionCode = localProperties.getProperty("flutter.versionCode")
if (flutterVersionCode == null) {
flutterVersionCode = "1"
}

def flutterVersionName = localProperties.getProperty("flutter.versionName")
if (flutterVersionName == null) {
flutterVersionName = "1.0"
}

def keystoreProperties = new Properties()
def keystorePropertiesFile = rootProject.file("key.properties")
if (keystorePropertiesFile.exists()) {
keystoreProperties.load(new FileInputStream(keystorePropertiesFile))
}

android {
namespace "pt.up.fe.ni.uni"

compileSdkVersion 34
ndkVersion "25.1.8937393"

compileOptions {
targetCompatibility JavaVersion.VERSION_11
sourceCompatibility JavaVersion.VERSION_11

// This is required by flutter_local_notifications. See its README.
coreLibraryDesugaringEnabled true
}

kotlinOptions {
jvmTarget = "11"
}

sourceSets {
main.java.srcDirs += "src/main/kotlin"
}

defaultConfig {
applicationId "pt.up.fe.ni.uni"
minSdkVersion 22
targetSdkVersion 34
versionCode flutterVersionCode.toInteger()
versionName flutterVersionName
}

signingConfigs {
release {
keyAlias keystoreProperties["keyAlias"]
keyPassword keystoreProperties["keyPassword"]
storeFile keystoreProperties["storeFile"] ? file(keystoreProperties["storeFile"]) : null
storePassword keystoreProperties["storePassword"]
}
}

buildTypes {
release {
signingConfig signingConfigs.release

proguardFiles(
getDefaultProguardFile("proguard-android-optimize.txt"),
"proguard-rules.pro"
)
}
}
}

flutter {
source "../.."
}

dependencies {
// The following 3 lines are a workaround for the Flutter issue.
// Learn more: https://github.com/flutter/flutter/issues/110658
implementation "androidx.window:window:1.3.0"
implementation "androidx.window:window-java:1.3.0"
coreLibraryDesugaring "com.android.tools:desugar_jdk_libs:2.0.4"
}
Loading

0 comments on commit bd57543

Please sign in to comment.