From f4140ae5871eca07cc6841e02669c189f6c0b4ae Mon Sep 17 00:00:00 2001 From: kjxbyz Date: Fri, 2 Aug 2024 07:19:11 +0800 Subject: [PATCH] Update GitHub Actions --- .github/workflows/release.yml | 13 - .../workflows/test-linux-appimage-arm64.yml | 104 ++++ .github/workflows/test-linux-appimage.yml | 104 +--- .github/workflows/test-linux-arm64.yml | 497 ------------------ .github/workflows/test-linux-deb-arm64.yml | 97 ++++ .github/workflows/test-linux-deb.yml | 59 +++ .../workflows/test-linux-flatpak-arm64.yml | 2 +- .github/workflows/test-linux-flatpak.yml | 2 +- .github/workflows/test-linux-pacman-arm64.yml | 6 +- .github/workflows/test-linux-pacman.yml | 3 +- .github/workflows/test-linux-rpm-arm64.yml | 118 +++++ .../{test-linux.yml => test-linux-rpm.yml} | 115 +--- .../workflows/test-linux-snapcraft-arm64.yml | 5 +- .github/workflows/test-linux-snapcraft.yml | 5 +- .github/workflows/test-linux-tar-arm64.yml | 112 ++++ .github/workflows/test-linux-tar.yml | 79 +++ .github/workflows/test-linux-zip-arm64.yml | 98 ++++ .github/workflows/test-linux-zip.yml | 60 +++ .github/workflows/test-macos-dmg.yml | 12 +- .github/workflows/test-macos-pkg-appstore.yml | 9 +- .github/workflows/test-macos-pkg.yml | 9 +- .github/workflows/test-macos-tar.yml | 9 +- .github/workflows/test-macos-zip.yml | 9 +- .github/workflows/test-windows-exe.yml | 6 +- .github/workflows/test-windows-msix.yml | 6 +- .github/workflows/test-windows-zip.yml | 6 +- 26 files changed, 771 insertions(+), 774 deletions(-) create mode 100644 .github/workflows/test-linux-appimage-arm64.yml delete mode 100644 .github/workflows/test-linux-arm64.yml create mode 100644 .github/workflows/test-linux-deb-arm64.yml create mode 100644 .github/workflows/test-linux-deb.yml create mode 100644 .github/workflows/test-linux-rpm-arm64.yml rename .github/workflows/{test-linux.yml => test-linux-rpm.yml} (61%) create mode 100644 .github/workflows/test-linux-tar-arm64.yml create mode 100644 .github/workflows/test-linux-tar.yml create mode 100644 .github/workflows/test-linux-zip-arm64.yml create mode 100644 .github/workflows/test-linux-zip.yml diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 21a7b0b..2cf3f71 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -1636,9 +1636,6 @@ jobs: with: platforms: all - - name: Show linux info - run: uname --all - - name: Configure .env run: | ENV_BASE64="$([[ "$ENV" == "staging" ]] && echo "$ENV_STG_BASE64" || echo "$ENV_PROD_BASE64")" @@ -1748,7 +1745,6 @@ jobs: run: | rm -f .env - linux_deb: name: Create linux deb runs-on: ubuntu-latest @@ -2798,15 +2794,6 @@ jobs: with: channel: latest/stable - - name: Setup Flutter - uses: subosito/flutter-action@v2 - with: - channel: 'stable' - flutter-version: '3.22.3' - - - name: Flutter doctor -v - run: flutter doctor -v - - name: Configure .env run: | ENV_BASE64="$([[ "$ENV" == "staging" ]] && echo "$ENV_STG_BASE64" || echo "$ENV_PROD_BASE64")" diff --git a/.github/workflows/test-linux-appimage-arm64.yml b/.github/workflows/test-linux-appimage-arm64.yml new file mode 100644 index 0000000..af18075 --- /dev/null +++ b/.github/workflows/test-linux-appimage-arm64.yml @@ -0,0 +1,104 @@ +name: Test Linux AppImage (arm64) + +on: + workflow_dispatch: + +# Declare default permissions as readonly. +permissions: read-all + +jobs: + appimage: + name: Create Linux appimage (aarch64) + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + + - name: Setup QEMU + uses: docker/setup-qemu-action@v3 + with: + platforms: arm64 + + - name: Configure .env + run: | + echo "$ENV_KEY" | base64 --decode > .env + env: + ENV_KEY: ${{ secrets.ENV_STG_BASE64 }} + + - name: Install qemu-user-static + run: | + docker run --rm --privileged multiarch/qemu-user-static --reset -p yes + + - uses: addnab/docker-run-action@v3 + with: + image: arm64v8/ubuntu:22.04 + options: | + --rm + --cap-add SYS_ADMIN + --device /dev/fuse + --security-opt apparmor:unconfined + -v ${{ github.workspace }}:/work + --workdir /work + shell: bash + run: | + set -x + # Show linux info + echo "Show linux info" + uname --all + + # Install dependencies for Linux + echo "Install dependencies for Linux" + apt update && apt install -y sudo + sudo apt install -y wget curl git unzip xz-utils zip libglu1-mesa file + sudo apt install -y clang cmake ninja-build pkg-config libgtk-3-dev liblzma-dev + sudo apt install -y locate libfuse2 + + # Install appimagetool + echo "Install appimagetool" + wget -O appimagetool "https://github.com/AppImage/AppImageKit/releases/download/continuous/appimagetool-aarch64.AppImage" + # https://github.com/AppImage/AppImageKit/issues/1056#issuecomment-643382397 + sed -i 's|AI\x02|\x00\x00\x00|' appimagetool + chmod +x appimagetool && mv appimagetool /usr/local/bin/ + + # Setup Flutter + echo "Setup Flutter" + bash ./install-flutter-ubuntu.sh + + if [ -d "/home/linux-arm64/flutter" ]; then + echo "🟩 ls -la" + ls -la /home/linux-arm64/flutter + fi + echo 'export PATH="$PATH:/home/linux-arm64/flutter/bin:/home/linux-arm64/flutter/.pub-cache/bin:$HOME/.pub-cache/bin"' >> ~/.zshrc + source ~/.zshrc + echo $PATH + + # Flutter doctor + echo "Flutter doctor -v" + flutter doctor -v + + # Install flutter_distributor + echo "Install flutter_distributor" + dart pub global activate --source git https://github.com/kjxbyz/flutter_distributor --git-ref pacman --git-path packages/flutter_distributor + + # Install flutter dependencies + echo "Install flutter dependencies" + flutter pub get + + # Build AppImage + echo "Build AppImage" + flutter_distributor package --flutter-build-args "dart-define-from-file=.env,target-platform=linux-arm64" --platform linux --targets appimage --artifact-name '{{name}}_{{build_name}}+{{build_number}}_{{platform}}_aarch64.{{ext}}' + + # Package the build. + - name: Copy build for AppImage + run: ls -laR + working-directory: dist + + - uses: actions/upload-artifact@v4 + with: + name: linux-appimage-arm64-artifact + path: | + ./dist/**/*.AppImage + + - name: Clean up + if: ${{ always() }} + run: | + rm -f .env diff --git a/.github/workflows/test-linux-appimage.yml b/.github/workflows/test-linux-appimage.yml index 86d21f6..0b809b5 100644 --- a/.github/workflows/test-linux-appimage.yml +++ b/.github/workflows/test-linux-appimage.yml @@ -37,8 +37,7 @@ jobs: ENV_KEY: ${{ secrets.ENV_STG_BASE64 }} - name: Install flutter_distributor - run: | - dart pub global activate flutter_distributor + run: dart pub global activate flutter_distributor - name: Install flutter dependencies run: flutter pub get @@ -61,104 +60,3 @@ jobs: if: ${{ always() }} run: | rm -f .env - - - appimage_aarch64: - name: Create linux appimage (aarch64) - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - - - name: Setup QEMU - uses: docker/setup-qemu-action@v3 - with: - platforms: all - - - name: Show linux info - run: uname --all - - - name: Configure .env - run: | - echo "$ENV_KEY" | base64 --decode > .env - env: - ENV_KEY: ${{ secrets.ENV_STG_BASE64 }} - - - name: Install qemu-user-static - run: | - docker run --rm --privileged multiarch/qemu-user-static --reset -p yes - - # https://github.com/s3fs-fuse/s3fs-fuse/issues/647#issuecomment-637458150 - - uses: addnab/docker-run-action@v3 - with: - image: arm64v8/ubuntu:22.04 - options: | - --rm - --cap-add SYS_ADMIN - --device /dev/fuse - --security-opt apparmor:unconfined - -v ${{ github.workspace }}:/work - --workdir /work - shell: bash - run: | - set -x - # Show linux info - echo "Show linux info" - uname --all - - # Install dependencies for Linux - echo "Install dependencies for Linux" - apt update && apt install -y sudo - sudo apt install -y wget curl git unzip xz-utils zip libglu1-mesa file - sudo apt install -y clang cmake ninja-build pkg-config libgtk-3-dev liblzma-dev - sudo apt install -y locate libfuse2 - - # Install appimagetool - echo "Install appimagetool" - wget -O appimagetool "https://github.com/AppImage/AppImageKit/releases/download/continuous/appimagetool-aarch64.AppImage" - # https://github.com/AppImage/AppImageKit/issues/1056#issuecomment-643382397 - sed -i 's|AI\x02|\x00\x00\x00|' appimagetool - chmod +x appimagetool && mv appimagetool /usr/local/bin/ - - # Setup Flutter - echo "Setup Flutter" - bash ./install-flutter-ubuntu.sh - - if [ -d "/home/linux-arm64/flutter" ]; then - echo "🟩 ls -la" - ls -la /home/linux-arm64/flutter - fi - echo 'export PATH="$PATH:/home/linux-arm64/flutter/bin:/home/linux-arm64/flutter/.pub-cache/bin:$HOME/.pub-cache/bin"' >> ~/.zshrc - source ~/.zshrc - echo $PATH - - # Flutter doctor - echo "Flutter doctor -v" - flutter doctor -v - - # Install flutter_distributor - echo "Install flutter_distributor" - dart pub global activate --source git https://github.com/kjxbyz/flutter_distributor --git-ref pacman --git-path packages/flutter_distributor - - # Install flutter dependencies - echo "Install flutter dependencies" - flutter pub get - - # Build AppImage - echo "Build AppImage" - flutter_distributor package --flutter-build-args "dart-define-from-file=.env,target-platform=linux-arm64" --platform linux --targets appimage --artifact-name '{{name}}_{{build_name}}+{{build_number}}_{{platform}}_aarch64.{{ext}}' - - # Package the build. - - name: Copy build for AppImage - run: ls -laR - working-directory: dist - - - uses: actions/upload-artifact@v4 - with: - name: linux-appimage-arm64-artifact - path: | - ./dist/**/*.AppImage - - - name: Clean up - if: ${{ always() }} - run: | - rm -f .env diff --git a/.github/workflows/test-linux-arm64.yml b/.github/workflows/test-linux-arm64.yml deleted file mode 100644 index 89724c6..0000000 --- a/.github/workflows/test-linux-arm64.yml +++ /dev/null @@ -1,497 +0,0 @@ -name: Test Linux (arm64) - -on: - workflow_dispatch: - -# Declare default permissions as readonly. -permissions: read-all - -jobs: - appimage: - name: Create AppImage - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - - - name: Setup QEMU - uses: docker/setup-qemu-action@v3 - with: - platforms: arm64 - - - name: Configure .env - run: | - echo "$ENV_KEY" | base64 --decode > .env - env: - ENV_KEY: ${{ secrets.ENV_STG_BASE64 }} - - - name: Install qemu-user-static - run: | - docker run --rm --privileged multiarch/qemu-user-static --reset -p yes - - - uses: addnab/docker-run-action@v3 - with: - image: arm64v8/ubuntu:22.04 - options: | - --rm - --cap-add SYS_ADMIN - --device /dev/fuse - --security-opt apparmor:unconfined - -v ${{ github.workspace }}:/work - --workdir /work - shell: bash - run: | - set -x - # Show linux info - echo "Show linux info" - uname --all - - # Install dependencies for Linux - echo "Install dependencies for Linux" - apt update && apt install -y sudo - sudo apt install -y wget curl git unzip xz-utils zip libglu1-mesa file - sudo apt install -y clang cmake ninja-build pkg-config libgtk-3-dev liblzma-dev - sudo apt install -y locate libfuse2 - - # Install appimagetool - echo "Install appimagetool" - wget -O appimagetool "https://github.com/AppImage/AppImageKit/releases/download/continuous/appimagetool-aarch64.AppImage" - # https://github.com/AppImage/AppImageKit/issues/1056#issuecomment-643382397 - sed -i 's|AI\x02|\x00\x00\x00|' appimagetool - chmod +x appimagetool && mv appimagetool /usr/local/bin/ - - # Setup Flutter - echo "Setup Flutter" - bash ./install-flutter-ubuntu.sh - - if [ -d "/home/linux-arm64/flutter" ]; then - echo "🟩 ls -la" - ls -la /home/linux-arm64/flutter - fi - echo 'export PATH="$PATH:/home/linux-arm64/flutter/bin:/home/linux-arm64/flutter/.pub-cache/bin:$HOME/.pub-cache/bin"' >> ~/.zshrc - source ~/.zshrc - echo $PATH - - # Install flutter_distributor - echo "Install flutter_distributor" - dart pub global activate --source git https://github.com/kjxbyz/flutter_distributor --git-ref appimage --git-path packages/flutter_distributor - - # Flutter doctor - echo "Flutter doctor -v" - flutter doctor -v - - # Install flutter dependencies - echo "Install flutter dependencies" - flutter pub get - - # Build AppImage - echo "Build AppImage" - flutter_distributor package --flutter-build-args "dart-define-from-file=.env,target-platform=linux-arm64" --platform linux --targets appimage --artifact-name '{{name}}_{{build_name}}+{{build_number}}_{{platform}}_aarch64.{{ext}}' - - # Package the build. - - name: Copy build for AppImage - run: ls -laR - working-directory: dist - - - uses: actions/upload-artifact@v4 - with: - name: linux-appimage-arm64-artifact - path: | - ./dist/**/*.AppImage - - - name: Clean up - if: ${{ always() }} - run: | - rm -f .env - - deb: - name: Create deb - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - - - name: Setup QEMU - uses: docker/setup-qemu-action@v3 - with: - platforms: arm64 - - - name: Configure .env - run: | - echo "$ENV_KEY" | base64 --decode > .env - env: - ENV_KEY: ${{ secrets.ENV_STG_BASE64 }} - - - name: Install qemu-user-static - run: | - docker run --rm --privileged multiarch/qemu-user-static --reset -p yes - - - uses: addnab/docker-run-action@v3 - with: - image: arm64v8/ubuntu:22.04 - options: | - --rm - --cap-add SYS_ADMIN - --device /dev/fuse - --security-opt apparmor:unconfined - -v ${{ github.workspace }}:/work - --workdir /work - shell: bash - run: | - set -x - # Show linux info - echo "Show linux info" - uname --all - - # Install dependencies for Linux - echo "Install dependencies for Linux" - apt update && apt install -y sudo - sudo apt install -y wget curl git unzip xz-utils zip libglu1-mesa file - sudo apt install -y clang cmake ninja-build pkg-config libgtk-3-dev liblzma-dev - - # Setup Flutter - echo "Setup Flutter" - bash ./install-flutter-ubuntu.sh - - if [ -d "/home/linux-arm64/flutter" ]; then - echo "🟩 ls -la" - ls -la /home/linux-arm64/flutter - fi - echo 'export PATH="$PATH:/home/linux-arm64/flutter/bin:/home/linux-arm64/flutter/.pub-cache/bin:$HOME/.pub-cache/bin"' >> ~/.zshrc - source ~/.zshrc - echo $PATH - - # Install flutter_distributor - echo "Install flutter_distributor" - dart pub global activate flutter_distributor - - # Flutter doctor - echo "Flutter doctor -v" - flutter doctor -v - - # Install flutter dependencies - echo "Install flutter dependencies" - flutter pub get - - # Build deb - echo "Build deb" - flutter_distributor package --flutter-build-args "dart-define-from-file=.env,target-platform=linux-arm64" --platform linux --targets deb --artifact-name '{{name}}_{{build_name}}+{{build_number}}_{{platform}}_aarch64.{{ext}}' - - - # Package the build. - - name: Copy build for deb - run: ls -laR - working-directory: dist - - - uses: actions/upload-artifact@v4 - with: - name: linux-deb-arm64-artifact - path: | - ./dist/**/*.deb - - - name: Clean up - if: ${{ always() }} - run: | - rm -f .env - - rpm: - name: Create rpm - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - - - name: Setup QEMU - uses: docker/setup-qemu-action@v3 - with: - platforms: arm64 - - - name: Configure .env - run: | - echo "$ENV_KEY" | base64 --decode > .env - env: - ENV_KEY: ${{ secrets.ENV_STG_BASE64 }} - - - name: Install qemu-user-static - run: | - docker run --rm --privileged multiarch/qemu-user-static --reset -p yes - - - uses: addnab/docker-run-action@v3 - with: - image: arm64v8/ubuntu:22.04 - options: | - --rm - --cap-add SYS_ADMIN - --device /dev/fuse - --security-opt apparmor:unconfined - -v ${{ github.workspace }}:/work - --workdir /work - shell: bash - run: | - set -x - # Show linux info - echo "Show linux info" - uname --all - - # Install dependencies for Linux - echo "Install dependencies for Linux" - apt update && apt install -y sudo - sudo apt install -y wget curl git unzip xz-utils zip libglu1-mesa file - sudo apt install -y clang cmake ninja-build pkg-config libgtk-3-dev liblzma-dev - sudo apt install -y rpm patchelf - - # Install JDK - echo "Install JDK" - sudo apt install -y wget apt-transport-https gnupg - wget -O - https://packages.adoptium.net/artifactory/api/gpg/key/public | apt-key add - - echo "deb https://packages.adoptium.net/artifactory/deb $(awk -F= '/^VERSION_CODENAME/{print$2}' /etc/os-release) main" | tee /etc/apt/sources.list.d/adoptium.list - sudo apt update - sudo apt install -y temurin-17-jdk - - # Setup Flutter - echo "Setup Flutter" - bash ./install-flutter-ubuntu.sh - - if [ -d "/home/linux-arm64/flutter" ]; then - echo "🟩 ls -la" - ls -la /home/linux-arm64/flutter - fi - echo 'export PATH="$PATH:/home/linux-arm64/flutter/bin:/home/linux-arm64/flutter/.pub-cache/bin:$HOME/.pub-cache/bin"' >> ~/.zshrc - source ~/.zshrc - echo $PATH - - # Install flutter_distributor - echo "Install flutter_distributor" - dart pub global activate flutter_distributor - - # Flutter doctor - echo "Flutter doctor -v" - flutter doctor -v - - # Install flutter dependencies - echo "Install flutter dependencies" - flutter pub get - - # Install yq - if ! command -v yq >/dev/null 2>&1; then - echo "yq not exists" - wget https://github.com/mikefarah/yq/releases/latest/download/yq_linux_arm64 -O /usr/bin/yq &&\ - chmod +x /usr/bin/yq - fi - yq --version - - # Update make_config.yaml - echo "Update make_config.yaml" - yq -i '.build_arch = "aarch64"' linux/packaging/rpm/make_config.yaml - - # Build RPM - echo "Build RPM" - flutter_distributor package --flutter-build-args "dart-define-from-file=.env,target-platform=linux-arm64" --platform linux --targets rpm --artifact-name '{{name}}_{{build_name}}+{{build_number}}_{{platform}}_aarch64.{{ext}}' - - - # Package the build. - - name: Copy build for rpm - run: ls -laR - working-directory: dist - - - uses: actions/upload-artifact@v4 - with: - name: linux-rpm-arm64-artifact - path: | - ./dist/**/*.rpm - - - name: Clean up - if: ${{ always() }} - run: | - rm -f .env - - zip: - name: Create zip - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - - - name: Setup QEMU - uses: docker/setup-qemu-action@v3 - with: - platforms: arm64 - - - name: Configure .env - run: | - echo "$ENV_KEY" | base64 --decode > .env - env: - ENV_KEY: ${{ secrets.ENV_STG_BASE64 }} - - - name: Install qemu-user-static - run: | - docker run --rm --privileged multiarch/qemu-user-static --reset -p yes - - - uses: addnab/docker-run-action@v3 - with: - image: arm64v8/ubuntu:22.04 - options: | - --rm - --cap-add SYS_ADMIN - --device /dev/fuse - --security-opt apparmor:unconfined - -v ${{ github.workspace }}:/work - --workdir /work - shell: bash - run: | - set -x - # Show linux info - echo "Show linux info" - uname --all - - # Install dependencies for Linux - echo "Install dependencies for Linux" - apt update && apt install -y sudo - sudo apt install -y wget curl git unzip xz-utils zip libglu1-mesa file - sudo apt install -y clang cmake ninja-build pkg-config libgtk-3-dev liblzma-dev - sudo apt install -y p7zip-full p7zip-rar - - # Setup Flutter - echo "Setup Flutter" - bash ./install-flutter-ubuntu.sh - - if [ -d "/home/linux-arm64/flutter" ]; then - echo "🟩 ls -la" - ls -la /home/linux-arm64/flutter - fi - echo 'export PATH="$PATH:/home/linux-arm64/flutter/bin:/home/linux-arm64/flutter/.pub-cache/bin:$HOME/.pub-cache/bin"' >> ~/.zshrc - source ~/.zshrc - echo $PATH - - # Install flutter_distributor - echo "Install flutter_distributor" - dart pub global activate flutter_distributor - - # Flutter doctor - echo "Flutter doctor -v" - flutter doctor -v - - # Install flutter dependencies - echo "Install flutter dependencies" - flutter pub get - - # Build zip - echo "Build zip" - flutter_distributor package --flutter-build-args "dart-define-from-file=.env,target-platform=linux-arm64" --platform linux --targets zip --artifact-name '{{name}}_{{build_name}}+{{build_number}}_{{platform}}_aarch64.{{ext}}' - - - # Package the build. - - name: Copy build for zip - run: ls -laR - working-directory: dist - - - uses: actions/upload-artifact@v4 - with: - name: linux-zip-arm64-artifact - path: | - ./dist/**/*.zip - - - name: Clean up - if: ${{ always() }} - run: | - rm -f .env - - tar: - name: Create tar - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - - - name: Setup QEMU - uses: docker/setup-qemu-action@v3 - with: - platforms: arm64 - - - name: Configure .env - run: | - echo "$ENV_KEY" | base64 --decode > .env - env: - ENV_KEY: ${{ secrets.ENV_STG_BASE64 }} - - - name: Install qemu-user-static - run: | - docker run --rm --privileged multiarch/qemu-user-static --reset -p yes - - - uses: addnab/docker-run-action@v3 - with: - image: arm64v8/ubuntu:22.04 - options: | - --rm - --cap-add SYS_ADMIN - --device /dev/fuse - --security-opt apparmor:unconfined - -v ${{ github.workspace }}:/work - --workdir /work - shell: bash - run: | - set -x - # Show linux info - echo "Show linux info" - uname --all - - # Install dependencies for Linux - echo "Install dependencies for Linux" - apt update && apt install -y sudo - sudo apt install -y wget curl git unzip xz-utils zip libglu1-mesa file - sudo apt install -y clang cmake ninja-build pkg-config libgtk-3-dev liblzma-dev - sudo apt install -y p7zip-full p7zip-rar - - # Setup Flutter - echo "Setup Flutter" - bash ./install-flutter-ubuntu.sh - - if [ -d "/home/linux-arm64/flutter" ]; then - echo "🟩 ls -la" - ls -la /home/linux-arm64/flutter - fi - echo 'export PATH="$PATH:/home/linux-arm64/flutter/bin:/home/linux-arm64/flutter/.pub-cache/bin:$HOME/.pub-cache/bin"' >> ~/.zshrc - source ~/.zshrc - echo $PATH - - # Flutter doctor - echo "Flutter doctor -v" - flutter doctor -v - - # Install flutter dependencies - echo "Install flutter dependencies" - flutter pub get - - # Build flutter - echo "Build flutter" - flutter build linux --dart-define-from-file=.env --target-platform=linux-arm64 - - # Install yq - if ! command -v yq >/dev/null 2>&1; then - echo "yq not exists" - wget https://github.com/mikefarah/yq/releases/latest/download/yq_linux_arm64 -O /usr/bin/yq &&\ - chmod +x /usr/bin/yq - fi - yq --version - - # Get version - echo "Get version" - version=$(yq '.version' pubspec.yaml) - - # Build tar - echo "Build tar" - baseDir=$(pwd) - archiveName="faforever_"$version"_linux_aarch64.tar.gz" - cd build/linux/arm64/release/bundle - tar -czaf $archiveName ./* - mv $archiveName "$baseDir/" - - # Package the build. - - name: Copy build for tar - run: ls -la *.tar.gz - - - uses: actions/upload-artifact@v4 - with: - name: linux-tar-arm64-artifact - path: | - ./*.tar.gz - - - name: Clean up - if: ${{ always() }} - run: | - rm -f .env diff --git a/.github/workflows/test-linux-deb-arm64.yml b/.github/workflows/test-linux-deb-arm64.yml new file mode 100644 index 0000000..8173f4b --- /dev/null +++ b/.github/workflows/test-linux-deb-arm64.yml @@ -0,0 +1,97 @@ +name: Test Linux deb (arm64) + +on: + workflow_dispatch: + +# Declare default permissions as readonly. +permissions: read-all + +jobs: + deb: + name: Create linux deb (aarch64) + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + + - name: Setup QEMU + uses: docker/setup-qemu-action@v3 + with: + platforms: arm64 + + - name: Configure .env + run: | + echo "$ENV_KEY" | base64 --decode > .env + env: + ENV_KEY: ${{ secrets.ENV_STG_BASE64 }} + + - name: Install qemu-user-static + run: | + docker run --rm --privileged multiarch/qemu-user-static --reset -p yes + + - uses: addnab/docker-run-action@v3 + with: + image: arm64v8/ubuntu:22.04 + options: | + --rm + --cap-add SYS_ADMIN + --device /dev/fuse + --security-opt apparmor:unconfined + -v ${{ github.workspace }}:/work + --workdir /work + shell: bash + run: | + set -x + # Show linux info + echo "Show linux info" + uname --all + + # Install dependencies for Linux + echo "Install dependencies for Linux" + apt update && apt install -y sudo + sudo apt install -y wget curl git unzip xz-utils zip libglu1-mesa file + sudo apt install -y clang cmake ninja-build pkg-config libgtk-3-dev liblzma-dev + + # Setup Flutter + echo "Setup Flutter" + bash ./install-flutter-ubuntu.sh + + if [ -d "/home/linux-arm64/flutter" ]; then + echo "🟩 ls -la" + ls -la /home/linux-arm64/flutter + fi + echo 'export PATH="$PATH:/home/linux-arm64/flutter/bin:/home/linux-arm64/flutter/.pub-cache/bin:$HOME/.pub-cache/bin"' >> ~/.zshrc + source ~/.zshrc + echo $PATH + + # Flutter doctor + echo "Flutter doctor -v" + flutter doctor -v + + # Install flutter_distributor + echo "Install flutter_distributor" + dart pub global activate flutter_distributor + + # Install flutter dependencies + echo "Install flutter dependencies" + flutter pub get + + # Build deb + echo "Build deb" + flutter_distributor package --flutter-build-args "dart-define-from-file=.env,target-platform=linux-arm64" --platform linux --targets deb --artifact-name '{{name}}_{{build_name}}+{{build_number}}_{{platform}}_aarch64.{{ext}}' + + + # Package the build. + - name: Copy build for deb + run: ls -laR + working-directory: dist + + - uses: actions/upload-artifact@v4 + with: + name: linux-deb-arm64-artifact + path: | + ./dist/**/*.deb + + - name: Clean up + if: ${{ always() }} + run: | + rm -f .env diff --git a/.github/workflows/test-linux-deb.yml b/.github/workflows/test-linux-deb.yml new file mode 100644 index 0000000..b363122 --- /dev/null +++ b/.github/workflows/test-linux-deb.yml @@ -0,0 +1,59 @@ +name: Test Linux deb + +on: + workflow_dispatch: + +# Declare default permissions as readonly. +permissions: read-all + +jobs: + deb: + name: Create linux deb + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + + - name: Install dependencies for Linux + run: | + sudo apt update + sudo apt install -y clang cmake ninja-build pkg-config libgtk-3-dev liblzma-dev + + - name: Setup Flutter + uses: subosito/flutter-action@v2 + with: + channel: 'stable' + flutter-version: '3.22.3' + + - name: Flutter doctor -v + run: flutter doctor -v + + - name: Configure .env + run: | + echo "$ENV_KEY" | base64 --decode > .env + env: + ENV_KEY: ${{ secrets.ENV_STG_BASE64 }} + + - name: Install flutter_distributor + run: dart pub global activate flutter_distributor + + - name: Install flutter dependencies + run: flutter pub get + + - name: Build deb + run: flutter_distributor package --flutter-build-args "dart-define-from-file=.env,target-platform=linux-x64" --platform linux --targets deb --artifact-name '{{name}}_{{build_name}}+{{build_number}}_{{platform}}_amd64.{{ext}}' + + # Package the build. + - name: Copy build for deb + run: ls -laR + working-directory: dist + + - uses: actions/upload-artifact@v4 + with: + name: linux-deb-artifact + path: | + ./dist/**/*.deb + + - name: Clean up + if: ${{ always() }} + run: | + rm -f .env diff --git a/.github/workflows/test-linux-flatpak-arm64.yml b/.github/workflows/test-linux-flatpak-arm64.yml index d48e29d..f0e356e 100644 --- a/.github/workflows/test-linux-flatpak-arm64.yml +++ b/.github/workflows/test-linux-flatpak-arm64.yml @@ -8,7 +8,7 @@ permissions: read-all jobs: flatpak: - name: Create flatpak + name: Create linux flatpak (aarch64) runs-on: ubuntu-latest container: image: bilelmoussaoui/flatpak-github-actions:freedesktop-22.08 diff --git a/.github/workflows/test-linux-flatpak.yml b/.github/workflows/test-linux-flatpak.yml index 81f54ae..166b344 100644 --- a/.github/workflows/test-linux-flatpak.yml +++ b/.github/workflows/test-linux-flatpak.yml @@ -8,7 +8,7 @@ permissions: read-all jobs: flatpak: - name: Create flatpak + name: Create linux flatpak runs-on: ubuntu-latest container: image: bilelmoussaoui/flatpak-github-actions:freedesktop-22.08 diff --git a/.github/workflows/test-linux-pacman-arm64.yml b/.github/workflows/test-linux-pacman-arm64.yml index c8b071e..885358e 100644 --- a/.github/workflows/test-linux-pacman-arm64.yml +++ b/.github/workflows/test-linux-pacman-arm64.yml @@ -18,9 +18,6 @@ jobs: with: platforms: all - - name: Show linux info - run: uname --all - - name: Configure .env run: | echo "$ENV_KEY" | base64 --decode > .env @@ -28,8 +25,7 @@ jobs: ENV_KEY: ${{ secrets.ENV_STG_BASE64 }} - name: Install qemu-user-static - run: | - docker run --rm --privileged multiarch/qemu-user-static --reset -p yes + run: docker run --rm --privileged multiarch/qemu-user-static --reset -p yes # https://github.com/s3fs-fuse/s3fs-fuse/issues/647#issuecomment-637458150 - uses: addnab/docker-run-action@v3 diff --git a/.github/workflows/test-linux-pacman.yml b/.github/workflows/test-linux-pacman.yml index 2271254..57c10d1 100644 --- a/.github/workflows/test-linux-pacman.yml +++ b/.github/workflows/test-linux-pacman.yml @@ -36,8 +36,7 @@ jobs: ENV_KEY: ${{ secrets.ENV_STG_BASE64 }} - name: Install flutter_distributor - run: | - dart pub global activate flutter_distributor + run: dart pub global activate flutter_distributor - name: Install flutter dependencies run: flutter pub get diff --git a/.github/workflows/test-linux-rpm-arm64.yml b/.github/workflows/test-linux-rpm-arm64.yml new file mode 100644 index 0000000..bbb769a --- /dev/null +++ b/.github/workflows/test-linux-rpm-arm64.yml @@ -0,0 +1,118 @@ +name: Test Linux rpm (arm64) + +on: + workflow_dispatch: + +# Declare default permissions as readonly. +permissions: read-all + +jobs: + rpm: + name: Create linux rpm (aarch64) + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + + - name: Setup QEMU + uses: docker/setup-qemu-action@v3 + with: + platforms: arm64 + + - name: Configure .env + run: | + echo "$ENV_KEY" | base64 --decode > .env + env: + ENV_KEY: ${{ secrets.ENV_STG_BASE64 }} + + - name: Install qemu-user-static + run: | + docker run --rm --privileged multiarch/qemu-user-static --reset -p yes + + - uses: addnab/docker-run-action@v3 + with: + image: arm64v8/ubuntu:22.04 + options: | + --rm + --cap-add SYS_ADMIN + --device /dev/fuse + --security-opt apparmor:unconfined + -v ${{ github.workspace }}:/work + --workdir /work + shell: bash + run: | + set -x + # Show linux info + echo "Show linux info" + uname --all + + # Install dependencies for Linux + echo "Install dependencies for Linux" + apt update && apt install -y sudo + sudo apt install -y wget curl git unzip xz-utils zip libglu1-mesa file + sudo apt install -y clang cmake ninja-build pkg-config libgtk-3-dev liblzma-dev + sudo apt install -y rpm patchelf + + # Install JDK + echo "Install JDK" + sudo apt install -y wget apt-transport-https gnupg + wget -O - https://packages.adoptium.net/artifactory/api/gpg/key/public | apt-key add - + echo "deb https://packages.adoptium.net/artifactory/deb $(awk -F= '/^VERSION_CODENAME/{print$2}' /etc/os-release) main" | tee /etc/apt/sources.list.d/adoptium.list + sudo apt update + sudo apt install -y temurin-17-jdk + + # Setup Flutter + echo "Setup Flutter" + bash ./install-flutter-ubuntu.sh + + if [ -d "/home/linux-arm64/flutter" ]; then + echo "🟩 ls -la" + ls -la /home/linux-arm64/flutter + fi + echo 'export PATH="$PATH:/home/linux-arm64/flutter/bin:/home/linux-arm64/flutter/.pub-cache/bin:$HOME/.pub-cache/bin"' >> ~/.zshrc + source ~/.zshrc + echo $PATH + + # Flutter doctor + echo "Flutter doctor -v" + flutter doctor -v + + # Install flutter_distributor + echo "Install flutter_distributor" + dart pub global activate flutter_distributor + + # Install flutter dependencies + echo "Install flutter dependencies" + flutter pub get + + # Install yq + if ! command -v yq >/dev/null 2>&1; then + echo "yq not exists" + wget https://github.com/mikefarah/yq/releases/latest/download/yq_linux_arm64 -O /usr/bin/yq &&\ + chmod +x /usr/bin/yq + fi + yq --version + + # Update make_config.yaml + echo "Update make_config.yaml" + yq -i '.build_arch = "aarch64"' linux/packaging/rpm/make_config.yaml + + # Build RPM + echo "Build RPM" + flutter_distributor package --flutter-build-args "dart-define-from-file=.env,target-platform=linux-arm64" --platform linux --targets rpm --artifact-name '{{name}}_{{build_name}}+{{build_number}}_{{platform}}_aarch64.{{ext}}' + + + # Package the build. + - name: Copy build for rpm + run: ls -laR + working-directory: dist + + - uses: actions/upload-artifact@v4 + with: + name: linux-rpm-arm64-artifact + path: | + ./dist/**/*.rpm + + - name: Clean up + if: ${{ always() }} + run: | + rm -f .env diff --git a/.github/workflows/test-linux.yml b/.github/workflows/test-linux-rpm.yml similarity index 61% rename from .github/workflows/test-linux.yml rename to .github/workflows/test-linux-rpm.yml index 5551544..3ee9065 100644 --- a/.github/workflows/test-linux.yml +++ b/.github/workflows/test-linux-rpm.yml @@ -1,4 +1,4 @@ -name: Test Linux +name: Test Linux rpm on: workflow_dispatch: @@ -7,113 +7,8 @@ on: permissions: read-all jobs: - appimage: - name: Create AppImage - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - - - name: Install dependencies for Linux - run: | - sudo apt update - sudo apt install -y clang cmake ninja-build pkg-config libgtk-3-dev liblzma-dev - sudo apt install -y locate libfuse2 - wget -O appimagetool "https://github.com/AppImage/AppImageKit/releases/download/continuous/appimagetool-x86_64.AppImage" - chmod +x appimagetool && mv appimagetool /usr/local/bin/ - - - name: Setup Flutter - uses: subosito/flutter-action@v2 - with: - channel: 'stable' - flutter-version: '3.22.3' - - - name: Configure .env - run: | - echo "$ENV_KEY" | base64 --decode > .env - env: - ENV_KEY: ${{ secrets.ENV_STG_BASE64 }} - - - name: Install flutter_distributor - run: dart pub global activate flutter_distributor - - - name: Flutter doctor -v - run: flutter doctor -v - - - name: Install flutter dependencies - run: flutter pub get - - - name: Build AppImage - run: flutter_distributor package --flutter-build-args "dart-define-from-file=.env,target-platform=linux-x64" --platform linux --targets appimage --artifact-name '{{name}}_{{build_name}}+{{build_number}}_{{platform}}_amd64.{{ext}}' - - # Package the build. - - name: Copy build for AppImage - run: ls -laR - working-directory: dist - - - uses: actions/upload-artifact@v4 - with: - name: linux-appimage-artifact - path: | - ./dist/**/*.AppImage - - - name: Clean up - if: ${{ always() }} - run: | - rm -f .env - - deb: - name: Create deb - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - - - name: Install dependencies for Linux - run: | - sudo apt update - sudo apt install -y clang cmake ninja-build pkg-config libgtk-3-dev liblzma-dev - - - name: Setup Flutter - uses: subosito/flutter-action@v2 - with: - channel: 'stable' - flutter-version: '3.22.3' - - - name: Configure .env - run: | - echo "$ENV_KEY" | base64 --decode > .env - env: - ENV_KEY: ${{ secrets.ENV_STG_BASE64 }} - - - name: Install flutter_distributor - run: dart pub global activate flutter_distributor - - - name: Flutter doctor -v - run: flutter doctor -v - - - name: Install flutter dependencies - run: flutter pub get - - - name: Build deb - run: flutter_distributor package --flutter-build-args "dart-define-from-file=.env,target-platform=linux-x64" --platform linux --targets deb --artifact-name '{{name}}_{{build_name}}+{{build_number}}_{{platform}}_amd64.{{ext}}' - - # Package the build. - - name: Copy build for deb - run: ls -laR - working-directory: dist - - - uses: actions/upload-artifact@v4 - with: - name: linux-deb-artifact - path: | - ./dist/**/*.deb - - - name: Clean up - if: ${{ always() }} - run: | - rm -f .env - rpm: - name: Create rpm + name: Create linux rpm runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 @@ -135,6 +30,9 @@ jobs: channel: 'stable' flutter-version: '3.22.3' + - name: Flutter doctor -v + run: flutter doctor -v + - name: Configure .env run: | echo "$ENV_KEY" | base64 --decode > .env @@ -144,9 +42,6 @@ jobs: - name: Install flutter_distributor run: dart pub global activate flutter_distributor - - name: Flutter doctor -v - run: flutter doctor -v - - name: Install flutter dependencies run: flutter pub get diff --git a/.github/workflows/test-linux-snapcraft-arm64.yml b/.github/workflows/test-linux-snapcraft-arm64.yml index 62129e6..58bb92f 100644 --- a/.github/workflows/test-linux-snapcraft-arm64.yml +++ b/.github/workflows/test-linux-snapcraft-arm64.yml @@ -8,7 +8,7 @@ permissions: read-all jobs: snap_arm64: - name: Create snap + name: Create linux snap (aarch64) runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 @@ -25,8 +25,7 @@ jobs: ENV_KEY: ${{ secrets.ENV_STG_BASE64 }} - name: Install qemu-user-static - run: | - docker run --rm --privileged multiarch/qemu-user-static --reset -p yes + run: docker run --rm --privileged multiarch/qemu-user-static --reset -p yes # https://github.com/s3fs-fuse/s3fs-fuse/issues/647#issuecomment-637458150 - uses: addnab/docker-run-action@v3 diff --git a/.github/workflows/test-linux-snapcraft.yml b/.github/workflows/test-linux-snapcraft.yml index 6a200b9..fa20f01 100644 --- a/.github/workflows/test-linux-snapcraft.yml +++ b/.github/workflows/test-linux-snapcraft.yml @@ -8,7 +8,7 @@ permissions: read-all jobs: snap: - name: Create snap + name: Create linux snap runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 @@ -38,8 +38,7 @@ jobs: yq -i '.parts.faforever.build-environment[1].FLUTTER_VERSION = "3.22.3"' snap/snapcraft.yaml - name: Install snapcraft - run: | - sudo snap install snapcraft --classic + run: sudo snap install snapcraft --classic - name: Build snap run: | diff --git a/.github/workflows/test-linux-tar-arm64.yml b/.github/workflows/test-linux-tar-arm64.yml new file mode 100644 index 0000000..48ec78c --- /dev/null +++ b/.github/workflows/test-linux-tar-arm64.yml @@ -0,0 +1,112 @@ +name: Test Linux tar (arm64) + +on: + workflow_dispatch: + +# Declare default permissions as readonly. +permissions: read-all + +jobs: + tar: + name: Create linux tar (aarch64) + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + + - name: Setup QEMU + uses: docker/setup-qemu-action@v3 + with: + platforms: arm64 + + - name: Configure .env + run: | + echo "$ENV_KEY" | base64 --decode > .env + env: + ENV_KEY: ${{ secrets.ENV_STG_BASE64 }} + + - name: Install qemu-user-static + run: | + docker run --rm --privileged multiarch/qemu-user-static --reset -p yes + + - uses: addnab/docker-run-action@v3 + with: + image: arm64v8/ubuntu:22.04 + options: | + --rm + --cap-add SYS_ADMIN + --device /dev/fuse + --security-opt apparmor:unconfined + -v ${{ github.workspace }}:/work + --workdir /work + shell: bash + run: | + set -x + # Show linux info + echo "Show linux info" + uname --all + + # Install dependencies for Linux + echo "Install dependencies for Linux" + apt update && apt install -y sudo + sudo apt install -y wget curl git unzip xz-utils zip libglu1-mesa file + sudo apt install -y clang cmake ninja-build pkg-config libgtk-3-dev liblzma-dev + sudo apt install -y p7zip-full p7zip-rar + + # Setup Flutter + echo "Setup Flutter" + bash ./install-flutter-ubuntu.sh + + if [ -d "/home/linux-arm64/flutter" ]; then + echo "🟩 ls -la" + ls -la /home/linux-arm64/flutter + fi + echo 'export PATH="$PATH:/home/linux-arm64/flutter/bin:/home/linux-arm64/flutter/.pub-cache/bin:$HOME/.pub-cache/bin"' >> ~/.zshrc + source ~/.zshrc + echo $PATH + + # Flutter doctor + echo "Flutter doctor -v" + flutter doctor -v + + # Install flutter dependencies + echo "Install flutter dependencies" + flutter pub get + + # Build flutter + echo "Build flutter" + flutter build linux --dart-define-from-file=.env --target-platform=linux-arm64 + + # Install yq + if ! command -v yq >/dev/null 2>&1; then + echo "yq not exists" + wget https://github.com/mikefarah/yq/releases/latest/download/yq_linux_arm64 -O /usr/bin/yq &&\ + chmod +x /usr/bin/yq + fi + yq --version + + # Get version + echo "Get version" + version=$(yq '.version' pubspec.yaml) + + # Build tar + echo "Build tar" + baseDir=$(pwd) + archiveName="faforever_"$version"_linux_aarch64.tar.gz" + cd build/linux/arm64/release/bundle + tar -czaf $archiveName ./* + mv $archiveName "$baseDir/" + + # Package the build. + - name: Copy build for tar + run: ls -la *.tar.gz + + - uses: actions/upload-artifact@v4 + with: + name: linux-tar-arm64-artifact + path: | + ./*.tar.gz + + - name: Clean up + if: ${{ always() }} + run: | + rm -f .env diff --git a/.github/workflows/test-linux-tar.yml b/.github/workflows/test-linux-tar.yml new file mode 100644 index 0000000..5349808 --- /dev/null +++ b/.github/workflows/test-linux-tar.yml @@ -0,0 +1,79 @@ +name: Test Linux tar + +on: + workflow_dispatch: + +# Declare default permissions as readonly. +permissions: read-all + +jobs: + tar: + name: Create linux tar + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + + - name: Install dependencies for Linux + run: | + sudo apt update + sudo apt install -y clang cmake ninja-build pkg-config libgtk-3-dev liblzma-dev + sudo apt install -y p7zip-full p7zip-rar + + - name: Setup Flutter + uses: subosito/flutter-action@v2 + with: + channel: 'stable' + flutter-version: '3.22.3' + + - name: Flutter doctor -v + run: flutter doctor -v + + - name: Configure .env + run: | + echo "$ENV_KEY" | base64 --decode > .env + env: + ENV_KEY: ${{ secrets.ENV_STG_BASE64 }} + + - name: Install flutter dependencies + run: flutter pub get + + - name: Build flutter + run: flutter build linux --dart-define-from-file=.env --target-platform=linux-x64 + + - name: Install yq + run: | + if ! command -v yq >/dev/null 2>&1; then + echo "yq not exists" + if ! command -v wget >/dev/null 2>&1; then + echo "wget not exists" + sudo apt install -y wget + fi + wget https://github.com/mikefarah/yq/releases/latest/download/yq_linux_amd64 -O /usr/bin/yq &&\ + chmod +x /usr/bin/yq + fi + yq --version + + - name: Build tar + run: | + baseDir=$(pwd) + VERSION=$(yq '.version' pubspec.yaml) + echo "$VERSION" + archiveName="faforever_"$VERSION"_linux_amd64.tar.gz" + cd build/linux/x64/release/bundle + tar -czaf $archiveName ./* + mv $archiveName "$baseDir/" + + # Package the build. + - name: Copy build for tar + run: ls -la *.tar.gz + + - uses: actions/upload-artifact@v4 + with: + name: linux-tar-artifact + path: | + ./*.tar.gz + + - name: Clean up + if: ${{ always() }} + run: | + rm -f .env diff --git a/.github/workflows/test-linux-zip-arm64.yml b/.github/workflows/test-linux-zip-arm64.yml new file mode 100644 index 0000000..95678d2 --- /dev/null +++ b/.github/workflows/test-linux-zip-arm64.yml @@ -0,0 +1,98 @@ +name: Test Linux zip (arm64) + +on: + workflow_dispatch: + +# Declare default permissions as readonly. +permissions: read-all + +jobs: + zip: + name: Create linux zip (aarch64) + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + + - name: Setup QEMU + uses: docker/setup-qemu-action@v3 + with: + platforms: arm64 + + - name: Configure .env + run: | + echo "$ENV_KEY" | base64 --decode > .env + env: + ENV_KEY: ${{ secrets.ENV_STG_BASE64 }} + + - name: Install qemu-user-static + run: | + docker run --rm --privileged multiarch/qemu-user-static --reset -p yes + + - uses: addnab/docker-run-action@v3 + with: + image: arm64v8/ubuntu:22.04 + options: | + --rm + --cap-add SYS_ADMIN + --device /dev/fuse + --security-opt apparmor:unconfined + -v ${{ github.workspace }}:/work + --workdir /work + shell: bash + run: | + set -x + # Show linux info + echo "Show linux info" + uname --all + + # Install dependencies for Linux + echo "Install dependencies for Linux" + apt update && apt install -y sudo + sudo apt install -y wget curl git unzip xz-utils zip libglu1-mesa file + sudo apt install -y clang cmake ninja-build pkg-config libgtk-3-dev liblzma-dev + sudo apt install -y p7zip-full p7zip-rar + + # Setup Flutter + echo "Setup Flutter" + bash ./install-flutter-ubuntu.sh + + if [ -d "/home/linux-arm64/flutter" ]; then + echo "🟩 ls -la" + ls -la /home/linux-arm64/flutter + fi + echo 'export PATH="$PATH:/home/linux-arm64/flutter/bin:/home/linux-arm64/flutter/.pub-cache/bin:$HOME/.pub-cache/bin"' >> ~/.zshrc + source ~/.zshrc + echo $PATH + + # Flutter doctor + echo "Flutter doctor -v" + flutter doctor -v + + # Install flutter_distributor + echo "Install flutter_distributor" + dart pub global activate flutter_distributor + + # Install flutter dependencies + echo "Install flutter dependencies" + flutter pub get + + # Build zip + echo "Build zip" + flutter_distributor package --flutter-build-args "dart-define-from-file=.env,target-platform=linux-arm64" --platform linux --targets zip --artifact-name '{{name}}_{{build_name}}+{{build_number}}_{{platform}}_aarch64.{{ext}}' + + + # Package the build. + - name: Copy build for zip + run: ls -laR + working-directory: dist + + - uses: actions/upload-artifact@v4 + with: + name: linux-zip-arm64-artifact + path: | + ./dist/**/*.zip + + - name: Clean up + if: ${{ always() }} + run: | + rm -f .env diff --git a/.github/workflows/test-linux-zip.yml b/.github/workflows/test-linux-zip.yml new file mode 100644 index 0000000..92d363e --- /dev/null +++ b/.github/workflows/test-linux-zip.yml @@ -0,0 +1,60 @@ +name: Test Linux zip + +on: + workflow_dispatch: + +# Declare default permissions as readonly. +permissions: read-all + +jobs: + zip: + name: Create linux zip + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + + - name: Install dependencies for Linux + run: | + sudo apt update + sudo apt install -y clang cmake ninja-build pkg-config libgtk-3-dev liblzma-dev + sudo apt install -y p7zip-full p7zip-rar + + - name: Setup Flutter + uses: subosito/flutter-action@v2 + with: + channel: 'stable' + flutter-version: '3.22.3' + + - name: Configure .env + run: | + echo "$ENV_KEY" | base64 --decode > .env + env: + ENV_KEY: ${{ secrets.ENV_STG_BASE64 }} + + - name: Install flutter_distributor + run: dart pub global activate flutter_distributor + + - name: Flutter doctor -v + run: flutter doctor -v + + - name: Install flutter dependencies + run: flutter pub get + + - name: Build zip + run: flutter_distributor package --flutter-build-args "dart-define-from-file=.env,target-platform=linux-x64" --platform linux --targets zip --artifact-name '{{name}}_{{build_name}}+{{build_number}}_{{platform}}_amd64.{{ext}}' + + # Package the build. + - name: Copy build for zip + run: ls -laR + working-directory: dist + + - uses: actions/upload-artifact@v4 + with: + name: linux-zip-artifact + path: | + ./dist/**/*.zip + + - name: Clean up + if: ${{ always() }} + run: | + rm -f .env diff --git a/.github/workflows/test-macos-dmg.yml b/.github/workflows/test-macos-dmg.yml index d0da10c..8183346 100644 --- a/.github/workflows/test-macos-dmg.yml +++ b/.github/workflows/test-macos-dmg.yml @@ -28,15 +28,14 @@ jobs: channel: 'stable' flutter-version: '3.22.3' + - name: Flutter doctor -v + run: flutter doctor -v + - name: Configure .env - run: | - echo "$ENV_KEY" | base64 --decode > .env + run: echo "$ENV_KEY" | base64 --decode > .env env: ENV_KEY: ${{ secrets.ENV_STG_BASE64 }} - - name: Flutter doctor -v - run: flutter doctor -v - - name: Resolving flutter dependencies run: flutter pub get @@ -107,8 +106,7 @@ jobs: KEYCHAIN_PASSWORD: ${{ secrets.KEYCHAIN_PASSWORD }} - name: Install appdmg - run: | - pnpm add -g appdmg + run: pnpm add -g appdmg - name: Install yq run: | diff --git a/.github/workflows/test-macos-pkg-appstore.yml b/.github/workflows/test-macos-pkg-appstore.yml index 0a8b3ab..6478c30 100644 --- a/.github/workflows/test-macos-pkg-appstore.yml +++ b/.github/workflows/test-macos-pkg-appstore.yml @@ -19,15 +19,14 @@ jobs: channel: 'stable' flutter-version: '3.22.3' + - name: Flutter doctor -v + run: flutter doctor -v + - name: Configure .env - run: | - echo "$ENV_KEY" | base64 --decode > .env + run: echo "$ENV_KEY" | base64 --decode > .env env: ENV_KEY: ${{ secrets.ENV_STG_BASE64 }} - - name: Flutter doctor -v - run: flutter doctor -v - - name: Resolving flutter dependencies run: flutter pub get diff --git a/.github/workflows/test-macos-pkg.yml b/.github/workflows/test-macos-pkg.yml index fb2706c..92122af 100644 --- a/.github/workflows/test-macos-pkg.yml +++ b/.github/workflows/test-macos-pkg.yml @@ -19,15 +19,14 @@ jobs: channel: 'stable' flutter-version: '3.22.3' + - name: Flutter doctor -v + run: flutter doctor -v + - name: Configure .env - run: | - echo "$ENV_KEY" | base64 --decode > .env + run: echo "$ENV_KEY" | base64 --decode > .env env: ENV_KEY: ${{ secrets.ENV_STG_BASE64 }} - - name: Flutter doctor -v - run: flutter doctor -v - - name: Resolving flutter dependencies run: flutter pub get diff --git a/.github/workflows/test-macos-tar.yml b/.github/workflows/test-macos-tar.yml index 20cd613..40510c8 100644 --- a/.github/workflows/test-macos-tar.yml +++ b/.github/workflows/test-macos-tar.yml @@ -19,15 +19,14 @@ jobs: channel: 'stable' flutter-version: '3.22.3' + - name: Flutter doctor -v + run: flutter doctor -v + - name: Configure .env - run: | - echo "$ENV_KEY" | base64 --decode > .env + run: echo "$ENV_KEY" | base64 --decode > .env env: ENV_KEY: ${{ secrets.ENV_STG_BASE64 }} - - name: Flutter doctor -v - run: flutter doctor -v - - name: Resolving flutter dependencies run: flutter pub get diff --git a/.github/workflows/test-macos-zip.yml b/.github/workflows/test-macos-zip.yml index cc47b19..45f385c 100644 --- a/.github/workflows/test-macos-zip.yml +++ b/.github/workflows/test-macos-zip.yml @@ -26,15 +26,14 @@ jobs: channel: 'stable' flutter-version: '3.22.3' + - name: Flutter doctor -v + run: flutter doctor -v + - name: Configure .env - run: | - echo "$ENV_KEY" | base64 --decode > .env + run: echo "$ENV_KEY" | base64 --decode > .env env: ENV_KEY: ${{ secrets.ENV_STG_BASE64 }} - - name: Flutter doctor -v - run: flutter doctor -v - - name: Resolving flutter dependencies run: flutter pub get diff --git a/.github/workflows/test-windows-exe.yml b/.github/workflows/test-windows-exe.yml index 9d55446..fa6d4e9 100644 --- a/.github/workflows/test-windows-exe.yml +++ b/.github/workflows/test-windows-exe.yml @@ -19,6 +19,9 @@ jobs: channel: 'stable' flutter-version: '3.22.3' + - name: Flutter doctor -v + run: flutter doctor -v + - name: Configure .env run: | echo "$pwd" @@ -40,9 +43,6 @@ jobs: - name: Install flutter_distributor run: dart pub global activate flutter_distributor - - name: Flutter doctor -v - run: flutter doctor -v - - name: Install flutter dependencies run: flutter pub get diff --git a/.github/workflows/test-windows-msix.yml b/.github/workflows/test-windows-msix.yml index 0763ed6..06f2391 100644 --- a/.github/workflows/test-windows-msix.yml +++ b/.github/workflows/test-windows-msix.yml @@ -47,6 +47,9 @@ jobs: channel: 'stable' flutter-version: '3.22.3' + - name: Flutter doctor -v + run: flutter doctor -v + - name: Configure .env run: | echo "$pwd" @@ -55,9 +58,6 @@ jobs: env: ENV_KEY: ${{ secrets.ENV_STG_BASE64_WINDOWS }} - - name: Flutter doctor -v - run: flutter doctor -v - - name: Install yq shell: pwsh run: | diff --git a/.github/workflows/test-windows-zip.yml b/.github/workflows/test-windows-zip.yml index bbdb2de..6dfbf9b 100644 --- a/.github/workflows/test-windows-zip.yml +++ b/.github/workflows/test-windows-zip.yml @@ -19,6 +19,9 @@ jobs: channel: 'stable' flutter-version: '3.22.3' + - name: Flutter doctor -v + run: flutter doctor -v + - name: Configure .env run: | echo "$pwd" @@ -30,9 +33,6 @@ jobs: - name: Install flutter_distributor run: dart pub global activate flutter_distributor - - name: Flutter doctor -v - run: flutter doctor -v - - name: Install flutter dependencies run: flutter pub get