Upload a github release using github actions (file size above 2GB)

I have a CI/CD workflow on GitHub Actions.

The pipeline performs tests and builds, and it should upload a release file if a tag was created.

However, there’s a problem: the size of the release.zip is 3.5GB (after the build process), and as it’s well-known, each file in GitHub Releases must be 2GB or less. The main reason for this large size is one file which is 3.3GB. This file must be available locally on every machine that installs the application.

Here are some details about the app:

  • It’s a Python application for Windows desktop.

  • The build process uses the PyInstaller library.

  • The build process includes the problematic file to be built into the app.

  • There is no server or cloud the app is connected to.

  • The problematic file was originally about 9GB, and after compression, its size is 3.3GB.

  • The problematic file is stored with LFS.

Here is the relevant job from the workflow:

  build:
    needs: test
    runs-on: windows-latest

    steps:
      # Checkout
      - uses: actions/checkout@v4
        with:
          lfs: true

      # LFS
      - name: Install Git LFS
        run: |
          choco install git-lfs

      - name: Pull lfs files
        run: |
          git lfs pull

      # Python install
      - name: Set up Python 3.10
        uses: actions/setup-python@v3
        with:
          python-version: "3.10"

      # PyInstaller build
      - name: Build
        run: |
          cd ..
          mkdir build
          cd build
          python -m pip install --upgrade pip
          pip install pyinstaller
          python -m pip install -r ..requirements.txt
          pyinstaller ..prod.spec
          xcopy /E /I .distgui ..gui
          cd ..
          dir

      # Release
      - name: Extract Tag Name
        id: extract_tag_name
        run: |
          $tagName = $Env:GITHUB_REF -replace 'refs/tags/', ''
          Write-Host "::set-output name=tag_name::$tagName"

      # Zip the output folder
      - name: Zip folder
        if: steps.extract_tag_name.outputs.tag_name != null && steps.extract_tag_name.outputs.tag_name != 'refs/heads/main'
        run: |
          7z a -r release.zip ./gui/

      - name: Create Release
        if: steps.extract_tag_name.outputs.tag_name != null && steps.extract_tag_name.outputs.tag_name != 'refs/heads/main'
        id: create_release
        uses: actions/create-release@v1
        with:
          tag_name: ${{ steps.extract_tag_name.outputs.tag_name }}
          release_name: Release ${{ steps.extract_tag_name.outputs.tag_name }}
          body: Release ${{ steps.extract_tag_name.outputs.tag_name }} created automatically by GitHub Actions.
          token: ${{ secrets.ACTION_RELEASE }}
          draft: false
          prerelease: false
        env:
          GITHUB_TOKEN: ${{ secrets.ACTION_RELEASE }}

      - name: Upload Release Assets
        if: steps.extract_tag_name.outputs.tag_name != null && steps.extract_tag_name.outputs.tag_name != 'refs/heads/main'
        id: upload_asset
        uses: actions/upload-release-asset@v1
        with:
          upload_url: ${{ steps.create_release.outputs.upload_url }}
          asset_path: ./release.zip
          asset_name: release.zip
          asset_content_type: application/zip
        env:
          GITHUB_TOKEN: ${{ secrets.ACTION_RELEASE }}

Several solutions have been attempted, but none have resolved the problem:

  • GitHub LFS: Attempted to upload the release.zip to LFS during workflow runtime. However, this approach was unsuccessful as it failed to push. Additionally, there are concerns about the feasibility of pushing LFS during the workflow.

  • Splitting the zip: Tried to split the zip file into partial zip files. Unfortunately, this failed during the workflow due to the actions/upload-release-asset@v1 not supporting multiple files. Moreover, attempting to split files in this manner on my local machine resulted in corrupted files.

  • Maximum compression: Utilized the zip -mx9 option for maximum compression, but this did not alleviate the issue. The output zip file still exceeded 3GB.

New contributor

user25541605 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.

Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa Dịch vụ tổ chức sự kiện 5 sao Thông tin về chúng tôi Dịch vụ sinh nhật bé trai Dịch vụ sinh nhật bé gái Sự kiện trọn gói Các tiết mục giải trí Dịch vụ bổ trợ Tiệc cưới sang trọng Dịch vụ khai trương Tư vấn tổ chức sự kiện Hình ảnh sự kiện Cập nhật tin tức Liên hệ ngay Thuê chú hề chuyên nghiệp Tiệc tất niên cho công ty Trang trí tiệc cuối năm Tiệc tất niên độc đáo Sinh nhật bé Hải Đăng Sinh nhật đáng yêu bé Khánh Vân Sinh nhật sang trọng Bích Ngân Tiệc sinh nhật bé Thanh Trang Dịch vụ ông già Noel Xiếc thú vui nhộn Biểu diễn xiếc quay đĩa Dịch vụ tổ chức tiệc uy tín Khám phá dịch vụ của chúng tôi Tiệc sinh nhật cho bé trai Trang trí tiệc cho bé gái Gói sự kiện chuyên nghiệp Chương trình giải trí hấp dẫn Dịch vụ hỗ trợ sự kiện Trang trí tiệc cưới đẹp Khởi đầu thành công với khai trương Chuyên gia tư vấn sự kiện Xem ảnh các sự kiện đẹp Tin mới về sự kiện Kết nối với đội ngũ chuyên gia Chú hề vui nhộn cho tiệc sinh nhật Ý tưởng tiệc cuối năm Tất niên độc đáo Trang trí tiệc hiện đại Tổ chức sinh nhật cho Hải Đăng Sinh nhật độc quyền Khánh Vân Phong cách tiệc Bích Ngân Trang trí tiệc bé Thanh Trang Thuê dịch vụ ông già Noel chuyên nghiệp Xem xiếc khỉ đặc sắc Xiếc quay đĩa thú vị
Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa
Thiết kế website Thiết kế website Thiết kế website Cách kháng tài khoản quảng cáo Mua bán Fanpage Facebook Dịch vụ SEO Tổ chức sinh nhật