mirror of
https://github.com/KRTirtho/spotube.git
synced 2025-12-09 08:47:31 +00:00
feat: add linux_arm platform
This commit is contained in:
parent
28a213831d
commit
97a58f0b2c
13
.github/Dockerfile
vendored
13
.github/Dockerfile
vendored
@ -10,17 +10,14 @@ COPY . .
|
|||||||
|
|
||||||
RUN chown -R $(whoami) /app
|
RUN chown -R $(whoami) /app
|
||||||
|
|
||||||
RUN flutter pub get &&\
|
RUN flutter pub get
|
||||||
flutter config --enable-linux-desktop &&\
|
|
||||||
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
|
|
||||||
|
|
||||||
|
|
||||||
RUN make tar VERSION=${BUILD_VERSION} ARCH=arm64 PKG_ARCH=aarch64
|
RUN make tar VERSION=${BUILD_VERSION} ARCH=arm64 PKG_ARCH=aarch64
|
||||||
|
|
||||||
|
RUN alias dpkg-deb="dpkg-deb --Zxz" &&\
|
||||||
|
flutter_distributor package --platform=linux --targets=deb --skip-clean
|
||||||
|
|
||||||
|
|
||||||
RUN mv build/spotube-linux-*-aarch64.tar.xz dist/ &&\
|
RUN mv build/spotube-linux-*-aarch64.tar.xz dist/ &&\
|
||||||
mv dist/**/spotube-*-linux.deb dist/Spotube-linux-aarch64.deb
|
mv dist/**/spotube-*-linux.deb dist/Spotube-linux-aarch64.deb
|
||||||
|
|
||||||
|
|||||||
11
.github/workflows/spotube-release-binary.yml
vendored
11
.github/workflows/spotube-release-binary.yml
vendored
@ -36,6 +36,11 @@ jobs:
|
|||||||
dist/Spotube-linux-x86_64.deb
|
dist/Spotube-linux-x86_64.deb
|
||||||
dist/Spotube-linux-x86_64.rpm
|
dist/Spotube-linux-x86_64.rpm
|
||||||
dist/spotube-linux-*-x86_64.tar.xz
|
dist/spotube-linux-*-x86_64.tar.xz
|
||||||
|
- os: ubuntu-latest
|
||||||
|
platform: linux_arm
|
||||||
|
files: |
|
||||||
|
dist/Spotube-linux-aarch64.deb
|
||||||
|
dist/spotube-linux-*-aarch64.tar.xz
|
||||||
- os: ubuntu-latest
|
- os: ubuntu-latest
|
||||||
platform: android
|
platform: android
|
||||||
files: |
|
files: |
|
||||||
@ -70,6 +75,12 @@ jobs:
|
|||||||
java-version: '17'
|
java-version: '17'
|
||||||
cache: 'gradle'
|
cache: 'gradle'
|
||||||
check-latest: true
|
check-latest: true
|
||||||
|
- name: Set up QEMU
|
||||||
|
if: ${{matrix.platform == 'linux_arm'}}
|
||||||
|
uses: docker/setup-qemu-action@v3
|
||||||
|
- name: Set up Docker Buildx
|
||||||
|
if: ${{matrix.platform == 'linux_arm'}}
|
||||||
|
uses: docker/setup-buildx-action@v3
|
||||||
|
|
||||||
- name: Install ${{matrix.platform}} dependencies
|
- name: Install ${{matrix.platform}} dependencies
|
||||||
run: |
|
run: |
|
||||||
|
|||||||
36
cli/commands/build/linux_arm.dart
Normal file
36
cli/commands/build/linux_arm.dart
Normal file
@ -0,0 +1,36 @@
|
|||||||
|
import 'dart:async';
|
||||||
|
|
||||||
|
import 'package:args/command_runner.dart';
|
||||||
|
|
||||||
|
import '../../core/env.dart';
|
||||||
|
import 'common.dart';
|
||||||
|
|
||||||
|
class LinuxArmBuildCommand extends Command with BuildCommandCommonSteps {
|
||||||
|
@override
|
||||||
|
String get description => "Build Linux Arm";
|
||||||
|
|
||||||
|
@override
|
||||||
|
String get name => "linux_arm";
|
||||||
|
|
||||||
|
@override
|
||||||
|
FutureOr? run() async {
|
||||||
|
await bootstrap();
|
||||||
|
|
||||||
|
await shell.run(
|
||||||
|
"docker buildx build --platform=linux/arm64 "
|
||||||
|
"-f .github/Dockerfile . "
|
||||||
|
"--build-arg FLUTTER_VERSION=${CliEnv.flutterVersion} "
|
||||||
|
"--build-arg BUILD_VERSION=${CliEnv.channel == BuildChannel.nightly ? "nightly" : versionWithoutBuildNumber} "
|
||||||
|
"-t krtirtho/spotube_linux_arm:latest "
|
||||||
|
"--load",
|
||||||
|
);
|
||||||
|
|
||||||
|
await shell.run(
|
||||||
|
"""
|
||||||
|
docker images ls
|
||||||
|
docker create --name spotube_linux_arm krtirtho/spotube_linux_arm:latest
|
||||||
|
docker cp spotube_linux_arm:/app/dist/ dist/
|
||||||
|
""",
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -17,6 +17,7 @@ class InstallDependenciesCommand extends Command {
|
|||||||
allowed: [
|
allowed: [
|
||||||
"windows",
|
"windows",
|
||||||
"linux",
|
"linux",
|
||||||
|
"linux_arm",
|
||||||
"macos",
|
"macos",
|
||||||
"ios",
|
"ios",
|
||||||
"android",
|
"android",
|
||||||
@ -40,6 +41,14 @@ class InstallDependenciesCommand extends Command {
|
|||||||
""",
|
""",
|
||||||
);
|
);
|
||||||
break;
|
break;
|
||||||
|
case "linux_arm":
|
||||||
|
await shell.run(
|
||||||
|
"""
|
||||||
|
sudo apt-get update -y
|
||||||
|
sudo apt-get install -y pkg-config make python3-pip python3-setuptools
|
||||||
|
""",
|
||||||
|
);
|
||||||
|
break;
|
||||||
case "macos":
|
case "macos":
|
||||||
await shell.run(
|
await shell.run(
|
||||||
"""
|
"""
|
||||||
|
|||||||
@ -20,4 +20,5 @@ class CliEnv {
|
|||||||
static final channel = BuildChannel.fromEnvironment("CHANNEL");
|
static final channel = BuildChannel.fromEnvironment("CHANNEL");
|
||||||
static final dotenv = Platform.environment["DOTENV"]!;
|
static final dotenv = Platform.environment["DOTENV"]!;
|
||||||
static final ghRunNumber = Platform.environment["GITHUB_RUN_NUMBER"];
|
static final ghRunNumber = Platform.environment["GITHUB_RUN_NUMBER"];
|
||||||
|
static final flutterVersion = Platform.environment["FLUTTER_VERSION"]!;
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user