Skip to content

Commit f3670b3

Browse files
committed
fix(ci): skip gh-pages apt publish when deb exceeds 100mb
1 parent 37ec1e9 commit f3670b3

1 file changed

Lines changed: 25 additions & 0 deletions

File tree

.github/workflows/release.yml

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,23 @@ jobs:
5858
dist/*.deb
5959
dist/*.AppImage
6060
61+
- name: Check DEB size for gh-pages
62+
id: deb_size
63+
run: |
64+
set -euo pipefail
65+
LIMIT_BYTES=$((100 * 1024 * 1024))
66+
DEB_FILE="$(ls -1 dist/*.deb | head -n 1)"
67+
DEB_SIZE_BYTES="$(stat -c%s "${DEB_FILE}")"
68+
echo "deb_file=${DEB_FILE}" >> "${GITHUB_OUTPUT}"
69+
echo "deb_size_bytes=${DEB_SIZE_BYTES}" >> "${GITHUB_OUTPUT}"
70+
if [[ "${DEB_SIZE_BYTES}" -lt "${LIMIT_BYTES}" ]]; then
71+
echo "publish_apt=true" >> "${GITHUB_OUTPUT}"
72+
else
73+
echo "publish_apt=false" >> "${GITHUB_OUTPUT}"
74+
fi
75+
6176
- name: Build APT repository files
77+
if: steps.deb_size.outputs.publish_apt == 'true'
6278
run: |
6379
mkdir -p apt-public
6480
cp dist/*.deb apt-public/
@@ -85,7 +101,16 @@ jobs:
85101
</html>
86102
EOF
87103
104+
- name: Skip APT publish (DEB exceeds GitHub 100MB file limit)
105+
if: steps.deb_size.outputs.publish_apt != 'true'
106+
run: |
107+
echo "Skipping gh-pages APT publish."
108+
echo "DEB file: ${{ steps.deb_size.outputs.deb_file }}"
109+
echo "Size bytes: ${{ steps.deb_size.outputs.deb_size_bytes }}"
110+
echo "Reason: GitHub blocks files >= 100MB on git pushes (gh-pages branch)."
111+
88112
- name: Publish APT repo to gh-pages
113+
if: steps.deb_size.outputs.publish_apt == 'true'
89114
uses: peaceiris/actions-gh-pages@v4
90115
with:
91116
github_token: ${{ secrets.GITHUB_TOKEN }}

0 commit comments

Comments
 (0)