From 6ce768989eaf9f35cc6c37b104697d46b5a66682 Mon Sep 17 00:00:00 2001 From: Kingkor Roy Tirtho Date: Fri, 19 Apr 2024 16:37:33 +0600 Subject: [PATCH 01/10] cd: use docker buildx --- .github/workflows/spotube-release-binary.yml | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/.github/workflows/spotube-release-binary.yml b/.github/workflows/spotube-release-binary.yml index c77531550..fb0706adb 100644 --- a/.github/workflows/spotube-release-binary.yml +++ b/.github/workflows/spotube-release-binary.yml @@ -207,12 +207,12 @@ jobs: limit-access-to-actor: true linux_arm: - runs-on: macos-14 + runs-on: macos-13 steps: - uses: actions/checkout@v4 - - name: Install Docker - run: brew install --cask docker + - name: Setup Docker on macOS + uses: douglascamata/setup-docker-macos-action@v1-alpha - name: Replace pubspec version and BUILD_VERSION Env (nightly) if: ${{ inputs.channel == 'nightly' }} @@ -246,7 +246,8 @@ jobs: - 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 buildx create --use + docker buildx build --platform linux/arm64 -t spotube-linux-arm -f .github/Dockerfile . --build-arg BUILD_VERSION=${{ env.BUILD_VERSION }} --build-arg FLUTTER_VERSION=${{ env.FLUTTER_VERSION }} --load docker create --name spotube-linux-arm spotube-linux-arm docker cp spotube-linux-arm:/app/dist . docker rm -f spotube-linux-arm From 21f6967df0f0b1287908d65a7913c44ee8efb1df Mon Sep 17 00:00:00 2001 From: Kingkor Roy Tirtho Date: Fri, 19 Apr 2024 16:53:55 +0600 Subject: [PATCH 02/10] cd: use linux host for linux arm instead of macos m1 m1 doesn't support nested virtualization. (Apple truly sucks) --- .github/workflows/spotube-release-binary.yml | 78 +++++++++++++++----- 1 file changed, 58 insertions(+), 20 deletions(-) diff --git a/.github/workflows/spotube-release-binary.yml b/.github/workflows/spotube-release-binary.yml index fb0706adb..b94293e7d 100644 --- a/.github/workflows/spotube-release-binary.yml +++ b/.github/workflows/spotube-release-binary.yml @@ -207,35 +207,36 @@ jobs: limit-access-to-actor: true linux_arm: - runs-on: macos-13 + runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 + - name: Set up QEMU + uses: docker/setup-qemu-action@v3 + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v3 + + - name: Get current date + id: date + run: echo "::set-output name=date::$(date +'%Y-%m-%d')" - - name: Setup Docker on macOS - uses: douglascamata/setup-docker-macos-action@v1-alpha + - name: Install Dependencies + run: | + sudo apt-get update -y + 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 - name: Replace pubspec version and BUILD_VERSION Env (nightly) if: ${{ inputs.channel == 'nightly' }} run: | - brew install yq + curl -sS https://webi.sh/yq | sh 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 @@ -244,15 +245,53 @@ jobs: if: ${{ inputs.channel == 'nightly' }} run: echo '${{ secrets.DOTENV_NIGHTLY }}' > .env - - name: Build Linux Arm + - name: Replace Version in files run: | - docker buildx create --use - docker buildx build --platform linux/arm64 -t spotube-linux-arm -f .github/Dockerfile . --build-arg BUILD_VERSION=${{ env.BUILD_VERSION }} --build-arg FLUTTER_VERSION=${{ env.FLUTTER_VERSION }} --load - docker create --name spotube-linux-arm spotube-linux-arm - docker cp spotube-linux-arm:/app/dist . - docker rm -f spotube-linux-arm + sed -i 's|%{{APPDATA_RELEASE}}%||' linux/com.github.KRTirtho.Spotube.appdata.xml + + - name: Build and push (stable) + if: ${{ inputs.channel == 'stable' }} + uses: docker/build-push-action@v5 + with: + context: . + push: false + platforms: linux/arm64 + file: .github/Dockerfile + tags: spotube-linux-arm64:latest + build-args: | + BUILD_VERSION=${{ env.BUILD_VERSION }} + FLUTTER_VERSION=${{ env.FLUTTER_VERSION }} + + - name: Build and push (nightly) + if: ${{ inputs.channel == 'nightly' }} + uses: docker/build-push-action@v5 + with: + context: . + push: false + platforms: linux/arm64 + file: .github/Dockerfile + tags: spotube-linux-arm64:latest + build-args: | + BUILD_VERSION=nighlty + FLUTTER_VERSION=${{ env.FLUTTER_VERSION }} + + - name: Copy the built packages + run: | + docker create --name spotube-linux-arm64 spotube-linux-arm64:latest + docker cp spotube-linux-arm64:/app/dist/ dist/ - uses: actions/upload-artifact@v3 + if: ${{ inputs.channel == 'stable' }} + with: + if-no-files-found: error + name: Spotube-Release-Binaries + path: | + dist/Spotube-linux-aarch64.deb + dist/Spotube-linux-aarch64.rpm + dist/spotube-linux-${{ env.BUILD_VERSION }}-aarch64.tar.xz + + - uses: actions/upload-artifact@v3 + if: ${{ inputs.channel == 'nightly' }} with: if-no-files-found: error name: Spotube-Release-Binaries @@ -267,7 +306,6 @@ jobs: with: limit-access-to-actor: true - android: runs-on: ubuntu-latest steps: From d3bef1131b3d37ad10251b218009a6336b98bb25 Mon Sep 17 00:00:00 2001 From: Kingkor Roy Tirtho Date: Fri, 19 Apr 2024 17:08:49 +0600 Subject: [PATCH 03/10] cd: don't specify arch in Dockerfile --- .github/Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/Dockerfile b/.github/Dockerfile index e4dacb0e9..cef57ec71 100644 --- a/.github/Dockerfile +++ b/.github/Dockerfile @@ -1,7 +1,7 @@ ARG FLUTTER_VERSION ARG BUILD_VERSION -FROM --platform=arm64 fischerscode/flutter-sudo:${FLUTTER_VERSION} +FROM fischerscode/flutter-sudo:${FLUTTER_VERSION} WORKDIR /app From f14e31423789a5759aa946b70e883a498bdd2d79 Mon Sep 17 00:00:00 2001 From: Kingkor Roy Tirtho Date: Fri, 19 Apr 2024 17:59:43 +0600 Subject: [PATCH 04/10] cd: use custom Dockerfile from ubuntu instead of flutter image --- .github/Dockerfile | 25 ++++++++++++++++++------- 1 file changed, 18 insertions(+), 7 deletions(-) diff --git a/.github/Dockerfile b/.github/Dockerfile index cef57ec71..c67259b23 100644 --- a/.github/Dockerfile +++ b/.github/Dockerfile @@ -1,18 +1,29 @@ ARG FLUTTER_VERSION ARG BUILD_VERSION -FROM fischerscode/flutter-sudo:${FLUTTER_VERSION} +FROM --platform=linux/arm64 ubuntu:22.04 -WORKDIR /app +RUN apt-get update && \ + apt-get install -y bash curl file git unzip xz-utils zip libglu1-mesa cmake tar clang 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 &&\ + rm -rf /var/lib/apt/lists/* + +WORKDIR /home/flutter + +RUN git clone https://github.com/flutter/flutter.git -b ${FLUTTER_VERSION} flutter-sdk + +RUN flutter-sdk/bin/flutter precache -# 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/* +RUN flutter-sdk/bin/flutter config --no-analytics + +ENV PATH="$PATH:/home/flutter/flutter-sdk/bin" +ENV PATH="$PATH:/home/flutter/flutter-sdk/bin/cache/dart-sdk/bin" +ENV PATH="$PATH:/home/flutter/.pub-cache/bin" + +WORKDIR /app COPY . . -RUN sudo chown -R $(whoami) /app +RUN chown -R $(whoami) /app RUN flutter pub get &&\ flutter config --enable-linux-desktop &&\ From 5a9145c88002c17432e64a6f710140804a1fc6eb Mon Sep 17 00:00:00 2001 From: Kingkor Roy Tirtho Date: Fri, 19 Apr 2024 18:29:55 +0600 Subject: [PATCH 05/10] cd: add setup java for android --- .github/workflows/spotube-release-binary.yml | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/.github/workflows/spotube-release-binary.yml b/.github/workflows/spotube-release-binary.yml index b94293e7d..21309c5f9 100644 --- a/.github/workflows/spotube-release-binary.yml +++ b/.github/workflows/spotube-release-binary.yml @@ -314,6 +314,13 @@ jobs: with: cache: true flutter-version: ${{ env.FLUTTER_VERSION }} + - name: Setup Java + uses: actions/setup-java@v4 + with: + distribution: 'zulu' + java-version: '17' + cache: 'gradle' + check-latest: true - name: Install Dependencies run: | From ce7d9765dae7335a07c39bc33ab59d8060d9d064 Mon Sep 17 00:00:00 2001 From: Kingkor Roy Tirtho Date: Fri, 19 Apr 2024 20:44:25 +0600 Subject: [PATCH 06/10] cd: add flutter distributor pre-built docker image for arm --- .github/Dockerfile | 22 +++------------------- .github/Dockerfile.flutter_distributor | 21 +++++++++++++++++++++ 2 files changed, 24 insertions(+), 19 deletions(-) create mode 100644 .github/Dockerfile.flutter_distributor diff --git a/.github/Dockerfile b/.github/Dockerfile index c67259b23..d63e500a2 100644 --- a/.github/Dockerfile +++ b/.github/Dockerfile @@ -1,23 +1,8 @@ ARG FLUTTER_VERSION -ARG BUILD_VERSION - -FROM --platform=linux/arm64 ubuntu:22.04 - -RUN apt-get update && \ - apt-get install -y bash curl file git unzip xz-utils zip libglu1-mesa cmake tar clang 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 &&\ - rm -rf /var/lib/apt/lists/* - -WORKDIR /home/flutter -RUN git clone https://github.com/flutter/flutter.git -b ${FLUTTER_VERSION} flutter-sdk +FROM --platform=linux/arm64 krtirtho/flutter_distributor_arm64:${FLUTTER_VERSION} -RUN flutter-sdk/bin/flutter precache - -RUN flutter-sdk/bin/flutter config --no-analytics - -ENV PATH="$PATH:/home/flutter/flutter-sdk/bin" -ENV PATH="$PATH:/home/flutter/flutter-sdk/bin/cache/dart-sdk/bin" -ENV PATH="$PATH:/home/flutter/.pub-cache/bin" +ARG BUILD_VERSION WORKDIR /app @@ -30,8 +15,7 @@ RUN flutter pub get &&\ flutter pub get &&\ dart run build_runner build --delete-conflicting-outputs -RUN dart pub global activate flutter_distributor &&\ - alias dpkg-deb="dpkg-deb --Zxz" &&\ +RUN alias dpkg-deb="dpkg-deb --Zxz" &&\ flutter_distributor package --platform=linux --targets=deb &&\ flutter_distributor package --platform=linux --targets=rpm diff --git a/.github/Dockerfile.flutter_distributor b/.github/Dockerfile.flutter_distributor new file mode 100644 index 000000000..da697c215 --- /dev/null +++ b/.github/Dockerfile.flutter_distributor @@ -0,0 +1,21 @@ +FROM --platform=linux/arm64 ubuntu:22.04 + +ARG FLUTTER_VERSION + +RUN apt-get update && \ + apt-get install -y bash curl file git unzip xz-utils zip libglu1-mesa cmake tar clang 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 &&\ + rm -rf /var/lib/apt/lists/* + +WORKDIR /home/flutter + +RUN git clone https://github.com/flutter/flutter.git -b v${FLUTTER_VERSION} --single-branch flutter-sdk + +RUN flutter-sdk/bin/flutter precache + +RUN flutter-sdk/bin/flutter config --no-analytics + +ENV PATH="$PATH:/home/flutter/flutter-sdk/bin" +ENV PATH="$PATH:/home/flutter/flutter-sdk/bin/cache/dart-sdk/bin" +ENV PATH="$PATH:/home/flutter/.pub-cache/bin" + +RUN dart pub global activate flutter_distributor \ No newline at end of file From 744df8f273d7e65550cbc0ae034c2a593e7bf798 Mon Sep 17 00:00:00 2001 From: Kingkor Roy Tirtho Date: Fri, 19 Apr 2024 17:44:06 +0000 Subject: [PATCH 07/10] cd: save me from this cursed arm build --- .dockerignore | 2 ++ .github/Dockerfile | 6 ++---- .github/Dockerfile.flutter_distributor | 8 +++++--- .github/workflows/spotube-release-binary.yml | 2 -- 4 files changed, 9 insertions(+), 9 deletions(-) diff --git a/.dockerignore b/.dockerignore index 55fee41a5..ddfd15179 100644 --- a/.dockerignore +++ b/.dockerignore @@ -2,3 +2,5 @@ build dist .dart_tool .idea +.github +.git \ No newline at end of file diff --git a/.github/Dockerfile b/.github/Dockerfile index d63e500a2..6244c097a 100644 --- a/.github/Dockerfile +++ b/.github/Dockerfile @@ -16,12 +16,10 @@ RUN flutter pub get &&\ dart run build_runner build --delete-conflicting-outputs RUN alias dpkg-deb="dpkg-deb --Zxz" &&\ - flutter_distributor package --platform=linux --targets=deb &&\ - flutter_distributor package --platform=linux --targets=rpm + flutter_distributor package --platform=linux --targets=deb 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 + mv dist/**/spotube-*-linux.deb dist/Spotube-linux-aarch64.deb \ No newline at end of file diff --git a/.github/Dockerfile.flutter_distributor b/.github/Dockerfile.flutter_distributor index da697c215..952b9158e 100644 --- a/.github/Dockerfile.flutter_distributor +++ b/.github/Dockerfile.flutter_distributor @@ -2,13 +2,14 @@ FROM --platform=linux/arm64 ubuntu:22.04 ARG FLUTTER_VERSION -RUN apt-get update && \ - apt-get install -y bash curl file git unzip xz-utils zip libglu1-mesa cmake tar clang 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 &&\ +RUN apt-get clean &&\ + apt-get update &&\ + apt-get install -y bash curl file git unzip xz-utils zip libglu1-mesa cmake tar clang 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 && \ rm -rf /var/lib/apt/lists/* WORKDIR /home/flutter -RUN git clone https://github.com/flutter/flutter.git -b v${FLUTTER_VERSION} --single-branch flutter-sdk +RUN git clone https://github.com/flutter/flutter.git -b ${FLUTTER_VERSION} --single-branch flutter-sdk RUN flutter-sdk/bin/flutter precache @@ -17,5 +18,6 @@ RUN flutter-sdk/bin/flutter config --no-analytics ENV PATH="$PATH:/home/flutter/flutter-sdk/bin" ENV PATH="$PATH:/home/flutter/flutter-sdk/bin/cache/dart-sdk/bin" ENV PATH="$PATH:/home/flutter/.pub-cache/bin" +ENV PUB_CACHE="/home/flutter/.pub-cache" RUN dart pub global activate flutter_distributor \ No newline at end of file diff --git a/.github/workflows/spotube-release-binary.yml b/.github/workflows/spotube-release-binary.yml index 21309c5f9..9bfe0f9af 100644 --- a/.github/workflows/spotube-release-binary.yml +++ b/.github/workflows/spotube-release-binary.yml @@ -287,7 +287,6 @@ jobs: name: Spotube-Release-Binaries path: | dist/Spotube-linux-aarch64.deb - dist/Spotube-linux-aarch64.rpm dist/spotube-linux-${{ env.BUILD_VERSION }}-aarch64.tar.xz - uses: actions/upload-artifact@v3 @@ -297,7 +296,6 @@ jobs: 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 From ce4f3d28bc14b8e79912cb02d922d8db669871c4 Mon Sep 17 00:00:00 2001 From: Kingkor Roy Tirtho Date: Sat, 20 Apr 2024 10:20:39 +0600 Subject: [PATCH 08/10] cd: ?? --- .github/Dockerfile | 4 +++- .github/workflows/spotube-release-binary.yml | 10 +++++----- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/.github/Dockerfile b/.github/Dockerfile index 6244c097a..007d1a6e7 100644 --- a/.github/Dockerfile +++ b/.github/Dockerfile @@ -22,4 +22,6 @@ RUN alias dpkg-deb="dpkg-deb --Zxz" &&\ 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 \ No newline at end of file + mv dist/**/spotube-*-linux.deb dist/Spotube-linux-aarch64.deb + +CMD [ "sleep", "5000000" ] \ No newline at end of file diff --git a/.github/workflows/spotube-release-binary.yml b/.github/workflows/spotube-release-binary.yml index 9bfe0f9af..1167effb6 100644 --- a/.github/workflows/spotube-release-binary.yml +++ b/.github/workflows/spotube-release-binary.yml @@ -222,7 +222,7 @@ jobs: - name: Install Dependencies run: | sudo apt-get update -y - 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 + sudo apt-get install -y pkg-config make python3-pip python3-setuptools - name: Replace pubspec version and BUILD_VERSION Env (nightly) if: ${{ inputs.channel == 'nightly' }} @@ -257,7 +257,7 @@ jobs: push: false platforms: linux/arm64 file: .github/Dockerfile - tags: spotube-linux-arm64:latest + tags: krtirtho/spotube_linux_arm:latest build-args: | BUILD_VERSION=${{ env.BUILD_VERSION }} FLUTTER_VERSION=${{ env.FLUTTER_VERSION }} @@ -270,15 +270,15 @@ jobs: push: false platforms: linux/arm64 file: .github/Dockerfile - tags: spotube-linux-arm64:latest + tags: krtirtho/spotube_linux_arm:latest build-args: | BUILD_VERSION=nighlty FLUTTER_VERSION=${{ env.FLUTTER_VERSION }} - name: Copy the built packages run: | - docker create --name spotube-linux-arm64 spotube-linux-arm64:latest - docker cp spotube-linux-arm64:/app/dist/ dist/ + docker create --name spotube_linux_arm krtirtho/spotube_linux_arm:latest + docker cp spotube_linux_arm:/app/dist/ dist/ - uses: actions/upload-artifact@v3 if: ${{ inputs.channel == 'stable' }} From e7c8adfcb30551327c6163df29ecbaa3b179b808 Mon Sep 17 00:00:00 2001 From: Kingkor Roy Tirtho Date: Sat, 20 Apr 2024 10:50:30 +0600 Subject: [PATCH 09/10] cd: ?? --- .github/workflows/spotube-release-binary.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/spotube-release-binary.yml b/.github/workflows/spotube-release-binary.yml index 1167effb6..381bf40c7 100644 --- a/.github/workflows/spotube-release-binary.yml +++ b/.github/workflows/spotube-release-binary.yml @@ -277,6 +277,7 @@ jobs: - name: Copy the built packages run: | + docker images ls docker create --name spotube_linux_arm krtirtho/spotube_linux_arm:latest docker cp spotube_linux_arm:/app/dist/ dist/ From adecc4bc44fda2fa7564d9abce79942d8e56d32c Mon Sep 17 00:00:00 2001 From: Kingkor Roy Tirtho Date: Sat, 20 Apr 2024 11:19:49 +0600 Subject: [PATCH 10/10] cd: use docker build --- .github/workflows/spotube-release-binary.yml | 30 +++++--------------- 1 file changed, 7 insertions(+), 23 deletions(-) diff --git a/.github/workflows/spotube-release-binary.yml b/.github/workflows/spotube-release-binary.yml index 381bf40c7..c7fcbf446 100644 --- a/.github/workflows/spotube-release-binary.yml +++ b/.github/workflows/spotube-release-binary.yml @@ -249,31 +249,15 @@ jobs: run: | sed -i 's|%{{APPDATA_RELEASE}}%||' linux/com.github.KRTirtho.Spotube.appdata.xml - - name: Build and push (stable) + - name: Build Binaries (stable) if: ${{ inputs.channel == 'stable' }} - uses: docker/build-push-action@v5 - with: - context: . - push: false - platforms: linux/arm64 - file: .github/Dockerfile - tags: krtirtho/spotube_linux_arm:latest - build-args: | - BUILD_VERSION=${{ env.BUILD_VERSION }} - FLUTTER_VERSION=${{ env.FLUTTER_VERSION }} - - - name: Build and push (nightly) + run: | + docker buildx build --platform=linux/arm64 -f .github/Dockerfile . --build-arg FLUTTER_VERSION=${{env.FLUTTER_VERSION}} --build-arg BUILD_VERSION=${{env.BUILD_VERSION}} -t krtirtho/spotube_linux_arm:latest --load + + - name: Build Binaries (nightly) if: ${{ inputs.channel == 'nightly' }} - uses: docker/build-push-action@v5 - with: - context: . - push: false - platforms: linux/arm64 - file: .github/Dockerfile - tags: krtirtho/spotube_linux_arm:latest - build-args: | - BUILD_VERSION=nighlty - FLUTTER_VERSION=${{ env.FLUTTER_VERSION }} + run: | + docker buildx build --platform=linux/arm64 -f .github/Dockerfile . --build-arg FLUTTER_VERSION=${{env.FLUTTER_VERSION}} --build-arg BUILD_VERSION=nightly -t krtirtho/spotube_linux_arm:latest --load - name: Copy the built packages run: |