Skip to content

Commit

Permalink
ci: Compress artifacts with tar to avoid lost attributes
Browse files Browse the repository at this point in the history
  • Loading branch information
G-Ray committed Jan 30, 2025
1 parent 65c9abe commit cfb80b1
Showing 1 changed file with 45 additions and 28 deletions.
73 changes: 45 additions & 28 deletions .github/workflows/build-apps.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,14 @@ jobs:
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 -ttar ~/artifacts/release.tar ./build/linux/x64/release/bundle/*
- uses: actions/upload-artifact@v4
with:
name: pikatorrent-linux
path: app/build/linux/x64/release/bundle/**/*
path: ~/artifacts/

linux-arm64:
runs-on: ubuntu-24.04-arm
Expand All @@ -42,10 +46,14 @@ jobs:
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 -ttar ~/artifacts/release.tar ./build/linux/arm64/release/bundle/*
- uses: actions/upload-artifact@v4
with:
name: pikatorrent-linux-arm64
path: app/build/linux/arm64/release/bundle/**/*
path: ~/artifacts/

windows:
runs-on: windows-2022
Expand All @@ -72,18 +80,19 @@ jobs:
channel: stable
flutter-version-file: app/pubspec.yaml
- run: flutter build windows
- uses: actions/upload-artifact@v4
with:
name: pikatorrent-windows
path: app/build/windows/x64/runner/Release/**/*
- name: Build msix
run: |
dart pub global activate flutter_distributor
flutter_distributor package --platform windows --targets msix
- name: Prepare artifacts
run: |
mkdir $HOME/artifacts
7z a -ttar $HOME/artifacts/release.tar ./build/windows/x64/runner/Release/*
mv ./dist/**/*.msix $HOME/artifacts/
- uses: actions/upload-artifact@v4
with:
name: pikatorrent-windows-msix
path: app/dist/**/*.msix
name: pikatorrent-windows
path: $HOME/artifacts

macos:
runs-on: macos-14
Expand All @@ -108,10 +117,14 @@ jobs:
channel: stable
flutter-version-file: app/pubspec.yaml
- run: flutter build macos
- name: Prepare artifacts
run: |
mkdir ~/artifacts
7z a -ttar ~/artifacts/release.tar ./build/macos/Build/Products/Release/*
- uses: actions/upload-artifact@v4
with:
name: pikatorrent-macos
path: app/build/macos/Build/Products/Release/*app
path: ~/artifacts/

android:
runs-on: ubuntu-24.04
Expand Down Expand Up @@ -153,15 +166,15 @@ jobs:
- 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-apk
path: app/build/app/outputs/flutter-apk/*.apk

- uses: actions/upload-artifact@v4
with:
name: pikatorrent-android-aab
path: app/build/app/outputs/bundle/release/*.aab
name: pikatorrent-android
path: ~/artifacts/

ios:
runs-on: macos-14
Expand Down Expand Up @@ -189,13 +202,17 @@ jobs:
channel: stable
flutter-version-file: app/pubspec.yaml
- run: flutter build ios --no-codesign
- name: Prepare artifacts
run: |
mkdir ~/artifacts
7z a -ttar ~/artifacts/release.tar ./build/ios/iphoneos/*
- uses: actions/upload-artifact@v4
with:
name: pikatorrent-ios
path: app/build/ios/iphoneos/*.app
path: ~/artifacts/

release:
if: startsWith(github.ref, 'refs/tags/')
# if: startsWith(github.ref, 'refs/tags/')
runs-on: ubuntu-24.04
permissions:
contents: write
Expand All @@ -206,16 +223,16 @@ jobs:

- name: Desktop
run: |
zip -r PikaTorrent-${{ github.ref_name }}-linux-x64.zip pikatorrent-linux
zip -r PikaTorrent-${{ github.ref_name }}-linux-arm64.zip pikatorrent-linux-arm64
zip -r PikaTorrent-${{ github.ref_name }}-macos-universal-experimental.zip pikatorrent-macos
zip -r PikaTorrent-${{ github.ref_name }}-windows-x64.zip pikatorrent-windows
tar -xOf pikatorrent-linux/release.tar | zip -r PikaTorrent-${{ github.ref_name }}-linux-x64.zip -
tar -xOf pikatorrent-linux-arm64/release.tar | zip -r PikaTorrent-${{ github.ref_name }}-linux-arm64.zip -
tar -xOf pikatorrent-macos/release.tar | zip -r PikaTorrent-${{ github.ref_name }}-macos-universal-experimental.zip -
tar -xOf pikatorrent-windows/release.tar | zip -r PikaTorrent-${{ github.ref_name }}-windows-x64.zip -
- name: Mobile
run: |
mv pikatorrent-android-apk/*apk PikaTorrent-${{ github.ref_name }}-android.apk
mv pikatorrent-android/*apk PikaTorrent-${{ github.ref_name }}-android.apk
- name: Release
uses: softprops/action-gh-release@v2
with:
draft: true
files: PikaTorrent-*
# - name: Release
# uses: softprops/action-gh-release@v2
# with:
# draft: true
# files: PikaTorrent-*

0 comments on commit cfb80b1

Please sign in to comment.