Use versioned app releases for binary package
All checks were successful
Release App / release-app (push) Successful in 1m31s

This commit is contained in:
2026-04-24 15:00:42 +03:00
parent 5a5677a994
commit 891fc73e25
3 changed files with 29 additions and 13 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: