ci: Compress artifacts with tar to avoid lost attributes #206
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
name: Build apps | |
on: [push] | |
jobs: | |
linux: | |
runs-on: ubuntu-24.04 | |
defaults: | |
run: | |
working-directory: ./app | |
steps: | |
- name: Clone repository | |
uses: actions/checkout@v4 | |
- name: Set up Flutter | |
uses: subosito/flutter-action@v2 | |
with: | |
channel: stable | |
flutter-version-file: app/pubspec.yaml | |
- name: Install dependencies | |
run: | | |
sudo apt-get update -y | |
sudo apt-get install -y ninja-build libgtk-3-dev libcurl4-openssl-dev | |
- run: flutter build linux | |
- name: Prepare artifacts | |
run: | | |
mkdir ~/artifacts | |
7z a ~/artifacts/release.tar ./build/linux/x64/release/bundle/* | |
- uses: actions/upload-artifact@v4 | |
with: | |
name: pikatorrent-linux | |
path: ~/artifacts/ | |
linux-arm64: | |
runs-on: ubuntu-24.04-arm | |
defaults: | |
run: | |
working-directory: ./app | |
steps: | |
- name: Clone repository | |
uses: actions/checkout@v4 | |
- name: Set up Flutter | |
uses: subosito/flutter-action@v2 | |
with: | |
channel: master | |
flutter-version-file: app/pubspec.yaml | |
- name: Install dependencies | |
run: | | |
sudo apt-get update -y | |
sudo apt-get install -y ninja-build libgtk-3-dev libcurl4-openssl-dev | |
- run: flutter build linux | |
- name: Prepare artifacts | |
run: | | |
mkdir ~/artifacts | |
7z a ~/artifacts/release.tar ./build/linux/arm64/release/bundle/* | |
- uses: actions/upload-artifact@v4 | |
with: | |
name: pikatorrent-linux-arm64 | |
path: ~/artifacts/ | |
windows: | |
runs-on: windows-2022 | |
env: | |
# Workaround for https://gitlab.kitware.com/cmake/cmake/-/issues/25936 | |
TRANSMISSION_PREFIX: ${{ github.workspace }}/transmission-prefix | |
VCPKG_MANIFEST_DIR: ${{ github.workspace }}/app | |
defaults: | |
run: | |
working-directory: ./app | |
steps: | |
- name: Clone repository | |
uses: actions/checkout@v4 | |
with: | |
submodules: true | |
- name: Set up vcpkg | |
uses: lukka/run-vcpkg@v11 | |
with: | |
vcpkgDirectory: ${{ github.workspace }}/app/vcpkg | |
- name: Set up Flutter | |
# yq is not installed on windows on v2 | |
uses: subosito/[email protected] | |
with: | |
channel: stable | |
flutter-version-file: app/pubspec.yaml | |
- run: flutter build windows | |
- name: Build msix | |
run: | | |
dart pub global activate flutter_distributor | |
flutter_distributor package --platform windows --targets msix | |
- name: Prepare artifacts | |
run: | | |
mkdir ${{ github.workspace }}/artifacts | |
7z a ${{ github.workspace }}/artifacts/release.tar ./build/windows/x64/runner/Release/* | |
mv ./dist/**/*.msix ${{ github.workspace }}/artifacts/ | |
- uses: actions/upload-artifact@v4 | |
with: | |
name: pikatorrent-windows | |
path: ${{ github.workspace }}/artifacts | |
macos: | |
runs-on: macos-14 | |
defaults: | |
run: | |
working-directory: ./app | |
steps: | |
- name: Clone repository | |
uses: actions/checkout@v4 | |
with: | |
submodules: true | |
- name: Install dependencies | |
run: | | |
brew install ninja | |
- name: Set up vcpkg | |
uses: lukka/run-vcpkg@v11 | |
with: | |
vcpkgDirectory: ${{ github.workspace }}/app/vcpkg | |
- name: Set up Flutter | |
uses: subosito/flutter-action@v2 | |
with: | |
channel: stable | |
flutter-version-file: app/pubspec.yaml | |
- run: flutter build macos | |
- name: Prepare artifacts | |
run: | | |
mkdir ~/artifacts | |
7z a ~/artifacts/release.tar ./build/macos/Build/Products/Release/* | |
- uses: actions/upload-artifact@v4 | |
with: | |
name: pikatorrent-macos | |
path: ~/artifacts/ | |
android: | |
runs-on: ubuntu-24.04 | |
env: | |
VCPKG_MANIFEST_DIR: ${{ github.workspace }}/app | |
defaults: | |
run: | |
working-directory: ./app | |
steps: | |
- name: Clone repository | |
uses: actions/checkout@v4 | |
with: | |
submodules: true | |
- name: Decode android-keystore.jks | |
env: | |
ENCODED_STRING: ${{ secrets.ANDROID_KEY_STORE }} | |
run: echo $ENCODED_STRING | base64 -di > android/android-keystore.jks | |
- name: Decode key.properties | |
env: | |
ENCODED_STRING: ${{ secrets.ANDROID_KEY_PROPERTIES }} | |
run: echo $ENCODED_STRING | base64 -di > android/key.properties | |
- name: Set up vcpkg | |
uses: lukka/run-vcpkg@v11 | |
with: | |
vcpkgDirectory: ${{ github.workspace }}/app/vcpkg | |
- name: Set up Flutter | |
uses: subosito/flutter-action@v2 | |
with: | |
channel: stable | |
flutter-version-file: app/pubspec.yaml | |
- name: Install dependencies | |
run: | | |
sudo apt-get update -y | |
sudo apt-get install -y ninja-build | |
- run: flutter build apk | |
- run: flutter build appbundle | |
- name: Prepare artifacts | |
run: | | |
mkdir ~/artifacts | |
cp ./build/app/outputs/flutter-apk/*.apk ~/artifacts/ | |
cp ./build/app/outputs/bundle/release/*.aab ~/artifacts/ | |
- uses: actions/upload-artifact@v4 | |
with: | |
name: pikatorrent-android | |
path: ~/artifacts/ | |
ios: | |
runs-on: macos-14 | |
env: | |
# Do not target simulator | |
TARGET_IOS_DEVICE: true | |
defaults: | |
run: | |
working-directory: ./app | |
steps: | |
- name: Clone repository | |
uses: actions/checkout@v4 | |
with: | |
submodules: true | |
- name: Install dependencies | |
run: | | |
brew install ninja | |
- name: Set up vcpkg | |
uses: lukka/run-vcpkg@v11 | |
with: | |
vcpkgDirectory: ${{ github.workspace }}/app/vcpkg | |
- name: Set up Flutter | |
uses: subosito/flutter-action@v2 | |
with: | |
channel: stable | |
flutter-version-file: app/pubspec.yaml | |
- run: flutter build ios --no-codesign | |
- name: Prepare artifacts | |
run: | | |
mkdir ~/artifacts | |
7z a ~/artifacts/release.tar ./build/ios/iphoneos/* | |
- uses: actions/upload-artifact@v4 | |
with: | |
name: pikatorrent-ios | |
path: ~/artifacts/ | |
release: | |
if: startsWith(github.ref, 'refs/tags/') | |
runs-on: ubuntu-24.04 | |
permissions: | |
contents: write | |
needs: [linux, linux-arm64, windows, macos, android] | |
steps: | |
- name: Download artifacts | |
uses: actions/download-artifact@v4 | |
- name: Desktop | |
run: | | |
mkdir pikatorrent-linux/release pikatorrent-linux-arm64/release pikatorrent-macos/release pikatorrent-windows/release | |
(cd pikatorrent-linux && tar -xf ./release.tar -C release && 7z a ${{ github.workspace }}/PikaTorrent-${{ github.ref_name }}-linux-x64.zip ./release/*) | |
(cd pikatorrent-linux-arm64 && tar -xf ./release.tar -C release && 7z a ${{ github.workspace }}/PikaTorrent-${{ github.ref_name }}-linux-arm64.zip ./release/*) | |
(cd pikatorrent-macos && tar -xf ./release.tar -C release && 7z a ${{ github.workspace }}/PikaTorrent-${{ github.ref_name }}-macos-universal-experimental.zip ./release/*) | |
(cd pikatorrent-windows && tar -xf ./release.tar -C release && 7z a ${{ github.workspace }}/PikaTorrent-${{ github.ref_name }}-windows-x64.zip ./release/*) | |
- name: Mobile | |
run: | | |
mv pikatorrent-android/*apk PikaTorrent-${{ github.ref_name }}-android.apk | |
- name: Release | |
uses: softprops/action-gh-release@v2 | |
with: | |
draft: true | |
files: PikaTorrent-* |