diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 000000000..55fee41a5 --- /dev/null +++ b/.dockerignore @@ -0,0 +1,4 @@ +build +dist +.dart_tool +.idea diff --git a/.github/Dockerfile b/.github/Dockerfile new file mode 100644 index 000000000..e4dacb0e9 --- /dev/null +++ b/.github/Dockerfile @@ -0,0 +1,32 @@ +ARG FLUTTER_VERSION +ARG BUILD_VERSION + +FROM --platform=arm64 fischerscode/flutter-sudo:${FLUTTER_VERSION} + +WORKDIR /app + +# Install dependencies +RUN sudo apt-get update &&\ + sudo apt-get install -y tar clang cmake ninja-build pkg-config libgtk-3-dev make python3-pip python3-setuptools desktop-file-utils libgdk-pixbuf2.0-dev fakeroot strace fuse libunwind-dev locate patchelf gir1.2-appindicator3-0.1 libappindicator3-1 libappindicator3-dev libsecret-1-0 libjsoncpp25 libsecret-1-dev libjsoncpp-dev libnotify-bin libnotify-dev mpv libmpv-dev rpm &&\ + sudo rm -rf /var/lib/apt/lists/* + +COPY . . + +RUN sudo chown -R $(whoami) /app + +RUN flutter pub get &&\ + flutter config --enable-linux-desktop &&\ + flutter pub get &&\ + dart run build_runner build --delete-conflicting-outputs + +RUN dart pub global activate flutter_distributor &&\ + alias dpkg-deb="dpkg-deb --Zxz" &&\ + flutter_distributor package --platform=linux --targets=deb &&\ + flutter_distributor package --platform=linux --targets=rpm + + +RUN make tar VERSION=${BUILD_VERSION} ARCH=arm64 PKG_ARCH=aarch64 + +RUN mv build/spotube-linux-*-aarch64.tar.xz dist/ &&\ + mv dist/**/spotube-*-linux.deb dist/Spotube-linux-aarch64.deb &&\ + mv dist/**/spotube-*-linux.rpm dist/Spotube-linux-aarch64.rpm \ No newline at end of file diff --git a/.github/workflows/spotube-release-binary.yml b/.github/workflows/spotube-release-binary.yml index 969e1b77c..044738c95 100644 --- a/.github/workflows/spotube-release-binary.yml +++ b/.github/workflows/spotube-release-binary.yml @@ -70,7 +70,7 @@ jobs: run: | flutter config --enable-windows-desktop flutter pub get - dart run build_runner build --delete-conflicting-outputs --enable-experiment=records,patterns + dart run build_runner build --delete-conflicting-outputs - name: Build Windows Executable run: | @@ -156,7 +156,7 @@ jobs: run: | flutter config --enable-linux-desktop flutter pub get - dart run build_runner build --delete-conflicting-outputs --enable-experiment=records,patterns + dart run build_runner build --delete-conflicting-outputs - name: Build Linux Packages run: | @@ -206,6 +206,66 @@ jobs: with: limit-access-to-actor: true + linux_arm: + runs-on: macos-14 + steps: + - uses: actions/checkout@v4 + + - name: Install Docker + run: brew install docker + + - name: Replace pubspec version and BUILD_VERSION Env (nightly) + if: ${{ inputs.channel == 'nightly' }} + run: | + brew install yq + yq -i '.version |= sub("\+\d+", "+${{ inputs.channel }}.")' pubspec.yaml + yq -i '.version += strenv(GITHUB_RUN_NUMBER)' pubspec.yaml + echo "BUILD_VERSION=${{ inputs.version }}+${{ inputs.channel }}.${{ github.run_number }}" >> $GITHUB_ENV + + + - name: BUILD_VERSION Env (stable) + if: ${{ inputs.channel == 'stable' }} + run: | + echo "BUILD_VERSION=${{ inputs.version }}" >> $GITHUB_ENV + + - name: Get current date + id: date + run: echo "::set-output name=date::$(date +'%Y-%m-%d')" + + - name: Replace Version in files + run: | + sed -i 's|%{{APPDATA_RELEASE}}%||' linux/com.github.KRTirtho.Spotube.appdata.xml + + - name: Create Stable .env + if: ${{ inputs.channel == 'stable' }} + run: echo '${{ secrets.DOTENV_RELEASE }}' > .env + + - name: Create Nightly .env + if: ${{ inputs.channel == 'nightly' }} + run: echo '${{ secrets.DOTENV_NIGHTLY }}' > .env + + - name: Build Linux Arm + run: | + docker build -t spotube-linux-arm -f .github/Dockerfile . --build-arg BUILD_VERSION=${{ env.BUILD_VERSION }} --build-arg FLUTTER_VERSION=${{ env.FLUTTER_VERSION }} + docker create --name spotube-linux-arm spotube-linux-arm + docker cp spotube-linux-arm:/app/dist . + docker rm -f spotube-linux-arm + + - uses: actions/upload-artifact@v3 + with: + if-no-files-found: error + name: Spotube-Release-Binaries + path: | + dist/Spotube-linux-aarch64.deb + dist/Spotube-linux-aarch64.rpm + dist/spotube-linux-nightly-aarch64.tar.xz + + - name: Debug With SSH When fails + if: ${{ failure() && inputs.debug && inputs.channel == 'nightly' }} + uses: mxschmitt/action-tmate@v3 + with: + limit-access-to-actor: true + android: runs-on: ubuntu-latest @@ -245,7 +305,7 @@ jobs: - name: Generate Secrets run: | flutter pub get - dart run build_runner build --delete-conflicting-outputs --enable-experiment=records,patterns + dart run build_runner build --delete-conflicting-outputs - name: Sign Apk run: | @@ -260,7 +320,7 @@ jobs: - name: Build Playstore AppBundle run: | echo 'ENABLE_UPDATE_CHECK=0' >> .env - dart run build_runner build --delete-conflicting-outputs --enable-experiment=records,patterns + dart run build_runner build --delete-conflicting-outputs export MANIFEST=android/app/src/main/AndroidManifest.xml xmlstarlet ed -d '//meta-data[@android:name="com.google.android.gms.car.application"]' $MANIFEST > $MANIFEST.tmp mv $MANIFEST.tmp $MANIFEST @@ -283,7 +343,6 @@ jobs: limit-access-to-actor: true macos: - runs-on: macos-14 steps: - uses: actions/checkout@v4 @@ -317,7 +376,7 @@ jobs: run: | dart pub global activate flutter_distributor flutter pub get - dart run build_runner build --delete-conflicting-outputs --enable-experiment=records,patterns + dart run build_runner build --delete-conflicting-outputs - name: Build Macos App run: | @@ -381,7 +440,7 @@ jobs: - name: Generate Secrets run: | flutter pub get - dart run build_runner build --delete-conflicting-outputs --enable-experiment=records,patterns + dart run build_runner build --delete-conflicting-outputs - name: Build iOS iPA run: | @@ -408,6 +467,7 @@ jobs: needs: - windows - linux + - linux_arm - android - macos - iOS