diff --git a/.github/workflows/pr.yaml b/.github/workflows/pr.yaml index 86325eb..6f315fc 100644 --- a/.github/workflows/pr.yaml +++ b/.github/workflows/pr.yaml @@ -37,6 +37,12 @@ - name: Get Flutter dependencies run: flutter pub get shell: bash + - name: Generate i18n translations + run: dart run slang + shell: bash + - name: Generate MobX code + run: flutter pub run build_runner build --delete-conflicting-outputs + shell: bash - name: Inject DanDan API Credentials run: | sed -i "s/kvpx7qkqjh/${{ secrets.DANDANAPI_APPID }}/g" lib/utils/mortis.dart @@ -74,6 +80,10 @@ distribution: 'temurin' java-version: '18' - run: flutter pub get + - name: Generate i18n translations + run: dart run slang + - name: Generate MobX code + run: flutter pub run build_runner build --delete-conflicting-outputs - name: Inject DanDan API Credentials env: DANDANAPI_APPID: ${{ secrets.DANDANAPI_APPID }} @@ -118,6 +128,12 @@ - name: Get Flutter dependencies run: flutter pub get shell: bash + - name: Generate i18n translations + run: dart run slang + shell: bash + - name: Generate MobX code + run: flutter pub run build_runner build --delete-conflicting-outputs + shell: bash - name: Inject DanDan API Credentials run: | sed -i "s/kvpx7qkqjh/${{ secrets.DANDANAPI_APPID }}/g" lib/utils/mortis.dart @@ -157,6 +173,10 @@ channel: stable flutter-version-file: pubspec.yaml - run: flutter pub get + - name: Generate i18n translations + run: dart run slang + - name: Generate MobX code + run: flutter pub run build_runner build --delete-conflicting-outputs - name: Inject DanDan API Credentials run: | sed -i '' "s/kvpx7qkqjh/${{ secrets.DANDANAPI_APPID }}/g" lib/utils/mortis.dart @@ -188,6 +208,10 @@ channel: stable flutter-version-file: pubspec.yaml - run: flutter pub get + - name: Generate i18n translations + run: dart run slang + - name: Generate MobX code + run: flutter pub run build_runner build --delete-conflicting-outputs - name: Inject DanDan API Credentials run: | sed -i '' "s/kvpx7qkqjh/${{ secrets.DANDANAPI_APPID }}/g" lib/utils/mortis.dart diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index 2ebc45d..63b3030 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -21,7 +21,7 @@ - name: Clone repository uses: actions/checkout@v4 - name: Extract tag name - run: echo "tag=${GITHUB_REF#refs/tags/}" >> $GITHUB_ENV + run: echo "tag=${GITHUB_REF_NAME//\//-}" >> $GITHUB_ENV shell: bash - name: Echo build progress run: echo "oneAnime_android_${{ env.tag }}.apk build progress" @@ -44,6 +44,12 @@ - name: Get Flutter dependencies run: flutter pub get shell: bash + - name: Generate i18n translations + run: dart run slang + shell: bash + - name: Generate MobX code + run: flutter pub run build_runner build --delete-conflicting-outputs + shell: bash - name: Inject DanDan API Credentials run: | sed -i "s/kvpx7qkqjh/${{ secrets.DANDANAPI_APPID }}/g" lib/utils/mortis.dart @@ -52,7 +58,7 @@ run: flutter build apk --split-per-abi shell: bash - name: Package android build output - run: cp build/app/outputs/flutter-apk/app-arm64-v8a-release.apk oneAnime_android_${env:tag}.apk + run: cp build/app/outputs/flutter-apk/app-arm64-v8a-release.apk oneAnime_android_${{ env.tag }}.apk shell: bash - name: Upload android outputs @@ -70,8 +76,8 @@ - name: Clone repository uses: actions/checkout@v4 - run: | - $tag = "${{ github.ref }}".Replace('refs/tags/', '') - echo "tag=$(echo $tag)" >> $env:GITHUB_ENV + $tag = "${{ github.ref_name }}".Replace('/', '-').Replace('\', '-') + echo "tag=$tag" >> $env:GITHUB_ENV - run: echo "oneAnime_windows_${env:tag}.zip build progress" - run: choco install yq - name: Set up Flutter @@ -85,6 +91,10 @@ distribution: 'temurin' java-version: '18' - run: flutter pub get + - name: Generate i18n translations + run: dart run slang + - name: Generate MobX code + run: flutter pub run build_runner build --delete-conflicting-outputs - name: Inject DanDan API Credentials env: DANDANAPI_APPID: ${{ secrets.DANDANAPI_APPID }} @@ -117,7 +127,7 @@ - name: Clone repository uses: actions/checkout@v4 - name: Extract tag name - run: echo "tag=${GITHUB_REF#refs/tags/}" >> $GITHUB_ENV + run: echo "tag=${GITHUB_REF_NAME//\//-}" >> $GITHUB_ENV shell: bash - name: Echo build progress run: echo "oneAnime_linux_${{ env.tag }}.tar.gz build progress" @@ -135,6 +145,12 @@ - name: Get Flutter dependencies run: flutter pub get shell: bash + - name: Generate i18n translations + run: dart run slang + shell: bash + - name: Generate MobX code + run: flutter pub run build_runner build --delete-conflicting-outputs + shell: bash - name: Inject DanDan API Credentials run: | sed -i "s/kvpx7qkqjh/${{ secrets.DANDANAPI_APPID }}/g" lib/utils/mortis.dart @@ -196,7 +212,7 @@ - name: Clone repository uses: actions/checkout@v4 - name: Extract tag name - run: echo "tag=${GITHUB_REF#refs/tags/}" >> $GITHUB_ENV + run: echo "tag=${GITHUB_REF_NAME//\//-}" >> $GITHUB_ENV - name: Echo build progress run: echo "oneAnime_macos_${{ env.tag }}.dmg build progress" - name: Set up Flutter @@ -205,6 +221,10 @@ channel: stable flutter-version-file: pubspec.yaml - run: flutter pub get + - name: Generate i18n translations + run: dart run slang + - name: Generate MobX code + run: flutter pub run build_runner build --delete-conflicting-outputs - name: Inject DanDan API Credentials run: | sed -i '' "s/kvpx7qkqjh/${{ secrets.DANDANAPI_APPID }}/g" lib/utils/mortis.dart @@ -227,7 +247,7 @@ - name: Clone repository uses: actions/checkout@v4 - name: Extract tag name - run: echo "tag=${GITHUB_REF#refs/tags/}" >> $GITHUB_ENV + run: echo "tag=${GITHUB_REF_NAME//\//-}" >> $GITHUB_ENV - name: Echo build progress run: echo "oneAnime_ios_${{ env.tag }}.ipa build progress" - name: Set up Flutter @@ -236,6 +256,10 @@ channel: stable flutter-version-file: pubspec.yaml - run: flutter pub get + - name: Generate i18n translations + run: dart run slang + - name: Generate MobX code + run: flutter pub run build_runner build --delete-conflicting-outputs - name: Inject DanDan API Credentials run: | sed -i '' "s/kvpx7qkqjh/${{ secrets.DANDANAPI_APPID }}/g" lib/utils/mortis.dart @@ -263,7 +287,7 @@ - name: Clone repository uses: actions/checkout@v4 - name: Extract tag name - run: echo "tag=${GITHUB_REF#refs/tags/}" >> $GITHUB_ENV + run: echo "tag=${GITHUB_REF_NAME//\//-}" >> $GITHUB_ENV shell: bash - name: Set up JDK 17 uses: actions/setup-java@v4 @@ -343,9 +367,23 @@ run: cp ${{steps.sign_app.outputs.signedReleaseFile}} build/signed/oneAnime_android_${{ env.tag }}.apk - name: Create release + if: github.ref_type == 'tag' uses: softprops/action-gh-release@v2 with: files: | + build/signed/*.apk + oneAnime_windows_*.zip + oneAnime_macos_*.dmg + oneAnime_ios_*.ipa + oneAnime_linux_*.tar.gz + oneAnime_linux_*.AppImage + + - name: Upload release bundle as artifact + if: github.ref_type != 'tag' + uses: actions/upload-artifact@v4 + with: + name: release_bundle + path: | build/signed/*.apk oneAnime_windows_*.zip oneAnime_macos_*.dmg diff --git a/android/app/src/main/AndroidManifest.xml b/android/app/src/main/AndroidManifest.xml index 883b77d..01480f5 100644 --- a/android/app/src/main/AndroidManifest.xml +++ b/android/app/src/main/AndroidManifest.xml @@ -1,4 +1,5 @@ - + + + + + +