Private
Public Access
1
0

Compare commits

...

8 Commits

Author SHA1 Message Date
6c3e61e261 gitea: better organization
All checks were successful
GTK RPM Release / build-gtk-rpm-release (push) Successful in 3m22s
2026-04-12 18:31:14 -07:00
78f29907cc [core] rpm release ci workflow 2026-04-12 18:29:01 -07:00
4ab4dc8f16 [core] Trademark 2026-04-12 18:16:57 -07:00
6013f47441 [gtk] fix rpm package version
All checks were successful
GTK RPM Release / build-gtk-rpm-release (push) Successful in 3m30s
2026-04-12 17:48:57 -07:00
89beb3ff2c [gtk] build: manual auth 2026-04-12 17:44:06 -07:00
f9798a41e9 [gtk] update build for Fedora 43 (untested) 2026-04-12 17:41:04 -07:00
2f70440834 [gtk] fix packages auth
Some checks failed
GTK RPM Release / build-gtk-rpm-release (push) Failing after 2m54s
2026-04-12 17:37:47 -07:00
cfeb38cb51 [gtk] gtk build workflow
Some checks failed
GTK RPM Release / build-gtk-rpm-release (push) Failing after 9m17s
2026-04-12 17:18:48 -07:00
11 changed files with 351 additions and 10 deletions

View File

@@ -0,0 +1,61 @@
#!/usr/bin/env bash
set -euo pipefail
: "${RELEASE_TAG:?Missing RELEASE_TAG}"
: "${TAG_PREFIX:?Missing TAG_PREFIX}"
: "${ASSETS_DIR:?Missing ASSETS_DIR}"
: "${RPM_BINARY_DIR:?Missing RPM_BINARY_DIR}"
: "${RPM_BINARY_PATTERN_PREFIX:?Missing RPM_BINARY_PATTERN_PREFIX}"
: "${RPM_DISTRO_NAME:?Missing RPM_DISTRO_NAME}"
: "${RPM_DISTRO_VERSION:?Missing RPM_DISTRO_VERSION}"
: "${GITHUB_ENV:?Missing GITHUB_ENV}"
version="${RELEASE_TAG#${TAG_PREFIX}}"
if [[ -z "$version" || "$version" == "$RELEASE_TAG" ]]; then
echo "Expected tag in the form ${TAG_PREFIX}{version}, got: $RELEASE_TAG" >&2
exit 1
fi
if [[ -n "${EXPECTED_VERSION:-}" && "$EXPECTED_VERSION" != "$version" ]]; then
echo "Release tag version ($version) does not match expected package version ($EXPECTED_VERSION)." >&2
exit 1
fi
rm -rf "$ASSETS_DIR"
mkdir -p "$ASSETS_DIR"
found=0
binary_pattern="${RPM_BINARY_PATTERN_PREFIX}${version}-*.rpm"
if [[ -d "$RPM_BINARY_DIR" ]]; then
find_cmd=(
find "$RPM_BINARY_DIR" -type f -name "$binary_pattern"
)
while IFS= read -r exclude; do
[[ -n "$exclude" ]] || continue
find_cmd+=( ! -name "$exclude" )
done <<< "${RPM_BINARY_EXCLUDE_PATTERNS:-}"
find_cmd+=( -exec cp '{}' "$ASSETS_DIR/" ';' )
"${find_cmd[@]}"
fi
if find "$ASSETS_DIR" -maxdepth 1 -type f -name '*.rpm' | grep -q .; then
found=1
fi
if [[ -n "${RPM_SOURCE_DIR:-}" && -n "${RPM_SOURCE_PATTERN_PREFIX:-}" && -d "$RPM_SOURCE_DIR" ]]; then
source_pattern="${RPM_SOURCE_PATTERN_PREFIX}${version}-*.src.rpm"
find "$RPM_SOURCE_DIR" -type f -name "$source_pattern" -exec cp '{}' "$ASSETS_DIR/" ';'
fi
if [[ "$found" -ne 1 ]]; then
echo "No RPM artifacts were produced." >&2
exit 1
fi
package_group="${RPM_PACKAGE_GROUP:-${RPM_DISTRO_NAME}/${RPM_DISTRO_VERSION}}"
{
printf 'RELEASE_VERSION=%s\n' "$version"
printf 'RELEASE_ASSETS_DIR=%s\n' "$ASSETS_DIR"
printf 'RPM_PACKAGE_GROUP=%s\n' "$package_group"
} >> "$GITHUB_ENV"

