mirror of
https://github.com/localsend/localsend.git
synced 2026-06-23 04:10:07 +00:00
ci: update release pipeline
This commit is contained in:
@@ -0,0 +1,72 @@
|
||||
name: Build arm64 AppImage
|
||||
|
||||
on:
|
||||
workflow_dispatch:
|
||||
|
||||
env:
|
||||
FLUTTER_VERSION: "3.16.2"
|
||||
|
||||
jobs:
|
||||
build:
|
||||
runs-on: ubuntu-22.04
|
||||
outputs:
|
||||
version: ${{ steps.get_version.outputs.version }}
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
|
||||
- name: Get version from pubspec.yaml
|
||||
id: get_version
|
||||
run: |
|
||||
VERSION=$(sed -n 's/^version: \([0-9]*\.[0-9]*\.[0-9]*\).*/\1/p' app/pubspec.yaml)
|
||||
echo "version=$VERSION" >> $GITHUB_OUTPUT
|
||||
|
||||
# Manage the Flutter version on the self-hosted runner manually!
|
||||
# Flutter currently doesn't provide Linux ARM64 binaries.
|
||||
build_appimage_arm_64:
|
||||
needs: build
|
||||
runs-on: [self-hosted, linux, arm64]
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
|
||||
- name: Install dependencies
|
||||
run: |
|
||||
sudo apt-get update
|
||||
sudo apt-get install -y clang cmake libgtk-3-dev ninja-build libayatana-appindicator3-dev libfuse2
|
||||
|
||||
- name: Dependencies
|
||||
working-directory: app
|
||||
run: flutter pub get
|
||||
|
||||
- name: Compile linux
|
||||
working-directory: app
|
||||
run: flutter build linux
|
||||
|
||||
- name: Copy compiled linux files
|
||||
run: |
|
||||
mkdir AppDir
|
||||
cp -r app/build/linux/arm64/release/bundle/* AppDir/
|
||||
|
||||
- name: Copy logo to AppDir
|
||||
run: |
|
||||
mkdir -p AppDir/usr/share/icons/hicolor/32x32/apps
|
||||
cp app/assets/img/logo-32.png AppDir/usr/share/icons/hicolor/32x32/apps/localsend.png
|
||||
mkdir -p AppDir/usr/share/icons/hicolor/128x128/apps
|
||||
cp app/assets/img/logo-128.png AppDir/usr/share/icons/hicolor/128x128/apps/localsend.png
|
||||
mkdir -p AppDir/usr/share/icons/hicolor/256x256/apps
|
||||
cp app/assets/img/logo-256.png AppDir/usr/share/icons/hicolor/256x256/apps/localsend.png
|
||||
|
||||
- name: Copy Recipe to correct location
|
||||
run: cp scripts/appimage/AppImageBuilder_arm_64.yml AppImageBuilder.yml
|
||||
|
||||
- name: Build AppImage
|
||||
uses: AppImageCrafters/build-appimage@57c3bc6963f870ce3be103117de5b5e33ffbaeb6
|
||||
with:
|
||||
recipe: ./AppImageBuilder.yml
|
||||
|
||||
- name: Upload AppImage file
|
||||
uses: actions/upload-artifact@v3
|
||||
with:
|
||||
name: appimage-arm-64-result
|
||||
path: ./*.AppImage
|
||||
+167
-27
@@ -72,7 +72,7 @@ jobs:
|
||||
name: apk-result
|
||||
path: ${{ env.APK_BUILD_DIR }}/app/build/app/outputs/flutter-apk/app-release.apk
|
||||
|
||||
build_tar:
|
||||
build_tar_x86_64:
|
||||
needs: build
|
||||
runs-on: ubuntu-20.04
|
||||
|
||||
@@ -105,10 +105,43 @@ jobs:
|
||||
- name: Upload tar.gz archive
|
||||
uses: actions/upload-artifact@v3
|
||||
with:
|
||||
name: tar-gz-result
|
||||
name: tar-gz-x86-64-result
|
||||
path: ./app/*.tar.gz
|
||||
|
||||
build_deb:
|
||||
# Manage the Flutter version on the self-hosted runner manually!
|
||||
# Flutter currently doesn't provide Linux ARM64 binaries.
|
||||
build_tar_arm_64:
|
||||
needs: build
|
||||
runs-on: [ self-hosted, linux, arm64 ]
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
|
||||
- name: Install dependencies
|
||||
run: |
|
||||
sudo apt-get update
|
||||
sudo apt-get install -y clang cmake libgtk-3-dev ninja-build libayatana-appindicator3-dev
|
||||
|
||||
- name: Dependencies
|
||||
working-directory: app
|
||||
run: flutter pub get
|
||||
|
||||
- name: Compile linux
|
||||
working-directory: app
|
||||
run: flutter build linux
|
||||
|
||||
- name: Create tar.gz archive
|
||||
run: |
|
||||
cd app/build/linux/arm64/release/bundle
|
||||
tar -czvf ../../../../../result.tar.gz *
|
||||
|
||||
- name: Upload tar.gz archive
|
||||
uses: actions/upload-artifact@v3
|
||||
with:
|
||||
name: tar-gz-arm-64-result
|
||||
path: ./app/*.tar.gz
|
||||
|
||||
build_deb_x86_64:
|
||||
needs: build
|
||||
runs-on: ubuntu-20.04
|
||||
|
||||
@@ -153,10 +186,63 @@ jobs:
|
||||
- name: Upload deb file
|
||||
uses: actions/upload-artifact@v3
|
||||
with:
|
||||
name: deb-result
|
||||
name: deb-x86-64-result
|
||||
path: ${{ steps.find_deb.outputs.deb_path }}
|
||||
|
||||
build_appimage:
|
||||
# Manage the Flutter version on the self-hosted runner manually!
|
||||
# Flutter currently doesn't provide Linux ARM64 binaries.
|
||||
build_deb_arm_64:
|
||||
needs: build
|
||||
runs-on: [ self-hosted, linux, arm64 ]
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
|
||||
- name: Install dependencies
|
||||
run: |
|
||||
sudo apt-get update
|
||||
sudo apt-get install -y clang cmake libgtk-3-dev ninja-build libayatana-appindicator3-dev
|
||||
|
||||
- name: Enable dart_distributor
|
||||
run: dart pub global activate flutter_distributor
|
||||
|
||||
- name: Build deb package
|
||||
working-directory: app
|
||||
run: PATH="$PATH:$HOME/.pub-cache/bin" flutter_distributor package --platform linux --targets deb
|
||||
|
||||
- name: Find deb file
|
||||
id: find_deb
|
||||
run: |
|
||||
VERSION=${{ needs.build.outputs.version }}
|
||||
DEB_PATH=$(find app/dist -name "localsend_app-$VERSION*-linux.deb")
|
||||
echo "deb_path=$DEB_PATH" >> $GITHUB_OUTPUT
|
||||
|
||||
- name: Check if deb file exists
|
||||
id: check_file
|
||||
run: |
|
||||
if [[ ! -f "${{ steps.find_deb.outputs.deb_path }}" ]]; then
|
||||
echo "File not found: ${{ steps.find_deb.outputs.deb_path }}"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Remove this when: https://github.com/leanflutter/flutter_distributor/pull/150 is merged
|
||||
- name: Update Architecture
|
||||
run: |
|
||||
mkdir temp
|
||||
cd temp
|
||||
ar x ../${{ steps.find_deb.outputs.deb_path }}
|
||||
tar xJf control.tar.xz --overwrite
|
||||
sed -i '/Architecture:/c\Architecture: arm64' ./control
|
||||
tar cJf control.tar.xz control postinst postrm
|
||||
ar rcs ../${{ steps.find_deb.outputs.deb_path }} debian-binary control.tar.xz data.tar.xz
|
||||
|
||||
- name: Upload deb file
|
||||
uses: actions/upload-artifact@v3
|
||||
with:
|
||||
name: deb-arm-64-result
|
||||
path: ${{ steps.find_deb.outputs.deb_path }}
|
||||
|
||||
build_appimage_x86_64:
|
||||
needs: build
|
||||
runs-on: ubuntu-20.04
|
||||
|
||||
@@ -195,6 +281,9 @@ jobs:
|
||||
mkdir -p AppDir/usr/share/icons/hicolor/256x256/apps
|
||||
cp app/assets/img/logo-256.png AppDir/usr/share/icons/hicolor/256x256/apps/localsend.png
|
||||
|
||||
- name: Copy Recipe to correct location
|
||||
run: cp scripts/appimage/AppImageBuilder_x86_64.yml AppImageBuilder.yml
|
||||
|
||||
- name: Build AppImage
|
||||
uses: AppImageCrafters/build-appimage@57c3bc6963f870ce3be103117de5b5e33ffbaeb6
|
||||
with:
|
||||
@@ -203,10 +292,10 @@ jobs:
|
||||
- name: Upload AppImage file
|
||||
uses: actions/upload-artifact@v3
|
||||
with:
|
||||
name: appimage-result
|
||||
name: appimage-x86-64-result
|
||||
path: ./*.AppImage
|
||||
|
||||
build_windows_zip:
|
||||
build_windows_zip_x86_64:
|
||||
needs: build
|
||||
runs-on: windows-latest
|
||||
|
||||
@@ -241,11 +330,19 @@ jobs:
|
||||
- name: Upload zip
|
||||
uses: actions/upload-artifact@v3
|
||||
with:
|
||||
name: windows-zip-result
|
||||
name: windows-zip-x86-64-result
|
||||
path: app/LocalSend.zip
|
||||
|
||||
release:
|
||||
needs: [build, build_apk, build_tar, build_deb, build_appimage, build_windows_zip]
|
||||
needs:
|
||||
- build
|
||||
- build_apk
|
||||
- build_tar_x86_64
|
||||
- build_tar_arm_64
|
||||
- build_deb_x86_64
|
||||
- build_deb_arm_64
|
||||
- build_appimage_x86_64
|
||||
- build_windows_zip_x86_64
|
||||
runs-on: ubuntu-20.04
|
||||
|
||||
steps:
|
||||
@@ -280,18 +377,18 @@ jobs:
|
||||
asset_name: LocalSend-${{ needs.build.outputs.version }}.apk
|
||||
asset_content_type: application/vnd.android.package-archive
|
||||
|
||||
# TAR.GZ
|
||||
# TAR.GZ (x86_64)
|
||||
- name: Download tar.gz file
|
||||
uses: actions/download-artifact@v3
|
||||
with:
|
||||
name: tar-gz-result
|
||||
path: tar-gz-result
|
||||
name: tar-gz-x86-64-result
|
||||
path: tar-gz-x86-64-result
|
||||
|
||||
- name: List files in tar.gz-directory
|
||||
run: ls -l tar-gz-result
|
||||
run: ls -l tar-gz-x86-64-result
|
||||
|
||||
- name: Copy tar.gz file to root
|
||||
run: cp tar-gz-result/* result.tar.gz
|
||||
run: cp tar-gz-x86-64-result/* result.tar.gz
|
||||
|
||||
- name: Upload Release Asset (tar.gz)
|
||||
uses: actions/upload-release-asset@v1
|
||||
@@ -303,15 +400,38 @@ jobs:
|
||||
asset_name: LocalSend-${{ needs.build.outputs.version }}-linux-x86-64.tar.gz
|
||||
asset_content_type: application/gzip
|
||||
|
||||
# DEB
|
||||
# TAR.GZ (arm_64)
|
||||
- name: Download tar.gz file
|
||||
uses: actions/download-artifact@v3
|
||||
with:
|
||||
name: tar-gz-arm-64-result
|
||||
path: tar-gz-arm-64-result
|
||||
|
||||
- name: List files in tar.gz-directory
|
||||
run: ls -l tar-gz-arm-64-result
|
||||
|
||||
- name: Copy tar.gz file to root
|
||||
run: cp tar-gz-arm-64-result/* result.tar.gz
|
||||
|
||||
- name: Upload Release Asset (tar.gz)
|
||||
uses: actions/upload-release-asset@v1
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
with:
|
||||
upload_url: ${{ steps.draft_release.outputs.upload_url }}
|
||||
asset_path: result.tar.gz
|
||||
asset_name: LocalSend-${{ needs.build.outputs.version }}-linux-arm-64.tar.gz
|
||||
asset_content_type: application/gzip
|
||||
|
||||
# DEB (x86_64)
|
||||
- name: Download deb file
|
||||
uses: actions/download-artifact@v3
|
||||
with:
|
||||
name: deb-result
|
||||
path: deb-result
|
||||
name: deb-x86-64-result
|
||||
path: deb-x86-64-result
|
||||
|
||||
- name: Copy deb file to root
|
||||
run: cp deb-result/*.deb result.deb
|
||||
run: cp deb-x86-64-result/*.deb result.deb
|
||||
|
||||
- name: Upload Release Asset
|
||||
uses: actions/upload-release-asset@v1
|
||||
@@ -323,19 +443,39 @@ jobs:
|
||||
asset_name: LocalSend-${{ needs.build.outputs.version }}-linux-x86-64.deb
|
||||
asset_content_type: application/vnd.debian.binary-package
|
||||
|
||||
# APPIMAGE
|
||||
# DEB (arm_64)
|
||||
- name: Download deb file
|
||||
uses: actions/download-artifact@v3
|
||||
with:
|
||||
name: deb-arm-64-result
|
||||
path: deb-arm-64-result
|
||||
|
||||
- name: Copy deb file to root
|
||||
run: cp deb-arm-64-result/*.deb result.deb
|
||||
|
||||
- name: Upload Release Asset
|
||||
uses: actions/upload-release-asset@v1
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
with:
|
||||
upload_url: ${{ steps.draft_release.outputs.upload_url }}
|
||||
asset_path: result.deb
|
||||
asset_name: LocalSend-${{ needs.build.outputs.version }}-linux-arm-64.deb
|
||||
asset_content_type: application/vnd.debian.binary-package
|
||||
|
||||
# APPIMAGE (x86_64)
|
||||
- name: Download AppImage file
|
||||
uses: actions/download-artifact@v3
|
||||
with:
|
||||
name: appimage-result
|
||||
path: appimage-result
|
||||
name: appimage-x86-64-result
|
||||
path: appimage-x86-64-result
|
||||
|
||||
- name: List files in appimage-directory
|
||||
run: ls -l appimage-result
|
||||
run: ls -l appimage-x86-64-result
|
||||
|
||||
- name: Copy AppImage file to root
|
||||
run: |
|
||||
for file in appimage-result/*; do
|
||||
for file in appimage-x86-64-result/*; do
|
||||
if [[ $file == *.AppImage && $file != *.AppImage.zsync ]]; then
|
||||
cp "$file" result.AppImage
|
||||
fi
|
||||
@@ -351,15 +491,15 @@ jobs:
|
||||
asset_name: LocalSend-${{ needs.build.outputs.version }}-linux-x86-64.AppImage
|
||||
asset_content_type: application/x-appimage
|
||||
|
||||
# WINDOWS ZIP
|
||||
# WINDOWS ZIP (x86_64)
|
||||
- name: Download windows zip file
|
||||
uses: actions/download-artifact@v3
|
||||
with:
|
||||
name: windows-zip-result
|
||||
path: windows-zip-result
|
||||
name: windows-zip-x86-64-result
|
||||
path: windows-zip-x86-64-result
|
||||
|
||||
- name: Copy zip file to root
|
||||
run: cp windows-zip-result/*.zip result.zip
|
||||
run: cp windows-zip-x86-64-result/*.zip result.zip
|
||||
|
||||
- name: Upload Release Asset
|
||||
uses: actions/upload-release-asset@v1
|
||||
|
||||
@@ -0,0 +1,75 @@
|
||||
name: Build arm64 deb
|
||||
|
||||
on:
|
||||
workflow_dispatch:
|
||||
|
||||
env:
|
||||
FLUTTER_VERSION: "3.16.2"
|
||||
|
||||
jobs:
|
||||
build:
|
||||
runs-on: ubuntu-22.04
|
||||
outputs:
|
||||
version: ${{ steps.get_version.outputs.version }}
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
|
||||
- name: Get version from pubspec.yaml
|
||||
id: get_version
|
||||
run: |
|
||||
VERSION=$(sed -n 's/^version: \([0-9]*\.[0-9]*\.[0-9]*\).*/\1/p' app/pubspec.yaml)
|
||||
echo "version=$VERSION" >> $GITHUB_OUTPUT
|
||||
|
||||
# Manage the Flutter version on the self-hosted runner manually!
|
||||
# Flutter currently doesn't provide Linux ARM64 binaries.
|
||||
build_deb_arm_64:
|
||||
needs: build
|
||||
runs-on: [self-hosted, linux, arm64]
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
|
||||
- name: Install dependencies
|
||||
run: |
|
||||
sudo apt-get update
|
||||
sudo apt-get install -y clang cmake libgtk-3-dev ninja-build libayatana-appindicator3-dev
|
||||
|
||||
- name: Enable dart_distributor
|
||||
run: dart pub global activate flutter_distributor
|
||||
|
||||
- name: Build deb package
|
||||
working-directory: app
|
||||
run: PATH="$PATH:$HOME/.pub-cache/bin" flutter_distributor package --platform linux --targets deb
|
||||
|
||||
- name: Find deb file
|
||||
id: find_deb
|
||||
run: |
|
||||
VERSION=${{ needs.build.outputs.version }}
|
||||
DEB_PATH=$(find app/dist -name "localsend_app-$VERSION*-linux.deb")
|
||||
echo "deb_path=$DEB_PATH" >> $GITHUB_OUTPUT
|
||||
|
||||
- name: Check if deb file exists
|
||||
id: check_file
|
||||
run: |
|
||||
if [[ ! -f "${{ steps.find_deb.outputs.deb_path }}" ]]; then
|
||||
echo "File not found: ${{ steps.find_deb.outputs.deb_path }}"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Remove this when: https://github.com/leanflutter/flutter_distributor/pull/150 is merged
|
||||
- name: Update Architecture
|
||||
run: |
|
||||
mkdir temp
|
||||
cd temp
|
||||
ar x ../${{ steps.find_deb.outputs.deb_path }}
|
||||
tar xJf control.tar.xz --overwrite
|
||||
sed -i '/Architecture:/c\Architecture: arm64' ./control
|
||||
tar cJf control.tar.xz control postinst postrm
|
||||
ar rcs ../${{ steps.find_deb.outputs.deb_path }} debian-binary control.tar.xz data.tar.xz
|
||||
|
||||
- name: Upload deb file
|
||||
uses: actions/upload-artifact@v3
|
||||
with:
|
||||
name: deb-arm-64-result
|
||||
path: ${{ steps.find_deb.outputs.deb_path }}
|
||||
@@ -21,7 +21,9 @@ jobs:
|
||||
VERSION=$(sed -n 's/^version: \([0-9]*\.[0-9]*\.[0-9]*\).*/\1/p' app/pubspec.yaml)
|
||||
echo "version=$VERSION" >> $GITHUB_OUTPUT
|
||||
|
||||
build_tar:
|
||||
# Manage the Flutter version on the self-hosted runner manually!
|
||||
# Flutter currently doesn't provide Linux ARM64 binaries.
|
||||
build_tar_arm_64:
|
||||
needs: build
|
||||
runs-on: [self-hosted, linux, arm64]
|
||||
|
||||
@@ -33,11 +35,6 @@ jobs:
|
||||
sudo apt-get update
|
||||
sudo apt-get install -y clang cmake libgtk-3-dev ninja-build libayatana-appindicator3-dev
|
||||
|
||||
- uses: subosito/flutter-action@v2
|
||||
with:
|
||||
flutter-version: ${{ env.FLUTTER_VERSION }}
|
||||
channel: "stable"
|
||||
|
||||
- name: Dependencies
|
||||
working-directory: app
|
||||
run: flutter pub get
|
||||
@@ -48,7 +45,7 @@ jobs:
|
||||
|
||||
- name: Create tar.gz archive
|
||||
run: |
|
||||
cd app/build/linux/x64/release/bundle
|
||||
cd app/build/linux/arm64/release/bundle
|
||||
tar -czvf ../../../../../result.tar.gz *
|
||||
|
||||
- name: Upload tar.gz archive
|
||||
|
||||
Reference in New Issue
Block a user