diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 6f0264aa3..5c215da15 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -6,169 +6,135 @@ on: merge_group: jobs: - ios-build: - runs-on: macos-latest - steps: - - uses: actions/checkout@v2 - with: - ref: dev - - uses: subosito/flutter-action@v2 - with: - # flutter-version: '2.5.2' - channel: 'stable' - - uses: actions/setup-python@v2 - with: - python-version: '3.8' - - name: Preprocess - run: | - # cd lib/server - # wget -q ${{ secrets.SECRET_SALT }} - # wget -q ${{ secrets.SECRET_WSALT }} - # cd ../.. - cat << EOF > lib/server/salt.dart - String getValid(foo) {return foo;} - EOF - cat << EOF > lib/server/wsalt.dart - String getValid(foo) {return foo;} - EOF - python3 preprocess-ios.py - - name: Podfile - run: | - cd ios - rm Podfile.lock - flutter clean - flutter pub get - pod install - pod update - cd .. - - name: Build - run: | - flutter build ios --release --no-codesign - mkdir -p Payload - mv ./build/ios/iphoneos/Runner.app Payload - zip -r -y Payload.zip Payload/Runner.app - mv Payload.zip Payload.ipa - - name: Upload IPA - uses: actions/upload-artifact@v2 - with: - name: ipa-build - path: Payload.ipa + # ios-build: + # runs-on: macos-latest + # steps: + # - uses: actions/checkout@v2 + # with: + # ref: dev + # - uses: subosito/flutter-action@v2 + # with: + # # flutter-version: '2.5.2' + # channel: 'stable' + # - uses: actions/setup-python@v2 + # with: + # python-version: '3.8' + # - name: Preprocess + # run: | + # # cd lib/server + # # wget -q ${{ secrets.SECRET_SALT }} + # # wget -q ${{ secrets.SECRET_WSALT }} + # # cd ../.. + # cat << EOF > lib/server/salt.dart + # String getValid(foo) {return foo;} + # EOF + # cat << EOF > lib/server/wsalt.dart + # String getValid(foo) {return foo;} + # EOF + # python3 preprocess-ios.py + # - name: Podfile + # run: | + # cd ios + # rm Podfile.lock + # flutter clean + # flutter pub get + # pod install + # pod update + # cd .. + # - name: Build + # run: | + # flutter build ios --release --no-codesign + # mkdir -p Payload + # mv ./build/ios/iphoneos/Runner.app Payload + # zip -r -y Payload.zip Payload/Runner.app + # mv Payload.zip Payload.ipa + # - name: Upload IPA + # uses: actions/upload-artifact@v2 + # with: + # name: ipa-build + # path: Payload.ipa # https://github.com/AppImageCrafters/appimage-builder-flutter-example/blob/main/.github/workflows/appimage.yml linux-build: runs-on: ubuntu-20.04 + strategy: + matrix: + include: + - arch: armv7 + distro: ubuntu20.04 + - arch: aarch64 + distro: ubuntu20.04 + - arch: x64 + distro: ubuntu20.04 steps: - uses: actions/checkout@v2 - uses: subosito/flutter-action@v1 + if: ${{ matrix.arch == 'x64' }} # with: - # flutter-version: '1.22.4' + # flutter-version: '1.22.4' # - run: flutter channel beta # - run: flutter upgrade - - run: flutter config --enable-linux-desktop + - name: flutter config --enable-linux-desktop on host + run: flutter config --enable-linux-desktop + if: ${{ matrix.arch == 'x64' }} - name: "Install dependencies" + if: ${{ matrix.arch == 'x64' }} run: | sudo apt-get update sudo apt-get install -y cmake ninja-build build-essential pkg-config curl file git unzip xz-utils zip libgtk-3-dev - - name: Clone project-violet/p7zip - run: git clone https://github.com/project-violet/p7zip.git - - run: mkdir -p p7zip/bin/ - - name: Build p7zip for linux/armhf - uses: pguyot/arm-runner-action@v2 - id: p7zip-armv7-linux-build - with: - base_image: raspios_lite:latest - copy_artifact_path: p7zip/bin/7zr - copy_artifact_dest: p7zip/bin/7zr - commands: | - cd p7zip - make 7zr - cd .. - - name: Copy bin - run: | - mkdir -p ./assets/p7zip/linux/armv7/ - sudo chmod 777 p7zip/bin/7zr - sudo chown $USER:$USER p7zip/bin/7zr - cp p7zip/bin/7zr ./assets/p7zip/linux/armv7/7zr - - name: Clean up project-violet/p7zip - run: | - cd p7zip - git add -A - git reset --hard HEAD - cd .. - - run: mkdir -p p7zip/bin/ - - name: Build p7zip for linux/arm64 - uses: pguyot/arm-runner-action@v2 - id: p7zip-arm64-linux-build + - name: Build for linux/${{ matrix.arch }} using uraimo/run-on-arch-action + if: ${{ matrix.arch != 'x64' }} + uses: uraimo/run-on-arch-action@v2 with: - base_image: raspios_lite_arm64:latest - copy_artifact_path: p7zip/bin/7zr - copy_artifact_dest: p7zip/bin/7zr - commands: | - cd p7zip - make 7zr - cd .. - - name: Copy bin - run: | - mkdir -p ./assets/p7zip/linux/armv8/ - sudo chmod 777 p7zip/bin/7zr - sudo chown $USER:$USER p7zip/bin/7zr - cp p7zip/bin/7zr ./assets/p7zip/linux/armv8/7zr - - name: Clean up project-violet/p7zip - run: | - cd p7zip - git add -A - git reset --hard HEAD - cd .. - # - name: Build p7zip for linux/x86(not yet) - # run: | - # mkdir -p ./assets/p7zip/linux/x86/ - # touch ./assets/p7zip/linux/x86/7zr - - name: Build p7zip for linux/x86_64 - run: | - cd p7zip - make 7zr - cd .. - - name: Copy bin - run: | - mkdir -p ./assets/p7zip/linux/x86_64/ - chmod 777 p7zip/bin/7zr - cp p7zip/bin/7zr ./assets/p7zip/linux/x86_64/7zr - - name: Clean up project-violet/p7zip - run: | - cd p7zip - git add -A - git reset --hard HEAD - cd .. - - name: Build flutter app + arch: ${{ matrix.arch }} + distro: ${{ matrix.distro }} + run: | + apt-get update + apt-get install -y clang cmake ninja-build build-essential pkg-config curl file git unzip xz-utils zip libgtk-3-dev + git clone https://github.com/flutter/flutter.git + export PATH=$PATH:$(pwd)/flutter/bin + + # cd lib/server + # wget -q ${{ secrets.SECRET_SALT }} + # wget -q ${{ secrets.SECRET_WSALT }} + # cd ../.. + cat << EOF > lib/server/salt.dart + String getValid(foo) {return foo;} + EOF + cat << EOF > lib/server/wsalt.dart + String getValid(foo) {return foo;} + EOF + + cp /lib/ld-linux-* /lib/ld-linux-aarch64.so.1 + flutter doctor -v + flutter config --enable-linux-desktop + + python3 preprocess-linux.py + echo flutter build linux + flutter build linux + find ./build -type f -name '*.so' + - name: Build for linux/${{ matrix.arch }} on host + if: ${{ matrix.arch == 'x64' }} run: | - # cd lib/server - # wget -q ${{ secrets.SECRET_SALT }} - # wget -q ${{ secrets.SECRET_WSALT }} - # cd ../.. - cat << EOF > lib/server/salt.dart - String getValid(foo) {return foo;} - EOF - cat << EOF > lib/server/wsalt.dart - String getValid(foo) {return foo;} - EOF + git clone https://github.com/flutter/flutter.git + export PATH=$PATH:$(pwd)/flutter/bin + flutter doctor -v + + # cd lib/server + # wget -q ${{ secrets.SECRET_SALT }} + # wget -q ${{ secrets.SECRET_WSALT }} + # cd ../.. + cat << EOF > lib/server/salt.dart + String getValid(foo) {return foo;} + EOF + cat << EOF > lib/server/wsalt.dart + String getValid(foo) {return foo;} + EOF python3 preprocess-linux.py + echo flutter build linux flutter build linux - find ./build/linux/x64/release/plugins -type f -name '*.so' -exec cp {} ./build/linux/x64/release/bundle/lib/ \; - - name: Save build Artifact - uses: actions/upload-artifact@v2 - with: - name: LinuxBuild - path: './build/linux/x64/release/bundle' - - name: Build AppImage unsing appimage-builder - uses: docker://appimagecrafters/appimage-builder:0.8.5 - with: - entrypoint: appimage-builder - args: --recipe ./AppImageBuilder.yml --skip-test - - name: Save build Artifact - uses: actions/upload-artifact@v2 - with: - name: AppImage - path: './*.AppImage*' + find ./build -type f -name '*.so' + # - name: Release AppImage # uses: marvinpinto/action-automatic-releases@latest # with: @@ -179,41 +145,41 @@ jobs: # files: './*.AppImage*' # repo_token: ${{ secrets.GITHUB_TOKEN }} - android-build: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v2 - with: - ref: dev - - uses: actions/setup-java@v1 - with: - java-version: '12.x' - - uses: subosito/flutter-action@v1 - with: - # flutter-version: '2.5.2' - channel: 'stable' - - uses: actions/setup-python@v2 - with: - python-version: '3.8' - - name: Preprocess - run: | - # cd lib/server - # wget -q ${{ secrets.SECRET_SALT }} - # wget -q ${{ secrets.SECRET_WSALT }} - # cd ../.. - cat << EOF > lib/server/salt.dart - String getValid(foo) {return foo;} - EOF - cat << EOF > lib/server/wsalt.dart - String getValid(foo) {return foo;} - EOF - python3 preprocess-android.py - - name: Build - run: | - flutter clean - flutter build apk --release - - name: Upload APK - uses: actions/upload-artifact@v2 - with: - name: apk-build - path: ./build/app/outputs/apk/release/app-release.apk + # android-build: + # runs-on: ubuntu-latest + # steps: + # - uses: actions/checkout@v2 + # with: + # ref: dev + # - uses: actions/setup-java@v1 + # with: + # java-version: '12.x' + # - uses: subosito/flutter-action@v1 + # with: + # # flutter-version: '2.5.2' + # channel: 'stable' + # - uses: actions/setup-python@v2 + # with: + # python-version: '3.8' + # - name: Preprocess + # run: | + # # cd lib/server + # # wget -q ${{ secrets.SECRET_SALT }} + # # wget -q ${{ secrets.SECRET_WSALT }} + # # cd ../.. + # cat << EOF > lib/server/salt.dart + # String getValid(foo) {return foo;} + # EOF + # cat << EOF > lib/server/wsalt.dart + # String getValid(foo) {return foo;} + # EOF + # python3 preprocess-android.py + # - name: Build + # run: | + # flutter clean + # flutter build apk --release + # - name: Upload APK + # uses: actions/upload-artifact@v2 + # with: + # name: apk-build + # path: ./build/app/outputs/apk/release/app-release.apk