Use versioned app releases for binary package
All checks were successful
Release App / release-app (push) Successful in 1m31s
All checks were successful
Release App / release-app (push) Successful in 1m31s
This commit is contained in:
@@ -13,7 +13,6 @@ jobs:
|
|||||||
release-app:
|
release-app:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
env:
|
env:
|
||||||
RELEASE_TAG: latest
|
|
||||||
ARCHIVE_NAME: shinoa-linux-x86_64.tar.gz
|
ARCHIVE_NAME: shinoa-linux-x86_64.tar.gz
|
||||||
CHECKSUM_NAME: shinoa-linux-x86_64.tar.gz.sha256
|
CHECKSUM_NAME: shinoa-linux-x86_64.tar.gz.sha256
|
||||||
TDLIB_RELEASE_TAG: v1.8.63
|
TDLIB_RELEASE_TAG: v1.8.63
|
||||||
@@ -46,6 +45,20 @@ jobs:
|
|||||||
pkg-config \
|
pkg-config \
|
||||||
zlib1g-dev
|
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
|
- name: Download prebuilt TDLib
|
||||||
run: |
|
run: |
|
||||||
set -euo pipefail
|
set -euo pipefail
|
||||||
@@ -88,18 +101,20 @@ jobs:
|
|||||||
set -euo pipefail
|
set -euo pipefail
|
||||||
api="${{ gitea.server_url }}/api/v1/repos/${{ gitea.repository }}"
|
api="${{ gitea.server_url }}/api/v1/repos/${{ gitea.repository }}"
|
||||||
commit_sha="${{ github.sha }}"
|
commit_sha="${{ github.sha }}"
|
||||||
|
release_tag="${{ steps.app_version.outputs.release_tag }}"
|
||||||
|
version="${{ steps.app_version.outputs.version }}"
|
||||||
release_json="$(mktemp)"
|
release_json="$(mktemp)"
|
||||||
body_file="$(mktemp)"
|
body_file="$(mktemp)"
|
||||||
|
|
||||||
cat > "$body_file" <<EOF
|
cat > "$body_file" <<EOF
|
||||||
Automated rolling release for commit \`${commit_sha}\`.
|
Release ${version} for commit \`${commit_sha}\`.
|
||||||
EOF
|
EOF
|
||||||
|
|
||||||
status="$(curl --silent --show-error \
|
status="$(curl --silent --show-error \
|
||||||
--output "$release_json" \
|
--output "$release_json" \
|
||||||
--write-out "%{http_code}" \
|
--write-out "%{http_code}" \
|
||||||
-H "Authorization: token ${GITEA_TOKEN}" \
|
-H "Authorization: token ${GITEA_TOKEN}" \
|
||||||
"$api/releases/tags/$RELEASE_TAG")"
|
"$api/releases/tags/$release_tag")"
|
||||||
|
|
||||||
if [ "$status" = "200" ]; then
|
if [ "$status" = "200" ]; then
|
||||||
release_id="$(jq -r '.id' "$release_json")"
|
release_id="$(jq -r '.id' "$release_json")"
|
||||||
@@ -113,7 +128,7 @@ jobs:
|
|||||||
curl --fail-with-body \
|
curl --fail-with-body \
|
||||||
-H "Authorization: token ${GITEA_TOKEN}" \
|
-H "Authorization: token ${GITEA_TOKEN}" \
|
||||||
-X DELETE \
|
-X DELETE \
|
||||||
"$api/releases/tags/$RELEASE_TAG"
|
"$api/releases/tags/$release_tag"
|
||||||
elif [ "$status" != "404" ]; then
|
elif [ "$status" != "404" ]; then
|
||||||
echo "Failed to query release, HTTP $status" >&2
|
echo "Failed to query release, HTTP $status" >&2
|
||||||
cat "$release_json" >&2
|
cat "$release_json" >&2
|
||||||
@@ -125,11 +140,11 @@ jobs:
|
|||||||
--write-out "%{http_code}" \
|
--write-out "%{http_code}" \
|
||||||
-H "Authorization: token ${GITEA_TOKEN}" \
|
-H "Authorization: token ${GITEA_TOKEN}" \
|
||||||
-X DELETE \
|
-X DELETE \
|
||||||
"$api/tags/$RELEASE_TAG")"
|
"$api/tags/$release_tag")"
|
||||||
case "$status" in
|
case "$status" in
|
||||||
204|404) ;;
|
204|404) ;;
|
||||||
*)
|
*)
|
||||||
echo "Failed to delete tag $RELEASE_TAG, HTTP $status" >&2
|
echo "Failed to delete tag $release_tag, HTTP $status" >&2
|
||||||
exit 1
|
exit 1
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
@@ -143,9 +158,9 @@ jobs:
|
|||||||
{
|
{
|
||||||
"body": $(jq -Rs . < "$body_file"),
|
"body": $(jq -Rs . < "$body_file"),
|
||||||
"draft": false,
|
"draft": false,
|
||||||
"name": "latest",
|
"name": "v${version}",
|
||||||
"prerelease": true,
|
"prerelease": false,
|
||||||
"tag_name": "$RELEASE_TAG",
|
"tag_name": "$release_tag",
|
||||||
"target_commitish": "$commit_sha"
|
"target_commitish": "$commit_sha"
|
||||||
}
|
}
|
||||||
EOF
|
EOF
|
||||||
|
|||||||
5
PKGBUILD
5
PKGBUILD
@@ -1,15 +1,16 @@
|
|||||||
pkgname=shinoa-bin
|
pkgname=shinoa-bin
|
||||||
pkgver=latest
|
pkgver=0.1.0
|
||||||
pkgrel=1
|
pkgrel=1
|
||||||
pkgdesc='Minimal Telegram terminal client built with ncurses and bundled TDLib'
|
pkgdesc='Minimal Telegram terminal client built with ncurses and bundled TDLib'
|
||||||
arch=('x86_64')
|
arch=('x86_64')
|
||||||
url='https://git.mshq.dev/AxiFisk/shinoa'
|
url='https://git.mshq.dev/AxiFisk/shinoa'
|
||||||
license=('custom:unknown')
|
license=('custom:unknown')
|
||||||
depends=('gcc-libs' 'glibc' 'ncurses' 'openssl' 'zlib')
|
depends=('gcc-libs' 'glibc' 'ncurses' 'openssl' 'zlib')
|
||||||
|
options=(!debug)
|
||||||
provides=('shinoa')
|
provides=('shinoa')
|
||||||
conflicts=('shinoa')
|
conflicts=('shinoa')
|
||||||
source=(
|
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')
|
sha256sums=('SKIP')
|
||||||
|
|
||||||
|
|||||||
@@ -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),
|
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
|
which downloads a prebuilt TDLib bundle from the `shinoa-tdlib` repository using a pinned
|
||||||
version tag such as `v1.8.63`, builds a
|
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
|
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.
|
`TELEGRAM_API_HASH`. Release builds are configured to fail if those secrets are missing.
|
||||||
|
|
||||||
To prepare the TDLib bundle on your own machine:
|
To prepare the TDLib bundle on your own machine:
|
||||||
|
|||||||
Reference in New Issue
Block a user