Skip to content

An open-source cross-platform alternative to AirDrop

ci: make release workflow working again

Tien Do Nama69a4b83ca74
diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml
index a3f06e7d..0f5742f7 100644
--- a/.github/workflows/release.yml
+++ b/.github/workflows/release.yml
@@ -19,26 +19,9 @@ jobs:
- name: Get version from pubspec.yaml
id: get_version
run: |
- VERSION=$(sed -n 's/^version: \([0-9]*\.[0-9]*\.[0-9]*\).*/\1/p' pubspec.yaml)
+ VERSION=$(sed -n 's/^version: \([0-9]*\.[0-9]*\.[0-9]*\).*/\1/p' app/pubspec.yaml)
echo "version=$VERSION" >> $GITHUB_OUTPUT
- - uses: subosito/flutter-action@v2
- with:
- flutter-version: ${{ env.FLUTTER_VERSION }}
- channel: "stable"
-
- - name: Dependencies
- run: flutter pub get
-
- - name: Build generated files
- run: flutter pub run build_runner build -d
-
- - name: Upload updated lib files with generated code
- uses: actions/upload-artifact@v3
- with:
- name: lib-files
- path: ./lib/*
-
build_apk:
needs: build
runs-on: ubuntu-22.04
@@ -47,12 +30,6 @@ jobs:
- name: Checkout repository
uses: actions/checkout@v4
- - name: Download generated files
- uses: actions/download-artifact@v3
- with:
- name: lib-files
- path: lib
-
- name: Copy files to env.APK_BUILD_DIR
run: |
mkdir -p $APK_BUILD_DIR
@@ -62,7 +39,7 @@ jobs:
working-directory: ${{ env.APK_BUILD_DIR }}
env:
ENCODED_STRING: ${{ secrets.ANDROID_KEY_PROPERTIES }}
- run: echo $ENCODED_STRING | base64 -di > android/key.properties
+ run: echo $ENCODED_STRING | base64 -di > app/android/key.properties
- name: Decode android-keystore.jks file
working-directory: ${{ env.APK_BUILD_DIR }}
@@ -82,18 +59,18 @@ jobs:
flutter-version: ${{ env.FLUTTER_VERSION }}
- name: Dependencies
- working-directory: ${{ env.APK_BUILD_DIR }}
+ working-directory: ${{ env.APK_BUILD_DIR }}/app
run: flutter pub get
- name: Build APK
- working-directory: ${{ env.APK_BUILD_DIR }}
+ working-directory: ${{ env.APK_BUILD_DIR }}/app
run: flutter build apk
- name: Upload APK
uses: actions/upload-artifact@v3
with:
name: apk-result
- path: ${{ env.APK_BUILD_DIR }}/build/app/outputs/flutter-apk/app-release.apk
+ path: ${{ env.APK_BUILD_DIR }}/app/build/app/outputs/flutter-apk/app-release.apk
build_tar:
needs: build
@@ -102,12 +79,6 @@ jobs:
steps:
- uses: actions/checkout@v4
- - name: Download generated files
- uses: actions/download-artifact@v3
- with:
- name: lib-files
- path: lib
-
- name: Install dependencies
run: |
sudo apt-get update
@@ -119,21 +90,23 @@ jobs:
channel: "stable"
- 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 build/linux/x64/release/bundle
+ cd app/build/linux/x64/release/bundle
tar -czvf ../../../../../result.tar.gz *
- name: Upload tar.gz archive
uses: actions/upload-artifact@v3
with:
name: tar-gz-result
- path: ./*.tar.gz
+ path: ./app/*.tar.gz
build_deb:
needs: build
@@ -142,12 +115,6 @@ jobs:
steps:
- uses: actions/checkout@v4
- - name: Download generated files
- uses: actions/download-artifact@v3
- with:
- name: lib-files
- path: lib
-
- name: Install dependencies
run: |
sudo apt-get update
@@ -165,13 +132,14 @@ jobs:
run: echo 'export PATH="$PATH:$HOME/.pub-cache/bin"' >> ~/.bashrc
- name: Build deb package
+ working-directory: app
run: flutter_distributor package --platform linux --targets deb
- name: Find deb file
id: find_deb
run: |
VERSION=${{ needs.build.outputs.version }}
- DEB_PATH=$(find dist -name "localsend_app-$VERSION*-linux.deb")
+ DEB_PATH=$(find app/dist -name "localsend_app-$VERSION*-linux.deb")
echo "deb_path=$DEB_PATH" >> $GITHUB_OUTPUT
- name: Check if deb file exists
@@ -195,12 +163,6 @@ jobs:
steps:
- uses: actions/checkout@v4
- - name: Download generated files
- uses: actions/download-artifact@v3
- with:
- name: lib-files
- path: lib
-
- name: Install dependencies
run: |
sudo apt-get update
@@ -212,24 +174,26 @@ jobs:
channel: "stable"
- 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 build/linux/x64/release/bundle/* AppDir/
+ cp -r app/build/linux/x64/release/bundle/* AppDir/
- name: Copy logo to AppDir
run: |
mkdir -p AppDir/usr/share/icons/hicolor/32x32/apps
- cp assets/img/logo-32.png AppDir/usr/share/icons/hicolor/32x32/apps/localsend.png
+ 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 assets/img/logo-128.png AppDir/usr/share/icons/hicolor/128x128/apps/localsend.png
+ 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 assets/img/logo-256.png AppDir/usr/share/icons/hicolor/256x256/apps/localsend.png
+ cp app/assets/img/logo-256.png AppDir/usr/share/icons/hicolor/256x256/apps/localsend.png
- name: Build AppImage
uses: AppImageCrafters/build-appimage@57c3bc6963f870ce3be103117de5b5e33ffbaeb6
@@ -250,13 +214,8 @@ jobs:
- name: Fix long file paths
run: git config --system core.longpaths true
- - uses: actions/checkout@v4
-
- - name: Download generated files
- uses: actions/download-artifact@v3
- with:
- name: lib-files
- path: lib
+ - name: Checkout repository
+ uses: actions/checkout@v4
- uses: subosito/flutter-action@v2
with:
@@ -264,19 +223,22 @@ jobs:
channel: "stable"
- name: Dependencies
+ working-directory: app
run: flutter pub get
- name: Compile for Windows
+ working-directory: app
run: flutter build windows
- name: Zip compiled files
+ working-directory: app
run: Compress-Archive -Path build/windows/runner/Release/* -DestinationPath LocalSend.zip
- name: Upload zip
uses: actions/upload-artifact@v3
with:
name: windows-zip-result
- path: LocalSend.zip
+ path: app/LocalSend.zip
release:
needs: [build, build_apk, build_tar, build_deb, build_appimage, build_windows_zip]