diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 6f0264aa3..5972972fb 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -6,56 +6,59 @@ 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: + # strategy: + # matrix: + # version: [ 'armhf', 'arm64', 'x86_64' ] runs-on: ubuntu-20.04 steps: - uses: actions/checkout@v2 @@ -65,110 +68,35 @@ jobs: # - run: flutter channel beta # - run: flutter upgrade - run: flutter config --enable-linux-desktop - - name: "Install dependencies" - 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 + # - name: "Install dependencies" + # 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: Clean up run: | - cd p7zip - git add -A - git reset --hard HEAD - cd .. - - run: mkdir -p p7zip/bin/ - - name: Build p7zip for linux/arm64 + flutter clean + git add -A + git reset --hard HEAD + - name: Build for linux/arm64 uses: pguyot/arm-runner-action@v2 - id: p7zip-arm64-linux-build + # if: ${{ matrix.architecture == 'arm64' }} + id: flutter-arm64-linux-build with: base_image: raspios_lite_arm64:latest - copy_artifact_path: p7zip/bin/7zr - copy_artifact_dest: p7zip/bin/7zr + # 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 - 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-linux.py - 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*' + sudo apt-get update + # sudo apt-get install -y clang cmake ninja-build build-essential pkg-config curl file git unzip xz-utils zip libgtk-3-dev git + sudo apt search flutter + python3 preprocess-linux.py + echo flutter build linux || true + flutter build linux || true + echo flutter build linux-arm64 || true + flutter build linux-arm64 || true + echo flutter build linux-aarch64|| true + flutter build linux-aarch64 || true + find ./build -type f -name '*.so' # - name: Release AppImage # uses: marvinpinto/action-automatic-releases@latest # with: @@ -179,41 +107,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