diff --git a/.github/workflows/publish-snap.yaml b/.github/workflows/publish-snap.yaml new file mode 100644 index 00000000..7d33f754 --- /dev/null +++ b/.github/workflows/publish-snap.yaml @@ -0,0 +1,58 @@ +name: Publish Snap Package + +on: + release: + types: [published] + workflow_dispatch: + inputs: + channel: + description: "Snap Store channel" + required: true + default: edge + type: choice + options: + - stable + - candidate + - beta + - edge + # TODO: Add schedule trigger for edge channel. + # schedule: + # - cron: '0 0 * * 1' + +permissions: {} + +concurrency: + group: ${{ github.workflow }} + cancel-in-progress: false + +jobs: + publish: + name: ${{ matrix.name }} + if: github.repository == 'zealdocs/zeal' + runs-on: ${{ matrix.os }} + strategy: + fail-fast: false + matrix: + include: + - name: amd64 + os: ubuntu-latest + - name: arm64 + os: ubuntu-24.04-arm + + steps: + - name: Checkout + uses: actions/checkout@v6 + with: + fetch-depth: 0 + + - name: Build Snap + id: build + uses: snapcore/action-build@v1 + + - name: Publish to Snap Store + uses: snapcore/action-publish@v1 + env: + SNAPCRAFT_STORE_CREDENTIALS: ${{ secrets.SNAPCRAFT_STORE_CREDENTIALS }} + with: + snap: ${{ steps.build.outputs.snap }} + release: ${{ inputs.channel || 'stable' }} diff --git a/.gitignore b/.gitignore index 015ecc01..6076e27b 100644 --- a/.gitignore +++ b/.gitignore @@ -33,6 +33,9 @@ CMakeUserPresets.json # Chocolatey *.nupkg +# Snap +*.snap + # Linux appdata /assets/freedesktop/org.zealdocs.zeal.appdata.xml diff --git a/pkg/snap/snapcraft.yaml b/pkg/snap/snapcraft.yaml new file mode 100644 index 00000000..6aa31833 --- /dev/null +++ b/pkg/snap/snapcraft.yaml @@ -0,0 +1,58 @@ +# https://snapcraft.io/docs +name: zeal +base: core24 +adopt-info: zeal +summary: Offline documentation browser +description: | + Zeal is a simple offline documentation browser inspired by Dash. + It offers access to over 200 docsets covering various APIs and libraries. +title: Zeal +license: GPL-3.0-or-later +contact: https://go.zealdocs.org/l/contact +issues: https://github.com/zealdocs/zeal/issues +source-code: https://github.com/zealdocs/zeal +website: https://zealdocs.org +grade: stable +confinement: strict + +lint: + ignore: + - library: + - usr/lib/**/libicuio.so.* + - usr/lib/**/libicutest.so.* + - usr/lib/**/libicutu.so.* + +apps: + zeal: + command: usr/bin/zeal + extensions: [kde-neon-6] + plugs: + - home + - network + - opengl + - browser-support + environment: + # Chromium's sandbox conflicts with snap's confinement. + QTWEBENGINE_DISABLE_SANDBOX: "1" + +parts: + zeal: + plugin: cmake + source: . + cmake-parameters: + - -DCMAKE_INSTALL_PREFIX=/usr + - -DCMAKE_BUILD_TYPE=Release + build-packages: + - extra-cmake-modules + - libarchive-dev + - libgl1-mesa-dev + - libsqlite3-dev + - libvulkan-dev + - libxcb-keysyms1-dev + stage-packages: + - libarchive13t64 + - libsqlite3-0 + - libxcb-keysyms1 + override-build: | + craftctl default + craftctl set version=$(cat ${CRAFT_PART_BUILD}/zeal_version) diff --git a/snap b/snap new file mode 120000 index 00000000..e873ef81 --- /dev/null +++ b/snap @@ -0,0 +1 @@ +pkg/snap \ No newline at end of file