| 1 |
name: Android File Transfer for Linux (and macOS!) |
| 2 |
|
| 3 |
on: [push] |
| 4 |
|
| 5 |
jobs: |
| 6 |
Linux: |
| 7 |
runs-on: ubuntu-22.04 |
| 8 |
steps: |
| 9 |
- name: Creating contiguous... |
| 10 |
uses: ncipollo/release-action@v1 |
| 11 |
if: github.ref_name == 'master' |
| 12 |
with: |
| 13 |
name: "The latest and greatest" |
| 14 |
body: This is the latest build of the current development branch. Please try any issues using this build before reporting any problems. |
| 15 |
token: ${{ secrets.GITHUB_TOKEN }} |
| 16 |
tag: continuous |
| 17 |
prerelease: true |
| 18 |
allowUpdates: true |
| 19 |
removeArtifacts: true |
| 20 |
- name: Creating release... |
| 21 |
uses: ncipollo/release-action@v1 |
| 22 |
if: github.ref_type == 'tag' |
| 23 |
with: |
| 24 |
token: ${{ secrets.GITHUB_TOKEN }} |
| 25 |
omitBody: true |
| 26 |
omitName: true |
| 27 |
allowUpdates: true |
| 28 |
removeArtifacts: true |
| 29 |
makeLatest: true |
| 30 |
- name: Install Dependencies... |
| 31 |
run: | |
| 32 |
sudo apt-get update |
| 33 |
sudo apt-get -y install qtbase5-dev qt5-qmake qttools5-dev qttools5-dev-tools libgtk2.0-dev libfuse3-dev libfuse2 libmagic-dev libtag1-dev libssl-dev ninja-build cmake |
| 34 |
- name: Checking out sources... |
| 35 |
uses: actions/checkout@v4 |
| 36 |
- name: Configuring... |
| 37 |
run: cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX:PATH=appdir/usr -B build -GNinja . |
| 38 |
- name: Building... |
| 39 |
run: ninja -j$(nproc) -C build |
| 40 |
- name: Installing... |
| 41 |
run: ninja -C build install |
| 42 |
- name: Creating AppImage... |
| 43 |
run: | |
| 44 |
sed -i -e 's|^Name=.*|Name=Android File Transfer For Linux|g' build/appdir/usr/share/applications/android-file-transfer.desktop |
| 45 |
wget -c -q "https://github.com/probonopd/linuxdeployqt/releases/download/continuous/linuxdeployqt-continuous-x86_64.AppImage" |
| 46 |
chmod a+x linuxdeployqt-continuous-x86_64.AppImage |
| 47 |
unset QTDIR |
| 48 |
unset QT_PLUGIN_PATH |
| 49 |
unset LD_LIBRARY_PATH |
| 50 |
export VERSION=$(git rev-parse --short HEAD) |
| 51 |
./linuxdeployqt-continuous-x86_64.AppImage build/appdir/usr/share/applications/*.desktop -bundle-non-qt-libs -appimage |
| 52 |
find build/appdir -executable -type f -exec ldd {} \; | grep " => /usr" | cut -d " " -f 2-3 | sort | uniq |
| 53 |
- name: Uploading contiguous artifacts... |
| 54 |
uses: ncipollo/release-action@v1 |
| 55 |
if: github.ref_name == 'master' |
| 56 |
with: |
| 57 |
allowUpdates: true |
| 58 |
omitBody: true |
| 59 |
omitName: true |
| 60 |
token: ${{ secrets.GITHUB_TOKEN }} |
| 61 |
artifacts: ./Android*.AppImage* |
| 62 |
tag: continuous |
| 63 |
- name: Uploading release artifacts... |
| 64 |
uses: ncipollo/release-action@v1 |
| 65 |
if: github.ref_type == 'tag' |
| 66 |
with: |
| 67 |
allowUpdates: true |
| 68 |
omitBody: true |
| 69 |
omitName: true |
| 70 |
token: ${{ secrets.GITHUB_TOKEN }} |
| 71 |
artifacts: ./Android*.AppImage* |
| 72 |
MacOSX: |
| 73 |
runs-on: macos-13 |
| 74 |
steps: |
| 75 |
- name: Install Dependencies... |
| 76 |
run: | |
| 77 |
brew tap homebrew/cask |
| 78 |
brew install qt@5 homebrew/cask/macfuse taglib [email protected] cmake ninja libmagic |
| 79 |
- name: Checking out sources... |
| 80 |
uses: actions/checkout@v4 |
| 81 |
- name: Configuring... |
| 82 |
run: cmake -DCMAKE_OSX_DEPLOYMENT_TARGET=10.12 -DCMAKE_BUILD_TYPE=Release -DCMAKE_PREFIX_PATH=$(brew --prefix qt@5) -DOPENSSL_ROOT_DIR=$(brew --prefix [email protected]) -DOPENSSL_LIBRARIES=$(brew --prefix [email protected])/lib -DCMAKE_INSTALL_PREFIX=appdir -B build -G Ninja . |
| 83 |
- name: Building... |
| 84 |
run: ninja -j$(sysctl -n hw.ncpu) -C build |
| 85 |
- name: Installing... |
| 86 |
run: ninja -C build install |
| 87 |
- name: Packaging... |
| 88 |
run: | |
| 89 |
mv appdir/android-file-transfer.app appdir/Android\ File\ Transfer\ for\ Linux.app |
| 90 |
git clone https://github.com/andreyvit/create-dmg.git |
| 91 |
cd create-dmg |
| 92 |
./create-dmg --volicon "../osx/android-file-transfer.icns" --icon-size 96 --icon "Android File Transfer for Linux" 110 100 --app-drop-link 380 100 AndroidFileTransferForLinux.dmg ../appdir/Android\ File\ Transfer\ for\ Linux.app |
| 93 |
- name: Uploading contiguous artifacts... |
| 94 |
uses: ncipollo/release-action@v1 |
| 95 |
if: github.ref_name == 'master' |
| 96 |
with: |
| 97 |
allowUpdates: true |
| 98 |
omitBody: true |
| 99 |
omitName: true |
| 100 |
token: ${{ secrets.GITHUB_TOKEN }} |
| 101 |
artifacts: create-dmg/*.dmg |
| 102 |
tag: continuous |
| 103 |
|
| 104 |
- name: Uploading contiguous artifacts... |
| 105 |
uses: ncipollo/release-action@v1 |
| 106 |
if: github.ref_type == 'tag' |
| 107 |
with: |
| 108 |
allowUpdates: true |
| 109 |
omitBody: true |
| 110 |
omitName: true |
| 111 |
token: ${{ secrets.GITHUB_TOKEN }} |
| 112 |
artifacts: create-dmg/*.dmg |