Disable icon tree-shaking. #325
Workflow file for this run
This file contains hidden or 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: Flutter CI | |
| on: | |
| push: | |
| tags: | |
| - '*' | |
| env: | |
| windows_build_output_path: "build/windows/x64/runner/Release/*" | |
| macos_build_output_path: "build/macos/Build/Products/Release/TriOS.app" | |
| linux_build_output_path: "build/linux/x64/release/bundle" | |
| jobs: | |
| build-windows: | |
| runs-on: windows-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Remove Non-Windows Files | |
| run: | | |
| echo "Deleting files in non-Windows asset directories..." | |
| Get-Childitem assets/linux -File -Recurse | Foreach-Object {Write-Output "Deleting: $_.FullName"; Remove-Item $_.FullName -Force} | |
| Get-Childitem assets/macos -File -Recurse | Foreach-Object {Write-Output "Deleting: $_.FullName"; Remove-Item $_.FullName -Force} | |
| echo "Non-Windows asset files deleted." | |
| - name: Flutter Setup | |
| run: echo "Setting up Flutter..." | |
| - uses: subosito/flutter-action@v2 | |
| with: | |
| flutter-version-file: pubspec.yaml | |
| architecture: x64 | |
| cache: true | |
| - run: flutter --version | |
| - run: flutter clean | |
| - run: flutter config --enable-windows-desktop | |
| # Use Visual C++ 2019 toolset so that the WebView doesn't crash on Windows 10 | |
| - name: Set up Visual Studio 2019 | |
| uses: ilammy/msvc-dev-cmd@v1 | |
| with: | |
| arch: x64 | |
| toolset: 14.29 | |
| vcvars_ver: 14.29 | |
| - name: Build Windows | |
| run: | | |
| echo "Building Windows app..." | |
| flutter build windows --no-tree-shake-icons | |
| echo "Build complete." | |
| - name: Prepare TriOS Directory | |
| run: | | |
| echo "Preparing directory for Windows artifact..." | |
| mkdir TriOS | |
| - name: Move Build Output to TriOS Directory | |
| run: | | |
| echo "Moving build output to TriOS directory..." | |
| Get-ChildItem ${{ env.windows_build_output_path }} | Move-Item -Destination TriOS/ | |
| echo "Move complete. Listing contents of the TriOS directory:" | |
| dir | |
| - name: Zip TriOS Directory | |
| run: | | |
| echo "Zipping Windows artifact..." | |
| Compress-Archive -Path TriOS -DestinationPath TriOS-Windows.zip | |
| echo "Zipping complete. Listing contents of the workspace:" | |
| dir | |
| - name: Upload Windows Artifact | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: built-windows | |
| path: TriOS-Windows.zip | |
| build-macos-intel: | |
| runs-on: macos-15-intel | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Remove Non-macOS Files | |
| run: | | |
| echo "Deleting files in non-macOS asset directories..." | |
| find assets/windows/ -type f -exec echo "Deleting: {}" \; -exec rm -f {} \; | |
| find assets/linux/ -type f -exec echo "Deleting: {}" \; -exec rm -f {} \; | |
| echo "Non-macOS asset files deleted." | |
| - name: Flutter Setup | |
| run: echo "Setting up Flutter..." | |
| - uses: subosito/flutter-action@v2 | |
| with: | |
| flutter-version-file: pubspec.yaml | |
| architecture: x64 | |
| cache: true | |
| - run: flutter --version | |
| - run: flutter config --enable-macos-desktop | |
| - name: Build macOS (Intel) | |
| run: | | |
| echo "Building macOS Intel app..." | |
| flutter build macos --no-tree-shake-icons | |
| echo "Build complete. Listing contents of the output directory:" | |
| ls -l ${{ env.macos_build_output_path }} | |
| - name: Zip macOS Intel Artifact | |
| run: | | |
| echo "Zipping macOS Intel artifact..." | |
| cd $(dirname ${{ env.macos_build_output_path }}) | |
| pwd | |
| ls -l | |
| zip -yr9 $GITHUB_WORKSPACE/TriOS-MacOS-Intel.zip $(basename ${{ env.macos_build_output_path }}) | |
| echo "Zipping complete. Listing contents of the workspace:" | |
| ls -l $GITHUB_WORKSPACE | |
| - name: Upload macOS Intel Artifact | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: built-macos-intel | |
| path: TriOS-MacOS-Intel.zip | |
| build-macos-arm: | |
| runs-on: macos-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Remove Non-macOS Files | |
| run: | | |
| echo "Deleting files in non-macOS asset directories..." | |
| find assets/windows/ -type f -exec echo "Deleting: {}" \; -exec rm -f {} \; | |
| find assets/linux/ -type f -exec echo "Deleting: {}" \; -exec rm -f {} \; | |
| echo "Non-macOS asset files deleted." | |
| - name: Flutter Setup | |
| run: echo "Setting up Flutter..." | |
| - uses: subosito/flutter-action@v2 | |
| with: | |
| flutter-version-file: pubspec.yaml | |
| architecture: arm64 | |
| cache: true | |
| - run: flutter --version | |
| - run: flutter config --enable-macos-desktop | |
| - name: Build macOS (Apple Silicon) | |
| run: | | |
| echo "Building macOS Apple Silicon app..." | |
| flutter build macos --no-tree-shake-icons | |
| echo "Build complete. Listing contents of the output directory:" | |
| ls -l ${{ env.macos_build_output_path }} | |
| - name: Zip macOS Apple Silicon Artifact | |
| run: | | |
| echo "Zipping macOS Apple Silicon artifact..." | |
| cd $(dirname ${{ env.macos_build_output_path }}) | |
| pwd | |
| ls -l | |
| zip -yr9 $GITHUB_WORKSPACE/TriOS-MacOS-AppleSilicon.zip $(basename ${{ env.macos_build_output_path }}) | |
| echo "Zipping complete. Listing contents of the workspace:" | |
| ls -l $GITHUB_WORKSPACE | |
| - name: Upload macOS Apple Silicon Artifact | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: built-macos-arm | |
| path: TriOS-MacOS-AppleSilicon.zip | |
| build-linux: | |
| runs-on: ubuntu-22.04 | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Remove Non-Linux Files | |
| run: | | |
| echo "Deleting files in non-Linux asset directories..." | |
| find assets/windows/ -type f -exec echo "Deleting: {}" \; -exec rm -f {} \; | |
| find assets/macos/ -type f -exec echo "Deleting: {}" \; -exec rm -f {} \; | |
| echo "Non-Linux asset files deleted." | |
| - name: Install Dependencies | |
| run: | | |
| sudo apt-get update | |
| sudo apt-get install -y ninja-build cmake g++ libgtk-3-dev libcurl4-openssl-dev default-jdk | |
| - name: Flutter Setup | |
| run: echo "Setting up Flutter..." | |
| - uses: subosito/flutter-action@v2 | |
| with: | |
| flutter-version-file: pubspec.yaml | |
| architecture: x64 | |
| cache: true | |
| - run: flutter --version | |
| - run: flutter config --enable-linux-desktop | |
| - name: Build Linux | |
| run: | | |
| echo "Building Linux app..." | |
| flutter clean | |
| flutter pub get | |
| find -L . -type f -name "CMakeLists.txt" -exec sed -i 's/-Wno-deprecated-literal-operator//g' {} + 2>/dev/null || true | |
| flutter build linux --no-tree-shake-icons | |
| echo "Build complete. Listing contents of the output directory:" | |
| ls -l ${{ env.linux_build_output_path }} | |
| - name: Zip Linux Artifact | |
| run: | | |
| echo "Zipping Linux artifact..." | |
| cd $(dirname ${{ env.linux_build_output_path }}) | |
| mkdir TriOS | |
| cp -r $(basename ${{ env.linux_build_output_path }})/* TriOS/ | |
| pwd | |
| ls -l | |
| zip -yr9 $GITHUB_WORKSPACE/TriOS-Linux.zip TriOS | |
| echo "Zipping complete. Listing contents of the workspace:" | |
| ls -l $GITHUB_WORKSPACE | |
| - name: Upload Linux Artifact | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: built-linux | |
| path: TriOS-Linux.zip | |
| create-release: | |
| runs-on: ubuntu-latest | |
| needs: [ build-macos-intel, build-macos-arm, build-windows, build-linux ] | |
| permissions: | |
| contents: write | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Fetch Tags | |
| run: git fetch --prune --unshallow --tags | |
| - name: Set Variables | |
| run: | | |
| echo "Setting version based on git tags..." | |
| echo "VERSION=$(git describe --tags)" >> $GITHUB_ENV | |
| git log --format=%B -n 1 $(git log -1 --pretty=format:"%h") | cat - > changes.txt | |
| echo "Generated changes.txt:" | |
| cat changes.txt | |
| prerelease_regex=".*(dev|qa|rc|prerelease|unstable|preview).*" | |
| if [[ "$(git describe --tags)" =~ $prerelease_regex ]]; then | |
| echo "IS_PRERELEASE=true" >> $GITHUB_ENV; | |
| echo "This is a pre-release." | |
| else | |
| echo "IS_PRERELEASE=false" >> $GITHUB_ENV; | |
| echo "This is a stable release." | |
| fi | |
| - name: 'Create GitHub release from a tag' | |
| id: create_release | |
| uses: ncipollo/release-action@v1 | |
| with: | |
| commit: '${{ github.sha }}' | |
| name: ${{ env.VERSION }} | |
| tag: ${{ env.VERSION }} | |
| bodyFile: changes.txt | |
| draft: false | |
| prerelease: '${{ env.IS_PRERELEASE }}' | |
| - name: Download Built Artifacts From Jobs | |
| uses: actions/download-artifact@v4 | |
| with: | |
| path: uploads | |
| pattern: built-* | |
| merge-multiple: true | |
| - name: List Files Before Uploading macOS Artifacts | |
| run: | | |
| echo "Listing files in the uploads directory:" | |
| ls -l uploads/ | |
| - name: Upload macOS Intel Artifact | |
| id: upload-macos-intel | |
| uses: shogo82148/actions-upload-release-asset@v1 | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| with: | |
| upload_url: ${{ steps.create_release.outputs.upload_url }} | |
| asset_path: ./uploads/TriOS-MacOS-Intel.zip | |
| asset_name: TriOS-MacOS-Intel.zip | |
| asset_content_type: application/zip | |
| - name: Upload macOS Apple Silicon Artifact | |
| id: upload-macos-arm | |
| uses: shogo82148/actions-upload-release-asset@v1 | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| with: | |
| upload_url: ${{ steps.create_release.outputs.upload_url }} | |
| asset_path: ./uploads/TriOS-MacOS-AppleSilicon.zip | |
| asset_name: TriOS-MacOS-AppleSilicon.zip | |
| asset_content_type: application/zip | |
| - name: List Files Before Uploading Windows Artifact | |
| run: | | |
| echo "Listing files in the current directory:" | |
| ls -l | |
| - name: Upload Windows Artifact | |
| id: upload-windows | |
| uses: shogo82148/actions-upload-release-asset@v1 | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| with: | |
| upload_url: ${{ steps.create_release.outputs.upload_url }} | |
| asset_path: ./uploads/TriOS-Windows.zip | |
| asset_name: TriOS-Windows.zip | |
| asset_content_type: application/zip | |
| - name: List Files Before Uploading Linux Artifact | |
| run: | | |
| echo "Listing files in the current directory:" | |
| ls -l | |
| - name: Upload Linux Artifact | |
| id: upload-linux | |
| uses: shogo82148/actions-upload-release-asset@v1 | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| with: | |
| upload_url: ${{ steps.create_release.outputs.upload_url }} | |
| asset_path: ./uploads/TriOS-Linux.zip | |
| asset_name: TriOS-Linux.zip | |
| asset_content_type: application/zip |