mirror of
https://github.com/KRTirtho/spotube.git
synced 2025-09-12 23:45:18 +00:00
cd: use new hosted github runners
This commit is contained in:
parent
becba8956f
commit
85ebaf69de
32
.github/workflows/spotube-release-binary.yml
vendored
32
.github/workflows/spotube-release-binary.yml
vendored
@ -33,31 +33,37 @@ jobs:
|
|||||||
include:
|
include:
|
||||||
- os: ubuntu-latest
|
- os: ubuntu-latest
|
||||||
platform: linux
|
platform: linux
|
||||||
|
arch: x86
|
||||||
files: |
|
files: |
|
||||||
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
|
- os: ubuntu-22.04-arm
|
||||||
platform: linux_arm
|
platform: linux
|
||||||
|
arch: arm64
|
||||||
files: |
|
files: |
|
||||||
dist/Spotube-linux-aarch64.deb
|
dist/Spotube-linux-aarch64.deb
|
||||||
dist/spotube-linux-*-aarch64.tar.xz
|
dist/spotube-linux-*-aarch64.tar.xz
|
||||||
- os: ubuntu-latest
|
- os: ubuntu-latest
|
||||||
platform: android
|
platform: android
|
||||||
|
arch: all
|
||||||
files: |
|
files: |
|
||||||
build/Spotube-android-all-arch.apk
|
build/Spotube-android-all-arch.apk
|
||||||
build/Spotube-playstore-all-arch.aab
|
build/Spotube-playstore-all-arch.aab
|
||||||
- os: windows-latest
|
- os: windows-latest
|
||||||
platform: windows
|
platform: windows
|
||||||
|
arch: x86
|
||||||
files: |
|
files: |
|
||||||
dist/Spotube-windows-x86_64.nupkg
|
dist/Spotube-windows-x86_64.nupkg
|
||||||
dist/Spotube-windows-x86_64-setup.exe
|
dist/Spotube-windows-x86_64-setup.exe
|
||||||
- os: macos-latest
|
- os: macos-latest
|
||||||
platform: ios
|
platform: ios
|
||||||
|
arch: all
|
||||||
files: |
|
files: |
|
||||||
Spotube-iOS.ipa
|
Spotube-iOS.ipa
|
||||||
- os: macos-14
|
- os: macos-14
|
||||||
platform: macos
|
platform: macos
|
||||||
|
arch: all
|
||||||
files: |
|
files: |
|
||||||
build/Spotube-macos-universal.dmg
|
build/Spotube-macos-universal.dmg
|
||||||
build/Spotube-macos-universal.pkg
|
build/Spotube-macos-universal.pkg
|
||||||
@ -78,14 +84,8 @@ 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: Setup Rust toolchain
|
- name: Setup Rust toolchain
|
||||||
if: ${{matrix.platform != 'linux_arm'}}
|
|
||||||
uses: dtolnay/rust-toolchain@stable
|
uses: dtolnay/rust-toolchain@stable
|
||||||
with:
|
with:
|
||||||
toolchain: stable
|
toolchain: stable
|
||||||
@ -107,20 +107,8 @@ jobs:
|
|||||||
echo '${{ secrets.KEYSTORE }}' | base64 --decode > android/app/upload-keystore.jks
|
echo '${{ secrets.KEYSTORE }}' | base64 --decode > android/app/upload-keystore.jks
|
||||||
echo '${{ secrets.KEY_PROPERTIES }}' > android/key.properties
|
echo '${{ secrets.KEY_PROPERTIES }}' > android/key.properties
|
||||||
|
|
||||||
- name: Uncessary hosted tools
|
|
||||||
if: ${{matrix.platform == 'linux_arm'}}
|
|
||||||
uses: jlumbroso/free-disk-space@main
|
|
||||||
with:
|
|
||||||
tool-cache: false
|
|
||||||
swap-storage: false
|
|
||||||
android: true
|
|
||||||
dotnet: true
|
|
||||||
haskell: true
|
|
||||||
large-packages: true
|
|
||||||
docker-images: true
|
|
||||||
|
|
||||||
- name: Build ${{matrix.platform}} binaries
|
- name: Build ${{matrix.platform}} binaries
|
||||||
run: dart cli/cli.dart build ${{matrix.platform}}
|
run: dart cli/cli.dart build --arch=${{matrix.arch}} ${{matrix.platform}}
|
||||||
env:
|
env:
|
||||||
CHANNEL: ${{inputs.channel}}
|
CHANNEL: ${{inputs.channel}}
|
||||||
DOTENV: ${{secrets.DOTENV_RELEASE}}
|
DOTENV: ${{secrets.DOTENV_RELEASE}}
|
||||||
|
@ -3,7 +3,6 @@ import 'package:args/command_runner.dart';
|
|||||||
import 'build/android.dart';
|
import 'build/android.dart';
|
||||||
import 'build/ios.dart';
|
import 'build/ios.dart';
|
||||||
import 'build/linux.dart';
|
import 'build/linux.dart';
|
||||||
import 'build/linux_arm.dart';
|
|
||||||
import 'build/macos.dart';
|
import 'build/macos.dart';
|
||||||
import 'build/windows.dart';
|
import 'build/windows.dart';
|
||||||
|
|
||||||
@ -18,8 +17,13 @@ class BuildCommand extends Command {
|
|||||||
addSubcommand(AndroidBuildCommand());
|
addSubcommand(AndroidBuildCommand());
|
||||||
addSubcommand(IosBuildCommand());
|
addSubcommand(IosBuildCommand());
|
||||||
addSubcommand(LinuxBuildCommand());
|
addSubcommand(LinuxBuildCommand());
|
||||||
addSubcommand(LinuxArmBuildCommand());
|
|
||||||
addSubcommand(MacosBuildCommand());
|
addSubcommand(MacosBuildCommand());
|
||||||
addSubcommand(WindowsBuildCommand());
|
addSubcommand(WindowsBuildCommand());
|
||||||
|
argParser.addOption(
|
||||||
|
"arch",
|
||||||
|
abbr: "a",
|
||||||
|
defaultsTo: "x86",
|
||||||
|
allowed: ["x86", "arm64", "all"],
|
||||||
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -63,4 +63,6 @@ mixin BuildCommandCommonSteps on Command {
|
|||||||
""",
|
""",
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
String get architecture => argResults?.option("arch") as String;
|
||||||
}
|
}
|
||||||
|
@ -37,23 +37,32 @@ class LinuxBuildCommand extends Command with BuildCommandCommonSteps {
|
|||||||
await bootstrap();
|
await bootstrap();
|
||||||
|
|
||||||
await shell.run(
|
await shell.run(
|
||||||
"""
|
"flutter_distributor package --platform=linux --targets=deb",
|
||||||
flutter_distributor package --platform=linux --targets=deb
|
|
||||||
flutter_distributor package --platform=linux --targets=rpm
|
|
||||||
""",
|
|
||||||
);
|
);
|
||||||
|
|
||||||
|
if (architecture == "x86") {
|
||||||
|
await shell.run(
|
||||||
|
"flutter_distributor package --platform=linux --targets=rpm",
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
final tempDir = join(Directory.systemTemp.path, "spotube-tar");
|
final tempDir = join(Directory.systemTemp.path, "spotube-tar");
|
||||||
|
|
||||||
final bundleDirPath =
|
final bundleDirPath = join(
|
||||||
join(cwd.path, "build", "linux", "x64", "release", "bundle");
|
cwd.path,
|
||||||
|
"build",
|
||||||
|
"linux",
|
||||||
|
architecture == "x86" ? "x64" : architecture,
|
||||||
|
"release",
|
||||||
|
"bundle",
|
||||||
|
);
|
||||||
|
|
||||||
final tarFile = File(join(
|
final tarFile = File(join(
|
||||||
cwd.path,
|
cwd.path,
|
||||||
"dist",
|
"dist",
|
||||||
"spotube-linux-"
|
"spotube-linux-"
|
||||||
"${CliEnv.channel == BuildChannel.nightly ? "nightly" : versionWithoutBuildNumber}"
|
"${CliEnv.channel == BuildChannel.nightly ? "nightly" : versionWithoutBuildNumber}"
|
||||||
"-x86_64.tar.xz",
|
"-${architecture == "x86" ? "x86_64" : "aarch64"}.tar.xz",
|
||||||
));
|
));
|
||||||
|
|
||||||
await copyPath(bundleDirPath, tempDir);
|
await copyPath(bundleDirPath, tempDir);
|
||||||
@ -81,25 +90,27 @@ class LinuxBuildCommand extends Command with BuildCommandCommonSteps {
|
|||||||
"spotube-${pubspec.version}-linux.deb",
|
"spotube-${pubspec.version}-linux.deb",
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
|
|
||||||
final ogRpm = File(
|
|
||||||
join(
|
|
||||||
cwd.path,
|
|
||||||
"dist",
|
|
||||||
pubspec.version.toString(),
|
|
||||||
"spotube-${pubspec.version}-linux.rpm",
|
|
||||||
),
|
|
||||||
);
|
|
||||||
|
|
||||||
await ogDeb.copy(
|
await ogDeb.copy(
|
||||||
join(cwd.path, "dist", "Spotube-linux-x86_64.deb"),
|
join(cwd.path, "dist", "Spotube-linux-x86_64.deb"),
|
||||||
);
|
);
|
||||||
await ogRpm.copy(
|
|
||||||
join(cwd.path, "dist", "Spotube-linux-x86_64.rpm"),
|
|
||||||
);
|
|
||||||
|
|
||||||
await ogDeb.delete();
|
await ogDeb.delete();
|
||||||
await ogRpm.delete();
|
|
||||||
|
if (architecture == "x86") {
|
||||||
|
final ogRpm = File(
|
||||||
|
join(
|
||||||
|
cwd.path,
|
||||||
|
"dist",
|
||||||
|
pubspec.version.toString(),
|
||||||
|
"spotube-${pubspec.version}-linux.rpm",
|
||||||
|
),
|
||||||
|
);
|
||||||
|
|
||||||
|
await ogRpm.copy(
|
||||||
|
join(cwd.path, "dist", "Spotube-linux-x86_64.rpm"),
|
||||||
|
);
|
||||||
|
|
||||||
|
await ogRpm.delete();
|
||||||
|
}
|
||||||
|
|
||||||
stdout.writeln("✅ Linux building done");
|
stdout.writeln("✅ Linux building done");
|
||||||
}
|
}
|
||||||
|
@ -1,37 +0,0 @@
|
|||||||
import 'dart:async';
|
|
||||||
|
|
||||||
import 'package:args/command_runner.dart';
|
|
||||||
import 'package:path/path.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 ${join(cwd.path, ".github", "Dockerfile")} ${cwd.path} "
|
|
||||||
"--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/
|
|
||||||
""",
|
|
||||||
);
|
|
||||||
}
|
|
||||||
}
|
|
@ -24,6 +24,13 @@ class InstallDependenciesCommand extends Command {
|
|||||||
],
|
],
|
||||||
mandatory: true,
|
mandatory: true,
|
||||||
);
|
);
|
||||||
|
|
||||||
|
argParser.addOption(
|
||||||
|
"arch",
|
||||||
|
abbr: "a",
|
||||||
|
allowed: ["x86", "arm64", "all"],
|
||||||
|
defaultsTo: "x86",
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
@override
|
@override
|
||||||
@ -41,14 +48,6 @@ 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(
|
||||||
"""
|
"""
|
||||||
|
Loading…
Reference in New Issue
Block a user