Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 7 additions & 3 deletions .github/workflows/cloudron.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ on:

jobs:
build:
runs-on: ubuntu-latest
runs-on: self-hosted
permissions:
contents: read
packages: write
Expand All @@ -49,6 +49,8 @@ jobs:
echo "push=$PUSH"
} >> "$GITHUB_OUTPUT"

# Cloudron runs amd64 images; an Apple silicon runner builds them under QEMU
- uses: docker/setup-qemu-action@v3
- uses: docker/setup-buildx-action@v3

- if: steps.meta.outputs.push == 'true'
Expand All @@ -62,10 +64,12 @@ jobs:
with:
context: .
file: Dockerfile.cloudron
platforms: linux/amd64
push: ${{ steps.meta.outputs.push == 'true' }}
tags: ${{ steps.meta.outputs.tags }}
cache-from: type=gha
cache-to: type=gha,mode=max
# GitHub's cache only on GitHub's runners: uploading layers from a home connection takes longer than building
cache-from: ${{ runner.environment == 'github-hosted' && 'type=gha' || '' }}
cache-to: ${{ runner.environment == 'github-hosted' && 'type=gha,mode=max' || '' }}

- name: Summary
if: steps.meta.outputs.push == 'true'
Expand Down
14 changes: 10 additions & 4 deletions .github/workflows/qnap.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,10 @@ jobs:
matrix:
include:
- arch: x86_64
runner: ubuntu-latest
# Built under QEMU unless the repository variable QNAP_ARM_RUNNER names an ARM runner (ubuntu-24.04-arm)
runner: self-hosted
# The repository variable QNAP_ARM_RUNNER can name another runner for it; on an x86 one it builds under QEMU
- arch: arm_64
runner: ${{ vars.QNAP_ARM_RUNNER || 'ubuntu-latest' }}
runner: ${{ vars.QNAP_ARM_RUNNER || 'self-hosted' }}
runs-on: ${{ matrix.runner }}
timeout-minutes: 300
env:
Expand All @@ -41,7 +41,9 @@ jobs:
with:
ref: ${{ env.TAG }}

# Only on GitHub's runners: on a self-hosted one these would ask for a password, and prune its owner's images
- name: Make room for the images
if: runner.environment == 'github-hosted'
run: |
sudo rm -rf /usr/share/dotnet /usr/local/lib/android /opt/ghc /opt/hostedtoolcache/CodeQL
docker system prune -af >/dev/null
Expand All @@ -62,6 +64,10 @@ jobs:
ls -lh packaging/qnap/build/
# GitHub release assets are limited to 2 GiB each
for f in packaging/qnap/build/*.qpkg; do
[ "$(stat -c %s "$f")" -lt 2147483648 ] || { echo "::error::$f is over 2 GiB, too big for a release asset"; exit 1; }
[ "$(wc -c < "$f")" -lt 2147483648 ] || { echo "::error::$f is over 2 GiB, too big for a release asset"; exit 1; }
done
gh release upload "$TAG" packaging/qnap/build/*.qpkg packaging/qnap/build/*.qpkg.md5 --clobber

- name: Remove the images it built
if: always()
run: docker image rm "lens-backend:qnap-${TAG#v}" "lens-frontend:qnap-${TAG#v}" 2>/dev/null || true
7 changes: 5 additions & 2 deletions .github/workflows/synology.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ on:
jobs:
spk:
name: SPK (${{ matrix.arch }})
runs-on: ubuntu-latest
runs-on: self-hosted
permissions:
contents: write # to attach the packages to the release
strategy:
Expand All @@ -33,8 +33,8 @@ jobs:
- uses: actions/checkout@v4
with:
ref: ${{ inputs.tag || github.ref }}
# the architecture that isn't the runner's own (armv8 on GitHub's runners, x86_64 on an Apple silicon Mac)
- uses: docker/setup-qemu-action@v3
if: matrix.arch == 'armv8'
- uses: docker/setup-buildx-action@v3
with:
driver: docker
Expand All @@ -57,3 +57,6 @@ jobs:
GH_TOKEN: ${{ github.token }}
TAG: ${{ github.event.release.tag_name || inputs.tag }}
run: gh release upload "$TAG" dist/synology/*.spk --clobber --repo "${{ github.repository }}"
- name: Remove the images it built
if: always()
run: docker image prune -af --filter label=net.lens.package=synology >/dev/null
5 changes: 4 additions & 1 deletion packaging/synology/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
#
# Needs Docker with buildx. Writes dist/synology/lens-<version>-<arch>.spk.
set -eu
export COPYFILE_DISABLE=1 # macOS tar: no ._ resource-fork files in the package

HERE=$(cd "$(dirname "$0")" && pwd)
ROOT=$(cd "$HERE/../.." && pwd)
Expand Down Expand Up @@ -64,7 +65,9 @@ chmod 755 "$WORK/spk/scripts/"*
cp "$HERE/icons/lens_64.png" "$WORK/spk/PACKAGE_ICON.PNG"
cp "$HERE/icons/lens_256.png" "$WORK/spk/PACKAGE_ICON_256.PNG"
sed -e "s/@VERSION@/$VERSION/" -e "s/@ARCH@/$ARCH/" "$HERE/INFO.in" > "$WORK/spk/INFO"
echo "checksum=\"$(md5sum "$WORK/spk/package.tgz" | cut -d' ' -f1)\"" >> "$WORK/spk/INFO"
# md5sum on Linux, md5 on macOS
SUM=$( (md5sum "$WORK/spk/package.tgz" 2>/dev/null || md5 -r "$WORK/spk/package.tgz") | cut -d' ' -f1)
echo "checksum=\"$SUM\"" >> "$WORK/spk/INFO"
echo "extractsize=\"$(du -sk "$WORK/package" | cut -f1)\"" >> "$WORK/spk/INFO"

SPK=$OUT/lens-$VERSION-$ARCH.spk
Expand Down
Loading