feat: Update icons and enhance UI components across various screens #188
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Build & Release | |
| # Trigger on push to master branch or with a tag | |
| on: | |
| push: | |
| branches: | |
| - '**' | |
| tags: | |
| - 'V*' | |
| # If previous workflow is still running, we push again, we will cancel the previous workflow | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.ref_name }} | |
| cancel-in-progress: true | |
| jobs: | |
| Build: | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| include: | |
| - target: Android | |
| os: ubuntu-latest | |
| artifact_name: release-Android | |
| artifact_path: | | |
| build/app/outputs/flutter-apk/*.apk | |
| build/app/outputs/bundle/release/*.aab | |
| - target: Windows | |
| os: windows-latest | |
| artifact_name: release-Windows | |
| artifact_path: | | |
| build/windows/outputs/*.zip | |
| build/windows/outputs/*.exe | |
| - target: Linux | |
| os: ubuntu-22.04 | |
| artifact_name: release-Linux | |
| artifact_path: | | |
| build/linux/*.deb | |
| build/linux/*.tar.gz | |
| - target: Linux-arm | |
| os: ubuntu-22.04-arm | |
| artifact_name: release-Linux-arm | |
| artifact_path: | | |
| build/linux/*.deb | |
| build/linux/*.tar.gz | |
| - target: iOS | |
| os: macos-latest | |
| cache_pod_key: ios-pods | |
| cache_pod_path: ios/Pods | |
| cache_pod_restore_keys_hash_file: ios/Podfile.lock | |
| artifact_name: release-iOS | |
| artifact_path: build/ios/ipa/*.ipa | |
| - target: macOS | |
| os: macos-latest | |
| cache_pod_key: macos-pods | |
| cache_pod_path: macos/Pods | |
| cache_pod_restore_keys_hash_file: macos/Podfile.lock | |
| artifact_name: release-macOS | |
| artifact_path: build/macos/*.dmg | |
| outputs: | |
| version: ${{ steps.get_version.outputs.version }} | |
| date: ${{ steps.get_version.outputs.date}} | |
| arch: ${{ steps.get_version.outputs.arch}} | |
| runs-on: ${{ matrix.os }} | |
| env: | |
| FLUTTER_VERSION: 3.41.9 | |
| steps: | |
| # Checkout branch | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| # Add Android keystore | |
| - name: Setup Android keystore | |
| if: matrix.target == 'Android' | |
| run: | | |
| echo "${{ secrets.ENCODED_KEYSTORE }}" | base64 -di > android/app/cloudchewie.jks | |
| echo "${{ secrets.KEY_PROPERTIES }}" > android/key.properties | |
| # Setup Flutter | |
| - name: Setup Flutter | |
| uses: subosito/flutter-action@v2.23.0 | |
| with: | |
| flutter-version: ${{ env.FLUTTER_VERSION }} | |
| channel: 'stable' | |
| cache: true | |
| # Setup JDK | |
| - name: Setup JDK 17 (Android) | |
| if: matrix.target == 'Android' | |
| uses: actions/setup-java@v4 | |
| with: | |
| distribution: 'temurin' | |
| java-version: '17' | |
| cache: gradle | |
| # Cache CocoaPods | |
| - name: Cache CocoaPods | |
| if: matrix.cache_pod_key != '' | |
| uses: actions/cache@v4 | |
| with: | |
| path: ${{ matrix.cache_pod_path }} | |
| key: ${{ matrix.cache_pod_key }}-${{ hashFiles(matrix.cache_pod_restore_keys_hash_file) }} | |
| restore-keys: ${{ matrix.cache_pod_key }}- | |
| # Update CocoaPods repo | |
| - name: Update CocoaPods repo | |
| if: matrix.target == 'iOS' || matrix.target == 'macOS' | |
| run: pod repo update | |
| # Flutter Pub Get | |
| - name: Flutter Pub Get | |
| run: | | |
| git config --global core.longpaths true | |
| flutter doctor -v | |
| flutter pub get | |
| flutter gen-l10n | |
| cd third-party/chewie | |
| flutter gen-l10n | |
| # Get app version | |
| - name: Get app version | |
| id: get_version | |
| shell: bash | |
| run: | | |
| echo "version=$(head -n 2 pubspec.yaml | tail -n 1 | cut -d ' ' -f 2 | cut -d '+' -f 1)" >> $GITHUB_OUTPUT | |
| echo "date=$(date +%Y-%m-%d)" >> $GITHUB_OUTPUT | |
| echo "arch=$(echo "$RUNNER_ARCH" | tr '[:upper:]' '[:lower:]')" >> $GITHUB_OUTPUT | |
| # Build Android .apk & .aab | |
| - name: Build Android | |
| if: matrix.target == 'Android' | |
| run: | | |
| flutter build apk --release | |
| flutter build apk --release --split-per-abi | |
| flutter build appbundle --release --dart-define=BUILD_TYPE=appbundle | |
| cd build/app/outputs/flutter-apk | |
| mv app-release.apk CloudOTP-${{ steps.get_version.outputs.version }}-android-universal.apk | |
| mv app-arm64-v8a-release.apk CloudOTP-${{ steps.get_version.outputs.version }}-android-arm64-v8a.apk | |
| mv app-armeabi-v7a-release.apk CloudOTP-${{ steps.get_version.outputs.version }}-android-armeabi-v7a.apk | |
| mv app-x86_64-release.apk CloudOTP-${{ steps.get_version.outputs.version }}-android-x86_64.apk | |
| cd ../bundle/release | |
| mv app-release.aab CloudOTP-${{ steps.get_version.outputs.version }}-android.aab | |
| # Build Windows .zip | |
| - name: Build Windows | |
| if: matrix.target == 'Windows' | |
| run: | | |
| flutter build windows --release | |
| $DestDir = "build\windows\outputs\CloudOTP-${{ steps.get_version.outputs.version }}-windows-x86_64" | |
| $SrcDir = "build\windows\x64\runner\Release" | |
| $dllDir = "tools\windows_dll" | |
| Copy-Item -Filter *.dll -Path $dllDir\* -Destination $SrcDir -Force | |
| New-Item -Path $DestDir -ItemType Directory | |
| Copy-Item $SrcDir\* -Recurse $DestDir | |
| Compress-Archive $DestDir build\windows\outputs\CloudOTP-${{ steps.get_version.outputs.version }}-windows-x86_64.zip | |
| (Get-Content tools/windows_tools/CloudOTP.iss) -replace '#define MyAppVersion ".*"', '#define MyAppVersion "${{ steps.get_version.outputs.version }}"' | Set-Content tools/windows_tools/CloudOTP.iss | |
| # Build Windows .exe | |
| - name: Build Windows Installer | |
| if: matrix.target == 'Windows' | |
| uses: Minionguyjpro/Inno-Setup-Action@v1.2.6 | |
| with: | |
| path: tools/windows_tools/CloudOTP.iss | |
| # Build Linux .deb | |
| - name: Build Linux | |
| if: matrix.target == 'Linux' || matrix.target == 'Linux-arm' | |
| run: | | |
| sudo apt update -y | |
| sudo apt install -y curl git unzip xz-utils zip libglu1-mesa clang cmake ninja-build pkg-config liblzma-dev libgtk-3-dev liblzma-dev libstdc++-12-dev libayatana-appindicator3-dev libkeybinder-3.0-dev libsecret-1-dev libnotify-dev libsqlcipher-dev | |
| flutter build linux --release | |
| # Debian package | |
| mkdir -p build/linux/CloudOTP-${{ steps.get_version.outputs.version }}-linux-${{ steps.get_version.outputs.arch }} | |
| cd build/linux/CloudOTP-${{ steps.get_version.outputs.version }}-linux-${{ steps.get_version.outputs.arch }} | |
| mkdir -p opt/CloudOTP | |
| mkdir -p usr/share/metainfo | |
| mkdir -p usr/share/applications | |
| mkdir -p usr/share/icons/hicolor/scalable/apps | |
| cp -r ../${{ steps.get_version.outputs.arch }}/release/bundle/* opt/CloudOTP | |
| cp -r ../../../tools/linux_tools/DEBIAN . | |
| chmod 0755 DEBIAN/postinst | |
| chmod 0755 DEBIAN/postrm | |
| sed -i '50i\ <release version="${{ steps.get_version.outputs.version }}" date="${{ steps.get_version.outputs.date }}">' ../../../tools/linux_tools/com.cloudchewie.cloudotp.metainfo.xml | |
| cp ../../../tools/linux_tools/com.cloudchewie.cloudotp.metainfo.xml usr/share/metainfo | |
| cp ../../../tools/linux_tools/com.cloudchewie.cloudotp.desktop usr/share/applications | |
| cp ../../../assets/logo-transparent.svg usr/share/icons/hicolor/scalable/apps/com.cloudchewie.cloudotp.svg | |
| sed -i "/^Version: /s/Version: .*/Version: ${{ steps.get_version.outputs.version }}/" DEBIAN/control | |
| if [ "${{ steps.get_version.outputs.arch }}" = "arm64" ]; then | |
| sed -i "/^Architecture: /s/Architecture: .*/Architecture: arm64/" DEBIAN/control | |
| fi | |
| cd .. | |
| dpkg-deb --build --root-owner-group CloudOTP-${{ steps.get_version.outputs.version }}-linux-${{ steps.get_version.outputs.arch }} | |
| tar -zcvf CloudOTP-${{ steps.get_version.outputs.version }}-linux-${{ steps.get_version.outputs.arch }}.tar.gz -C CloudOTP-${{ steps.get_version.outputs.version }}-linux-${{ steps.get_version.outputs.arch }} . | |
| # Build iOS .ipa (no codesign) | |
| - name: Build iOS | |
| if: matrix.target == 'iOS' | |
| run: | | |
| flutter build ipa --release --no-codesign | |
| mkdir -p build/ios/ipa | |
| cd build/ios/archive/Runner.xcarchive/Products/Applications | |
| mkdir -p Payload | |
| mv Runner.app Payload/ 2>/dev/null || mv CloudOTP.app Payload/ 2>/dev/null || true | |
| zip -r ../../../../../../build/ios/ipa/CloudOTP-${{ steps.get_version.outputs.version }}-ios.ipa Payload | |
| # Build macOS .app & .dmg | |
| - name: Disable macOS codesigning | |
| if: matrix.target == 'macOS' | |
| run: | | |
| sed -i '' 's/"CODE_SIGN_IDENTITY\[sdk=macosx\*\]" = "Apple Development"/CODE_SIGN_IDENTITY = "-"/g' macos/Runner.xcodeproj/project.pbxproj | |
| sed -i '' 's/CODE_SIGN_STYLE = Automatic/CODE_SIGN_STYLE = Manual/g' macos/Runner.xcodeproj/project.pbxproj | |
| sed -i '' 's/DEVELOPMENT_TEAM = 9CAPQ7Q4W8/DEVELOPMENT_TEAM = ""/g' macos/Runner.xcodeproj/project.pbxproj | |
| sed -i '' 's/CODE_SIGN_ENTITLEMENTS = Runner\/Release.entitlements/CODE_SIGN_ENTITLEMENTS = ""/g' macos/Runner.xcodeproj/project.pbxproj | |
| sed -i '' 's/CODE_SIGN_ENTITLEMENTS = Runner\/DebugProfile.entitlements/CODE_SIGN_ENTITLEMENTS = ""/g' macos/Runner.xcodeproj/project.pbxproj | |
| - name: Build macOS | |
| if: matrix.target == 'macOS' | |
| run: | | |
| flutter build macos --release | |
| APP_PATH="build/macos/Build/Products/Release/CloudOTP.app" | |
| codesign --force --deep -s - "$APP_PATH" | |
| DMG_NAME="CloudOTP-${{ steps.get_version.outputs.version }}-macos-universal.dmg" | |
| mkdir -p build/macos | |
| hdiutil create -volname CloudOTP -srcfolder "$APP_PATH" -ov -format UDZO "build/macos/$DMG_NAME" | |
| # Upload Artifacts | |
| - name: Upload Artifacts | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: ${{ matrix.artifact_name }} | |
| path: ${{ matrix.artifact_path }} | |
| Publish: | |
| if: startsWith(github.ref, 'refs/tags/') | |
| name: Publish | |
| needs: Build | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Get app version | |
| id: get_version | |
| shell: bash | |
| run: | | |
| echo "version=$(head -n 2 pubspec.yaml | tail -n 1 | cut -d ' ' -f 2 | cut -d '+' -f 1)" >> $GITHUB_OUTPUT | |
| - name: Make tmp dir | |
| run: mkdir /tmp/artifacts | |
| - name: Download all Artifacts | |
| uses: actions/download-artifact@v4 | |
| with: | |
| path: /tmp/artifacts | |
| - name: List and move all Artifacts | |
| run: | | |
| mkdir -p /tmp/artifacts/final | |
| mv /tmp/artifacts/release-Android/*.apk /tmp/artifacts/final/ | |
| mv /tmp/artifacts/release-Android/*.aab /tmp/artifacts/final/ | |
| mv /tmp/artifacts/release-Windows/*.zip /tmp/artifacts/final/ | |
| mv /tmp/artifacts/release-Windows/*.exe /tmp/artifacts/final/ | |
| mv /tmp/artifacts/release-Linux/*.deb /tmp/artifacts/final/ | |
| mv /tmp/artifacts/release-Linux/*.tar.gz /tmp/artifacts/final/ | |
| mv /tmp/artifacts/release-Linux-arm/*.deb /tmp/artifacts/final/ | |
| mv /tmp/artifacts/release-Linux-arm/*.tar.gz /tmp/artifacts/final/ | |
| mv /tmp/artifacts/release-iOS/*.ipa /tmp/artifacts/final/ 2>/dev/null || true | |
| mv /tmp/artifacts/release-macOS/*.dmg /tmp/artifacts/final/ 2>/dev/null || true | |
| cd /tmp/artifacts/final | |
| for file in *; do | |
| if [ -f "$file" ]; then | |
| sha1sum "$file" | awk '{ print $1 }' > "$file.sha1" | |
| fi | |
| done | |
| ls -R /tmp/artifacts/final | |
| - name: Upload to S3 | |
| uses: Robert-Stackflow/upload-s3-action@master | |
| with: | |
| endpoint: ${{ secrets.AWS_ENDPOINT }} | |
| aws_key_id: ${{ secrets.AWS_KEY_ID }} | |
| aws_secret_access_key: ${{ secrets.AWS_SECRET_ACCESS_KEY}} | |
| aws_bucket: ${{ secrets.AWS_BUCKET }} | |
| source_dir: /tmp/artifacts/final | |
| destination_dir: CloudOTP/${{ steps.get_version.outputs.version }} | |
| - name: Upload to release | |
| uses: Robert-Stackflow/release-action@master | |
| with: | |
| tag: ${{ github.ref_name }} | |
| allowUpdates: true | |
| generateReleaseNotes: true | |
| artifacts: /tmp/artifacts/final/* | |
| artifactErrorsFailBuild: true | |
| replacesArtifacts: true | |
| makeLatest: true | |
| draft: true | |
| updateOnlyUnreleased: true |