3 Commits

Author SHA1 Message Date
1a5e32a580 Restore TDLib workflow assets
All checks were successful
Release App / release-app (push) Successful in 1m42s
2026-04-24 15:06:21 +03:00
2e79f2b00b Fix update notice for versioned releases
Some checks failed
Release App / release-app (push) Has been cancelled
2026-04-24 15:06:07 +03:00
891fc73e25 Use versioned app releases for binary package
All checks were successful
Release App / release-app (push) Successful in 1m31s
2026-04-24 15:00:42 +03:00
5 changed files with 43 additions and 14 deletions

View File

@@ -13,7 +13,6 @@ jobs:
release-app:
runs-on: ubuntu-latest
env:
RELEASE_TAG: latest
ARCHIVE_NAME: shinoa-linux-x86_64.tar.gz
CHECKSUM_NAME: shinoa-linux-x86_64.tar.gz.sha256
TDLIB_RELEASE_TAG: v1.8.63
@@ -46,6 +45,20 @@ jobs:
pkg-config \
zlib1g-dev
- name: Resolve app version
id: app_version
run: |
set -euo pipefail
version="$(sed -n 's/^project(shinoa VERSION \([^ ]*\) LANGUAGES CXX)$/\1/p' CMakeLists.txt)"
if [ -z "$version" ]; then
echo "Failed to resolve app version from CMakeLists.txt" >&2
exit 1
fi
{
echo "version=$version"
echo "release_tag=v$version"
} >> "$GITHUB_OUTPUT"
- name: Download prebuilt TDLib
run: |
set -euo pipefail
@@ -88,18 +101,20 @@ jobs:
set -euo pipefail
api="${{ gitea.server_url }}/api/v1/repos/${{ gitea.repository }}"
commit_sha="${{ github.sha }}"
release_tag="${{ steps.app_version.outputs.release_tag }}"
version="${{ steps.app_version.outputs.version }}"
release_json="$(mktemp)"
body_file="$(mktemp)"
cat > "$body_file" <<EOF
Automated rolling release for commit \`${commit_sha}\`.
Release ${version} for commit \`${commit_sha}\`.
EOF
status="$(curl --silent --show-error \
--output "$release_json" \
--write-out "%{http_code}" \
-H "Authorization: token ${GITEA_TOKEN}" \
"$api/releases/tags/$RELEASE_TAG")"
"$api/releases/tags/$release_tag")"
if [ "$status" = "200" ]; then
release_id="$(jq -r '.id' "$release_json")"
@@ -113,7 +128,7 @@ jobs:
curl --fail-with-body \
-H "Authorization: token ${GITEA_TOKEN}" \
-X DELETE \
"$api/releases/tags/$RELEASE_TAG"
"$api/releases/tags/$release_tag"
elif [ "$status" != "404" ]; then
echo "Failed to query release, HTTP $status" >&2
cat "$release_json" >&2
@@ -125,11 +140,11 @@ jobs:
--write-out "%{http_code}" \
-H "Authorization: token ${GITEA_TOKEN}" \
-X DELETE \
"$api/tags/$RELEASE_TAG")"
"$api/tags/$release_tag")"
case "$status" in
204|404) ;;
*)
echo "Failed to delete tag $RELEASE_TAG, HTTP $status" >&2
echo "Failed to delete tag $release_tag, HTTP $status" >&2
exit 1
;;
esac
@@ -143,9 +158,9 @@ jobs:
{
"body": $(jq -Rs . < "$body_file"),
"draft": false,
"name": "latest",
"prerelease": true,
"tag_name": "$RELEASE_TAG",
"name": "v${version}",
"prerelease": false,
"tag_name": "$release_tag",
"target_commitish": "$commit_sha"
}
EOF

View File

@@ -1,15 +1,16 @@
pkgname=shinoa-bin
pkgver=latest
pkgver=0.1.0
pkgrel=1
pkgdesc='Minimal Telegram terminal client built with ncurses and bundled TDLib'
arch=('x86_64')
url='https://git.mshq.dev/AxiFisk/shinoa'
license=('custom:unknown')
depends=('gcc-libs' 'glibc' 'ncurses' 'openssl' 'zlib')
options=(!debug)
provides=('shinoa')
conflicts=('shinoa')
source=(
"shinoa-linux-x86_64.tar.gz::${url}/releases/download/latest/shinoa-linux-x86_64.tar.gz"
"shinoa-linux-x86_64.tar.gz::${url}/releases/download/v${pkgver}/shinoa-linux-x86_64.tar.gz"
)
sha256sums=('SKIP')

View File

@@ -69,9 +69,9 @@ It also refreshes a `latest/tdlib-latest.json` manifest with the newest publishe
The repository also includes [`.gitea/workflows/release-app.yaml`](.gitea/workflows/release-app.yaml),
which downloads a prebuilt TDLib bundle from the `shinoa-tdlib` repository using a pinned
version tag such as `v1.8.63`, builds a
rolling `latest` app release, and publishes an archive containing `usr/bin/shinoa` plus the
versioned app release tag such as `v0.1.0`, and publishes an archive containing `usr/bin/shinoa` plus the
bundled `usr/lib/libtdjson.so*`. The root `PKGBUILD` installs that prebuilt release as
`shinoa-bin`. That workflow expects Gitea secrets named `TELEGRAM_API_ID` and
`shinoa-bin`. The package disables debug splitting with `options=(!debug)`. That workflow expects Gitea secrets named `TELEGRAM_API_ID` and
`TELEGRAM_API_HASH`. Release builds are configured to fail if those secrets are missing.
To prepare the TDLib bundle on your own machine:

View File

@@ -13,6 +13,13 @@ namespace telegram_tui {
namespace {
std::string trim_release_tag_prefix(const std::string &value) {
if (!value.empty() && (value[0] == 'v' || value[0] == 'V')) {
return value.substr(1);
}
return value;
}
bool is_truthy_env_value(const std::string &value) {
return value == "1" || value == "true" || value == "TRUE" || value == "yes" ||
value == "YES" || value == "on" || value == "ON";
@@ -50,7 +57,7 @@ std::string run_command_capture(const std::string &command) {
std::optional<std::string> fetch_update_notice() {
static constexpr const char *kLatestReleaseApiUrl =
"https://git.mshq.dev/api/v1/repos/AxiFisk/shinoa/releases/tags/latest";
"https://git.mshq.dev/api/v1/repos/AxiFisk/shinoa/releases/latest";
if (std::string(TELEGRAM_TUI_BUILD_COMMIT).empty()) {
return std::nullopt;
@@ -64,6 +71,11 @@ std::optional<std::string> fetch_update_notice() {
try {
const json release = json::parse(response, nullptr, true, true);
const std::string latest_tag = trim_release_tag_prefix(safe_string(release, "tag_name"));
if (!latest_tag.empty() && latest_tag == TELEGRAM_TUI_PROJECT_VERSION) {
return std::nullopt;
}
const std::string target_commit = safe_string(release, "target_commitish");
if (target_commit.empty()) {
return std::nullopt;

View File

@@ -1,5 +1,6 @@
#pragma once
#define TELEGRAM_TUI_PROJECT_VERSION "@PROJECT_VERSION@"
#define TELEGRAM_TUI_BUILD_COMMIT "@TELEGRAM_TUI_BUILD_COMMIT@"
#define TELEGRAM_TUI_BUILD_VERSION "@TELEGRAM_TUI_BUILD_VERSION@"
#define TELEGRAM_TUI_BUILD_API_ID "@TELEGRAM_TUI_BUILD_API_ID@"