Skip to content
Draft
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
60 changes: 56 additions & 4 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,61 @@ jobs:
append_body: true
body: ${{ steps.sponsors.outputs.body }}

build-deb:
needs: build-binary
runs-on: [self-hosted, Linux, X64, appimage]
permissions:
contents: write

env:
BUILD_TYPE: Release
INSTALL_DIR: ${{ github.workspace }}/install
VERSION: ${{ needs.build-binary.outputs.tag }}

steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
ref: ${{ needs.build-binary.outputs.tag }}

- name: Install nfpm
run: |-
echo 'deb [trusted=yes] https://repo.goreleaser.com/apt/ /' | sudo tee /etc/apt/sources.list.d/goreleaser.list
sudo apt-get update -y
sudo apt-get install nfpm

- name: Prepare dirs
run: mkdir -p build install

- name: Configure CMake
run: |
cd build
cmake -G Ninja .. \
-DCMAKE_BUILD_TYPE=${BUILD_TYPE} \
-DCMAKE_POLICY_VERSION_MINIMUM=3.5 \
-DCMAKE_INSTALL_PREFIX="${INSTALL_DIR}" \
-DVICINAE_PROVENANCE=deb \
-DLTO=ON

- name: Build
run: |
cmake --build build --config ${BUILD_TYPE} --parallel $(nproc)

- name: Install
run: |
cmake --install build

- name: Make Deb Package
run: ./scripts/mkdeb.sh

- name: Upload AppImage to GitHub Release
uses: softprops/action-gh-release@v2
with:
tag_name: ${{ needs.build-binary.outputs.tag }}
name: ${{ needs.build-binary.outputs.tag }}
files: |
*.deb

build-appimage:
needs: build-binary
Expand Down Expand Up @@ -185,9 +240,7 @@ jobs:
cmake --install build

- name: Make AppImage
run: |
chmod +x ./scripts/mkappimage.sh
./scripts/mkappimage.sh "${INSTALL_DIR}" "${APP_DIR}"
run: ./scripts/mkappimage.sh "${INSTALL_DIR}" "${APP_DIR}"

- name: Upload AppImage to GitHub Release
uses: softprops/action-gh-release@v2
Expand All @@ -196,4 +249,3 @@ jobs:
name: ${{ needs.build-binary.outputs.tag }}
files: |
*.AppImage

39 changes: 39 additions & 0 deletions nfpm.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
name: vicinae
arch: ${GOARCH}
platform: ${GOOS}
version: ${VERSION}
maintainer: "Aurelien Brabant <gh@aurelle.dev>"
homepage: https://github.com/vicinaehq/vicinae
license: GPL-3.0
depends:
- layer-shell-qt
- protobuf-compiler
- libqt6concurrent6
- libqt6sql6-sqlite
- cmark
- cmark-gfm
- qml6-module-qtquick-dialogs
- minizip
- nodejs
- npm
contents:
- src: build/bin/vicinae
dst: /usr/bin/vicinae
- src: build/bin/vicinae-*
dst: /usr/libexec/vicinae/

- src: extra/vicinae.desktop
dst: /usr/share/applications/vicinae.desktop
- src: extra/vicinae-url-handler.desktop
dst: /usr/share/applications/vicinae-url-handler.desktop
- src: extra/vicinae.service
dst: /etc/systemd/system/vicinae.service
- src: extra/vicinae.png
dst: /usr/share/icons/hicolor/512x512/apps/vicinae.png
- src: extra/udev/rules.d/70-vicinae.rules
dst: /lib/udev/rules.d/70-vicinae.rules
- src: extra/modules-load.d/vicinae.conf
dst: /lib/modules-load.d/70-vicinae.rules

- src: extra/themes
dst: /usr/share/vicinae/themes
33 changes: 33 additions & 0 deletions scripts/mkdeb.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
#!/usr/bin/env bash
#
# Builds debian packages, assumes binaries have already been built.

set -euo pipefail

VERSION="${VERSION:-""}"
if [[ -z "$VERSION" ]]; then
echo "Error: Missing env var VERSION" >&2
exit 1
fi

VERSION="${VERSION/v/}"

BUILD_DIR="$(pwd)/build"
INSTALL_DIR="$(pwd)/install"
if [[ ! -e "$INSTALL_DIR" ]]; then
echo "Error: INSTALL_DIR \"$INSTALL_DIR\" could not be found" \
"(was vicinae built?)" >&2
exit 1
elif [[ ! -d "$BUILD_DIR" ]]; then
echo "Error: BUILD_DIR \"$BUILD_DIR\" could not be found" \
"(was vicinae built?)" >&2
exit 1
fi

if ! command -v nfpm &>/dev/null; then
echo "Error: nfpm is missing, please install it:" >&2
echo " https://nfpm.goreleaser.com/docs/install/" >&2
exit 1
fi

exec nfpm package -p deb
Empty file modified scripts/refactor.sh
100644 → 100755
Empty file.