From 80ba2feb148a2ccc8cdba3571949f8b3bedec34a Mon Sep 17 00:00:00 2001 From: Kingkor Roy Tirtho Date: Mon, 9 May 2022 18:57:59 +0600 Subject: [PATCH] [CD] added publish android support --- .github/workflows/release-build.yml | 43 +++++++++++++++++-- AppImageBuilder.yml | 51 +---------------------- lib/helpers/contains-text-in-bracket.dart | 5 ++- 3 files changed, 43 insertions(+), 56 deletions(-) diff --git a/.github/workflows/release-build.yml b/.github/workflows/release-build.yml index a18db4ea..3bc635fa 100644 --- a/.github/workflows/release-build.yml +++ b/.github/workflows/release-build.yml @@ -50,7 +50,7 @@ jobs: # Rename the artifacts - run: | Rename-Item -Path dist/${{ steps.tag.outputs.tag }}/spotube.${{ steps.tag.outputs.tag }}.nupkg -NewName Spotube-windows-x86_64.nupkg - Rename-Item -Path dist/${{ steps.tag.outputs.tag }}/spotube-${{ steps.tag.outputs.tag }}+${{ steps.tag.outputs.tag }}-windows-setup.exe Spotube-windows-x86_64-setup.exe + Rename-Item -Path dist/${{ steps.tag.outputs.tag }}/spotube-*-windows-setup.exe Spotube-windows-x86_64-setup.exe # Publish to Chocolatey Repository - run: | @@ -133,13 +133,46 @@ jobs: make tar - run: | mv build/Spotube-linux-x86_64.tar.xz dist/${{ steps.tag.outputs.tag }} - mv dist/${{ steps.tag.outputs.tag }}/spotube-${{ steps.tag.outputs.tag }}+${{ steps.tag.outputs.tag }}-linux.deb dist/${{ steps.tag.outputs.tag }}/Spotube-linux-x86_64.deb - mv dist/${{ steps.tag.outputs.tag }}/spotube-${{ steps.tag.outputs.tag }}-linux.AppImage dist/${{ steps.tag.outputs.tag }}/Spotube-linux-x86_64.AppImage + mv dist/${{ steps.tag.outputs.tag }}/spotube-*-linux.deb dist/${{ steps.tag.outputs.tag }}/Spotube-linux-x86_64.deb + mv dist/${{ steps.tag.outputs.tag }}/spotube-*-linux.AppImage dist/${{ steps.tag.outputs.tag }}/Spotube-linux-x86_64.AppImage - uses: actions/upload-artifact@v2 with: name: Spotube-Linux-Bundle path: dist/${{ steps.tag.outputs.tag }} + publish_android: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - uses: actions/checkout@v3 + with: + repository: KRTirtho/flutter_distributor + ref: deb-implementation + path: build/flutter_distributor + - name: Get latest tag + id: tag + uses: dawidd6/action-get-tag@v1 + with: + strip_v: true + - uses: subosito/flutter-action@v2 + with: + cache: true + - run: | + sudo apt-get update -y + sudo apt-get install -y clang cmake ninja-build pkg-config libgtk-3-dev make libwebkit2gtk-4.0-dev keybinder-3.0 python3-pip python3-setuptools patchelf desktop-file-utils libgdk-pixbuf2.0-dev fakeroot strace fuse + - run: | + flutter pub get + dart bin/create-secrets.dart '${{ secrets.LYRICS_SECRET }}' '${{ secrets.SPOTIFY_SECRET }}' + dart pub global activate melos + cd build/flutter_distributor && melos bootstrap && cd ../.. + dart build/flutter_distributor/packages/flutter_distributor/bin/main.dart package --platform=android --targets=apk --skip-clean + - run: | + mv dist/${{ steps.tag.outputs.tag }}/spotube-*-android.apk dist/${{ steps.tag.outputs.tag }}/Spotube-android-all-arch.apk + - uses: actions/upload-artifact@v2 + with: + name: Spotube-Android-Bundle + path: dist/${{ steps.tag.outputs.tag }} + update_release: needs: - publish_chocolatey @@ -171,9 +204,11 @@ jobs: md5sum ./Spotube-Windows-Bundle/*.{exe,nupkg} > RELEASE.md5sum md5sum ./Spotube-Macos-Bundle/*.dmg > RELEASE.md5sum md5sum ./Spotube-Linux-Bundle/*.{AppImage,tar.xz,deb} > RELEASE.md5sum + md5sum ./Spotube-Android-Bundle/*.apk > RELEASE.md5sum sha256sum ./Spotube-Macos-Bundle/*.dmg > RELEASE.sha256sum sha256sum ./Spotube-Windows-Bundle/*.{exe,nupkg} > RELEASE.sha256sum sha256sum ./Spotube-Linux-Bundle/*.{AppImage,tar.xz,deb} > RELEASE.sha256sum + sha256sum ./Spotube-Android-Bundle/*.apk > RELEASE.sha256sum sed -i 's|Spotube-.*-Bundle/||' RELEASE.sha256sum RELEASE.md5sum # Upload release binary - uses: ncipollo/release-action@v1 @@ -184,7 +219,7 @@ jobs: omitNameDuringUpdate: true omitPrereleaseDuringUpdate: true allowUpdates: true - artifacts: Spotube-Windows-Bundle/*,Spotube-Macos-Bundle/*,Spotube-Linux-Bundle/*,RELEASE.sha256sum,RELEASE.md5sum + artifacts: Spotube-Windows-Bundle/*,Spotube-Macos-Bundle/*,Spotube-Linux-Bundle/*,Spotube-Android-Bundle/*,RELEASE.sha256sum,RELEASE.md5sum # publish_winget: # needs: update_release diff --git a/AppImageBuilder.yml b/AppImageBuilder.yml index 0644d570..7d7514be 100644 --- a/AppImageBuilder.yml +++ b/AppImageBuilder.yml @@ -1,50 +1 @@ -# appimage-builder recipe see https://appimage-builder.readthedocs.io for details -version: 1 -script: - - rm -rf AppDir || true - - cp -r build/linux/x64/release/bundle AppDir - - mkdir -p AppDir/usr/share/icons/hicolor/64x64/apps/ - - cp assets/spotube-logo.png AppDir/usr/share/icons/hicolor/64x64/apps/ -AppDir: - path: ./AppDir - app_info: - id: oss.krtirtho.spotube - name: Spotube - icon: spotube-logo - version: 2.0.0 - exec: spotube - exec_args: $@ - apt: - arch: amd64 - allow_unauthenticated: true - sources: - - sourceline: deb http://bd.archive.ubuntu.com/ubuntu/ hirsute main restricted - - sourceline: deb http://bd.archive.ubuntu.com/ubuntu/ hirsute-updates main restricted - - sourceline: deb http://bd.archive.ubuntu.com/ubuntu/ hirsute universe - - sourceline: deb http://bd.archive.ubuntu.com/ubuntu/ hirsute-updates universe - - sourceline: deb http://bd.archive.ubuntu.com/ubuntu/ hirsute multiverse - - sourceline: deb http://bd.archive.ubuntu.com/ubuntu/ hirsute-updates multiverse - - sourceline: - deb http://bd.archive.ubuntu.com/ubuntu/ hirsute-backports main - restricted universe multiverse - - sourceline: deb http://security.ubuntu.com/ubuntu hirsute-security main restricted - - sourceline: deb http://security.ubuntu.com/ubuntu hirsute-security universe - - sourceline: deb http://security.ubuntu.com/ubuntu hirsute-security multiverse - include: - - libkeybinder-3.0-0 - exclude: - - libx11-6 - - libgtk-3-0 - - libglib2.0-0 - - libc6 - files: - include: [] - exclude: - - usr/share/man - - usr/share/doc/*/README.* - - usr/share/doc/*/changelog.* - - usr/share/doc/*/NEWS.* - - usr/share/doc/*/TODO.* -AppImage: - arch: x86_64 - update-information: guess +{"version":1,"script":["rm -rf AppDir || true","cp -r build/linux/x64/release/bundle AppDir","mkdir -p AppDir/usr/share/icons/hicolor/64x64/apps/","cp assets/spotube-logo.png AppDir/usr/share/icons/hicolor/"],"AppDir":{"path":"AppDir","app_info":{"id":"oss.krtirtho.spotube","icon":"spotube-logo","name":"spotube","version":"2.0.0+8","exec":"spotube","exec_args":"$@"},"apt":{"arch":"amd64","allow_unauthenticated":true,"sources":[{"sourceline":"deb http://archive.ubuntu.com/ubuntu/ hirsute main restricted"},{"sourceline":"deb http://archive.ubuntu.com/ubuntu/ hirsute-updates main restricted"},{"sourceline":"deb http://archive.ubuntu.com/ubuntu/ hirsute universe"},{"sourceline":"deb http://archive.ubuntu.com/ubuntu/ hirsute-updates universe"},{"sourceline":"deb http://archive.ubuntu.com/ubuntu/ hirsute multiverse"},{"sourceline":"deb http://archive.ubuntu.com/ubuntu/ hirsute-updates multiverse"},{"sourceline":"deb http://archive.ubuntu.com/ubuntu/ hirsute-backports main restricted universe multiverse"},{"sourceline":"deb http://security.ubuntu.com/ubuntu hirsute-security main restricted"},{"sourceline":"deb http://security.ubuntu.com/ubuntu hirsute-security universe"},{"sourceline":"deb http://security.ubuntu.com/ubuntu hirsute-security multiverse"}],"include":["libkeybinder-3.0-0"],"exclude":["libx11-6","libgtk-3-0","libglib2.0-0","libc6"]},"files":{"include":[],"exclude":[]}},"AppImage":{"arch":"x86_64","update-information":"guess"}} \ No newline at end of file diff --git a/lib/helpers/contains-text-in-bracket.dart b/lib/helpers/contains-text-in-bracket.dart index fe177ec6..cc83b99b 100644 --- a/lib/helpers/contains-text-in-bracket.dart +++ b/lib/helpers/contains-text-in-bracket.dart @@ -1,6 +1,7 @@ bool containsTextInBracket(String matcher, String text) { - return RegExp(r"(?<=\().+?(?=\))") - .allMatches(matcher) + final allMatches = RegExp(r"(?<=\().+?(?=\))").allMatches(matcher); + if (allMatches.isEmpty) return false; + return allMatches .map((e) => e.group(0)) .every((match) => match?.contains(text) ?? false); }