View File

@@ -0,0 +1,65 @@
#!/usr/bin/env bash
set -euo pipefail
: "${GITEA_SERVER_URL:?Missing GITEA_SERVER_URL}"
: "${GITEA_REPOSITORY_OWNER:?Missing GITEA_REPOSITORY_OWNER}"
: "${RELEASE_ASSETS_DIR:?Missing RELEASE_ASSETS_DIR}"
owner="${GITEA_REPOSITORY_OWNER}"
package_user="${RPM_PACKAGE_USERNAME:-${GITEA_REPOSITORY_OWNER}}"
token="${RPM_PACKAGE_TOKEN:-}"
group="${RPM_PACKAGE_GROUP:-}"
if [[ -z "$package_user" ]]; then
echo "Missing package upload username. Set repository or organization variable RPM_PACKAGE_USERNAME." >&2
exit 1
fi
if [[ -z "$token" ]]; then
echo "Missing package upload token. Set repository or organization secret RPM_PACKAGE_TOKEN." >&2
exit 1
fi
upload_url="${GITEA_SERVER_URL%/}/api/packages/${owner}/rpm"
if [[ -n "$group" ]]; then
upload_url="${upload_url}/${group}"
fi
upload_url="${upload_url}/upload"
shopt -s nullglob
found_rpm=0
for rpm in "$RELEASE_ASSETS_DIR"/*.rpm; do
case "$rpm" in
*.src.rpm)
continue
;;
esac
found_rpm=1
http_code="$(curl --silent --show-error \
--write-out '%{http_code}' \
--output /tmp/package-upload-response \
--user "${package_user}:${token}" \
--upload-file "$rpm" \
"$upload_url")"
case "$http_code" in
201)
echo "Uploaded $(basename "$rpm") to the RPM package registry."
;;
409)
echo "Package already exists for $(basename "$rpm"); skipping duplicate upload."
;;
*)
echo "Failed to upload $(basename "$rpm") to $upload_url (HTTP $http_code)." >&2
cat /tmp/package-upload-response >&2 || true
exit 1
;;
esac
done
shopt -u nullglob
if [[ "$found_rpm" -ne 1 ]]; then
echo "No binary RPM artifacts were found to upload." >&2
exit 1
fi

View File

@@ -0,0 +1,112 @@
name: Core RPM Release
on:
push:
tags:
- 'release/core/*'
permissions:
code: read
releases: write
packages: write
env:
RPM_DISTRO_NAME: fedora
RPM_DISTRO_VERSION: '43'
jobs:
build-core-rpm-release:
runs-on: ubuntu-latest
container:
image: fedora:43
steps:
# Build inside Fedora so the RPM package repository grouping matches the
# Fedora release we publish to.
- name: Install system dependencies
run: |
set -eu
dnf install -y \
ca-certificates \
curl \
gcc \
gcc-c++ \
git \
make \
nodejs \
openssl-devel \
pkg-config \
python3 \
rpm-build \
sqlite-devel \
dbus-devel \
systemd-devel
dnf clean all
- name: Install Rust toolchain
run: |
set -eu
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y
echo "/root/.cargo/bin" >> "$GITHUB_PATH"
- name: Install cargo-generate-rpm
run: cargo install cargo-generate-rpm
- name: Check out repository code
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Build Core RPM
working-directory: core
run: make rpm
- name: Read Core Package Version
run: |
set -eu
version="$(awk -F ' = ' '
$0 == "[package]" { in_pkg = 1; next }
/^\[/ { in_pkg = 0 }
in_pkg && $1 == "version" {
gsub(/"/, "", $2)
print $2
exit
}
' core/kordophoned/Cargo.toml)"
if [ -z "$version" ]; then
echo "Could not determine kordophoned package version from core/kordophoned/Cargo.toml." >&2
exit 1
fi
printf 'CORE_PACKAGE_VERSION=%s\n' "$version" >> "$GITHUB_ENV"
- name: Prepare release assets
env:
RELEASE_TAG: ${{ github.ref_name }}
TAG_PREFIX: release/core/
ASSETS_DIR: ${{ gitea.workspace }}/release-assets/core
RPM_BINARY_DIR: ${{ gitea.workspace }}/core/target/generate-rpm
RPM_BINARY_PATTERN_PREFIX: kordophoned-
RPM_PACKAGE_GROUP: ${{ vars.RPM_PACKAGE_GROUP }}
RPM_DISTRO_NAME: ${{ env.RPM_DISTRO_NAME }}
RPM_DISTRO_VERSION: ${{ env.RPM_DISTRO_VERSION }}
EXPECTED_VERSION: ${{ env.CORE_PACKAGE_VERSION }}
run: ./.gitea/scripts/prepare-rpm-release-assets.sh
- name: Upload RPMs to Gitea package registry
env:
GITEA_SERVER_URL: ${{ gitea.server_url }}
GITEA_REPOSITORY_OWNER: ${{ gitea.repository_owner }}
RPM_PACKAGE_GROUP: ${{ env.RPM_PACKAGE_GROUP }}
RPM_PACKAGE_TOKEN: ${{ secrets.RPM_PACKAGE_TOKEN }}
RPM_PACKAGE_USERNAME: ${{ vars.RPM_PACKAGE_USERNAME }}
RELEASE_ASSETS_DIR: ${{ env.RELEASE_ASSETS_DIR }}
run: ./.gitea/scripts/upload-rpm-packages.sh
- name: Create Gitea release
uses: https://gitea.com/actions/gitea-release-action@v1
with:
name: Kordophoned Core ${{ env.RELEASE_VERSION }}
tag_name: ${{ github.ref_name }}
target_commitish: ${{ github.sha }}
files: |
${{ env.RELEASE_ASSETS_DIR }}/*.rpm

View File

@@ -0,0 +1,97 @@
name: GTK RPM Release
on:
push:
tags:
- 'release/gtk/*'
permissions:
code: read
releases: write
packages: write
env:
RPM_DISTRO_NAME: fedora
RPM_DISTRO_VERSION: '43'
jobs:
build-gtk-rpm-release:
runs-on: ubuntu-latest
container:
image: fedora:43
steps:
# The default Gitea runner image is Debian-based. Build the GTK RPM in a
# Fedora container so rpmbuild and the RPM build dependencies match the
# existing local packaging environment.
- name: Install system dependencies
run: |
set -eu
dnf install -y \
ca-certificates \
curl \
gcc \
git \
ImageMagick \
libadwaita-devel \
libgee-devel \
libsecret-devel \
make \
meson \
ninja-build \
nodejs \
pkgconfig \
python3 \
redhat-rpm-config \
rpm-build \
rpmdevtools \
gtk4-devel \
glib2-devel \
vala
dnf clean all
rpmdev-setuptree
- name: Check out repository code
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Build GTK RPMs
working-directory: gtk
run: make rpm
- name: Prepare release assets
env:
RELEASE_TAG: ${{ github.ref_name }}
TAG_PREFIX: release/gtk/
ASSETS_DIR: ${{ gitea.workspace }}/release-assets/gtk
RPM_BINARY_DIR: /root/rpmbuild/RPMS
RPM_BINARY_PATTERN_PREFIX: kordophone-
RPM_BINARY_EXCLUDE_PATTERNS: |
*-debuginfo-*
*-debugsource-*
RPM_PACKAGE_GROUP: ${{ vars.RPM_PACKAGE_GROUP }}
RPM_SOURCE_DIR: /root/rpmbuild/SRPMS
RPM_SOURCE_PATTERN_PREFIX: kordophone-
RPM_DISTRO_NAME: ${{ env.RPM_DISTRO_NAME }}
RPM_DISTRO_VERSION: ${{ env.RPM_DISTRO_VERSION }}
run: ./.gitea/scripts/prepare-rpm-release-assets.sh
- name: Upload RPMs to Gitea package registry
env:
GITEA_SERVER_URL: ${{ gitea.server_url }}
GITEA_REPOSITORY_OWNER: ${{ gitea.repository_owner }}
RPM_PACKAGE_GROUP: ${{ env.RPM_PACKAGE_GROUP }}
RPM_PACKAGE_TOKEN: ${{ secrets.RPM_PACKAGE_TOKEN }}
RPM_PACKAGE_USERNAME: ${{ vars.RPM_PACKAGE_USERNAME }}
RELEASE_ASSETS_DIR: ${{ env.RELEASE_ASSETS_DIR }}
run: ./.gitea/scripts/upload-rpm-packages.sh
- name: Create Gitea release
uses: https://gitea.com/actions/gitea-release-action@v1
with:
name: Kordophone GTK ${{ env.RELEASE_VERSION }}
tag_name: ${{ github.ref_name }}
target_commitish: ${{ github.sha }}
files: |
${{ env.RELEASE_ASSETS_DIR }}/*.rpm

1
.gitignore vendored
View File

@@ -1,2 +1,3 @@
.codex
ext/ ext/
target/ target/

View File

@@ -1,4 +1,4 @@
FROM fedora:40 FROM fedora:43
RUN dnf update -y && \ RUN dnf update -y && \
dnf install -y \ dnf install -y \
@@ -23,4 +23,3 @@ WORKDIR /workspace
COPY . . COPY . .
CMD ["make", "rpm"] CMD ["make", "rpm"]

View File

@@ -1,6 +1,6 @@
[package] [package]
name = "kordophoned" name = "kordophoned"
version = "1.3.0" version = "1.3.1"
edition = "2021" edition = "2021"
license = "GPL-3.0" license = "GPL-3.0"
description = "Client daemon for the Kordophone chat protocol" description = "Client daemon for the Kordophone chat protocol"

View File

@@ -1,4 +1,4 @@
FROM fedora:40 FROM fedora:43
# Install RPM build tools and dependencies # Install RPM build tools and dependencies
RUN dnf update -y && dnf install -y \ RUN dnf update -y && dnf install -y \

View File

@@ -5,14 +5,20 @@ all: setup
setup: build/ setup: build/
meson build meson build
VER_RAW := $(shell git -C .. describe --tags --abbrev=0 2>/dev/null || git -C .. describe --tags 2>/dev/null || printf '0.0.0') VER_RAW := $(shell git -C .. describe --tags --match 'release/gtk/*' --abbrev=0 2>/dev/null || true)
VER := $(patsubst v%,%,$(VER_RAW)) VER := $(patsubst release/gtk/%,%,$(VER_RAW))
TMP := $(shell mktemp -d) TMP := $(shell mktemp -d)
rpm: RPM_SOURCE := $(TMP)/$(VER).tar.gz
git -C .. archive --format=tar.gz --prefix=kordophone/ -o $(TMP)/v$(VER).tar.gz HEAD .PHONY: check-version
check-version:
@test -n "$(VER_RAW)" || { echo "Could not determine GTK release version from git tags." >&2; echo "Expected a tag reachable from HEAD matching release/gtk/<version>." >&2; exit 1; }
@test "$(VER)" != "$(VER_RAW)" || { echo "Invalid GTK release tag: $(VER_RAW)" >&2; echo "Expected format: release/gtk/<version>." >&2; exit 1; }
rpm: check-version
git -C .. archive --format=tar.gz --prefix=kordophone/ -o $(RPM_SOURCE) HEAD
rpmbuild -ba dist/rpm/kordophone.spec --define "_sourcedir $(TMP)" --define "app_version $(VER)" rpmbuild -ba dist/rpm/kordophone.spec --define "_sourcedir $(TMP)" --define "app_version $(VER)"
deb: deb: check-version
./dist/deb/build-deb.sh $(VER) ./dist/deb/build-deb.sh $(VER)
.PHONY: flatpak .PHONY: flatpak

View File

@@ -5,7 +5,7 @@ Summary: GTK4/Libadwaita client for Kordophone
License: GPL License: GPL
URL: https://code.buzzert.dev/buzzert/Kordophone URL: https://code.buzzert.dev/buzzert/Kordophone
Source0: %{url}/archive/v%{version}.tar.gz Source0: %{url}/archive/release/gtk/%{version}.tar.gz
BuildRequires: meson >= 0.56.0 BuildRequires: meson >= 0.56.0
BuildRequires: vala BuildRequires: vala