-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
cd: remove circle ci & use docker qemu build
- Loading branch information
Showing
3 changed files
with
130 additions
and
179 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
# Use the aarch64 Ubuntu 22.04 as the base image | ||
FROM arm64v8/ubuntu:22.04 | ||
|
||
ARG BUILD_VERSION | ||
|
||
|
||
# Set the working directory to /app | ||
WORKDIR /app | ||
|
||
# Update and install necessary dependencies | ||
RUN apt-get update && \ | ||
apt-get install -y curl git unzip tar clang cmake ninja-build pkg-config libgtk-3-dev libglu1-mesa-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 | ||
|
||
# Install Flutter (latest stable version) with Linux support | ||
RUN git clone https://github.com/flutter/flutter.git /opt/flutter && \ | ||
export PATH="$PATH:/opt/flutter/bin" && \ | ||
flutter precache && \ | ||
flutter config --enable-linux-desktop && \ | ||
dart pub global activate flutter_distributor &&\ | ||
export PATH="$PATH:/root/.pub-cache/bin" | ||
|
||
RUN wget -O appimagetool "https://github.com/AppImage/AppImageKit/releases/download/continuous/appimagetool-aarch64.AppImage" &&\ | ||
chmod +x appimagetool &&\ | ||
mv appimagetool /usr/local/bin | ||
|
||
|
||
# Copy over all the repository files from the host into the container | ||
COPY .. . | ||
|
||
# Run flutter build for Linux ARM | ||
RUN alias dpkg-deb="dpkg-deb --Zxz" &&\ | ||
flutter_distributor package --platform=linux --targets=deb &&\ | ||
flutter_distributor package --platform=linux --targets=appimage &&\ | ||
flutter_distributor package --platform=linux --targets=rpm &&\ | ||
make tar VERSION=${BUILD_VERSION} ARCH=arm64 PKG_ARCH=aarch64 | ||
|
||
# Move artifacts | ||
RUN mkdir bundle &&\ | ||
mv build/spotube-linux-*-aarch64.tar.xz bundle/ &&\ | ||
mv dist/**/spotube-*-linux.deb bundle/Spotube-linux-aarch64.deb &&\ | ||
mv dist/**/spotube-*-linux.rpm bundle/Spotube-linux-aarch64.rpm &&\ | ||
mv dist/**/spotube-*-linux.AppImage bundle/Spotube-linux-aarch64.AppImag | ||
|
||
RUN mkdir -p /host/app/bundle && \ | ||
cp -r bundle/* /host/app/bundle | ||
|
||
# Set the working directory to /host/app | ||
WORKDIR /host/app | ||
|
||
# Finish the Dockerfile | ||
CMD ["echo", "Done!"] |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -188,6 +188,85 @@ jobs: | |
name: Spotube-Release-Binaries | ||
path: dist/ | ||
|
||
linux_arm: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: subosito/[email protected] | ||
with: | ||
cache: true | ||
flutter-version: ${{ env.FLUTTER_VERSION }} | ||
|
||
- uses: docker/setup-qemu-action@v3 | ||
- uses: docker/setup-buildx-action@v3 | ||
with: | ||
platforms: linux/arm64 | ||
|
||
- name: Get current date | ||
id: date | ||
run: echo "::set-output name=date::$(date +'%Y-%m-%d')" | ||
|
||
- 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: | | ||
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: 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: Replace Version in files | ||
run: | | ||
sed -i 's|%{{APPDATA_RELEASE}}%|<release version="${{ env.BUILD_VERSION }}" date="${{ steps.date.outputs.date }}" />|' linux/com.github.KRTirtho.Spotube.appdata.xml | ||
echo "build_arch: aarch64" >> linux/packaging/rpm/make_config.yaml | ||
- name: Generate Secrets | ||
run: | | ||
flutter config --enable-linux-desktop | ||
flutter pub get | ||
dart run build_runner build --delete-conflicting-outputs --enable-experiment=records,patterns | ||
- name: Setup Docker build | ||
run: | | ||
docker run --rm --privileged multiarch/qemu-user-static --reset -p yes | ||
docker buildx create --name spotube_builder --use | ||
docker buildx inspect spotube_builder --bootstrap | ||
- name: Run Docker build | ||
run: | | ||
docker buildx build -t spotube_arm:latest .github \ | ||
--platform linux/arm64 \ | ||
--build-arg BUILD_VERSION=${{ env.BUILD_VERSION }} | ||
docker run -v $(pwd)/bundle:/host/app/bundle spotube_arm:latest | ||
- name: Debug With SSH When fails | ||
if: ${{ failure() && inputs.debug && inputs.channel == 'nightly' }} | ||
uses: mxschmitt/action-tmate@v3 | ||
with: | ||
limit-access-to-actor: true | ||
|
||
- uses: actions/upload-artifact@v3 | ||
with: | ||
name: Spotube-Release-Binaries | ||
path: bundle/ | ||
|
||
android: | ||
runs-on: ubuntu-latest | ||
steps: | ||
|