Repository navigation
73 lines (64 loc) · 2.58 KB
/
Copy pathqnap.yml
File metadata and controls
73 lines (64 loc) · 2.58 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
name: QNAP packages
# Builds the Lens QPKGs (packaging/qnap) for Intel/AMD and ARM NAS and attaches them to the release.
# Runs when a release is published (release.yml makes the draft; publishing it starts this), or by hand for a tag.
on:
release:
types: [published]
workflow_dispatch:
inputs:
tag:
description: "Release tag to build and attach the packages to"
required: true
type: string
permissions:
contents: write
concurrency:
group: qnap-${{ github.event.release.tag_name || inputs.tag }}
cancel-in-progress: false
jobs:
qpkg:
name: QPKG ${{ matrix.arch }}
strategy:
fail-fast: false
matrix:
include:
- arch: x86_64
runner: ${{ fromJSON(vars.CI_RUNNER || '"ubuntu-latest"') }}
# On the x64 runner under QEMU, unless the repository variable QNAP_ARM_RUNNER names another runner label
- arch: arm_64
runner: ${{ vars.QNAP_ARM_RUNNER || fromJSON(vars.CI_RUNNER || '"ubuntu-latest"') }}
runs-on: ${{ matrix.runner }}
timeout-minutes: 300
env:
TAG: ${{ github.event.release.tag_name || inputs.tag }}
GH_TOKEN: ${{ github.token }}
steps:
- uses: actions/checkout@v7
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
df -h /
- uses: docker/setup-qemu-action@v4
- uses: docker/setup-buildx-action@v4
with:
driver: docker # images go straight into the local Docker, where build.sh saves them from
- name: Build the package
run: |
version="${TAG#v}"
packaging/qnap/build.sh --arch "${{ matrix.arch }}" --version "$version"
- name: Attach to the release
run: |
ls -lh packaging/qnap/build/
# GitHub release assets are limited to 2 GiB each
for f in packaging/qnap/build/*.qpkg; do
[ "$(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