mirror of
https://github.com/langbot-app/LangBot.git
synced 2026-09-16 23:07:14 +00:00
60bb67f025
* feat(packaging): add fnOS FPK packaging and CI workflow Add packaging/fnos/ shell (manifest, lifecycle cmd scripts, install/ upgrade/uninstall wizards, desktop entry, EULA) plus in-repo build script. A release now auto-builds langbot-<tag>-fnos.fpk via .github/workflows/build-fnos-fpk.yaml, uploaded to the release assets. * ci(fnos): skip release upload on manual dispatch github.event.release.tag_name is empty when triggered via workflow_dispatch, causing 'gh release upload' to fail with 'requires at least 2 arg(s)'. Restrict the step to release events. * ci(fnos): normalize release asset name Strip a trailing -fnos from the tag-derived version before appending the suffix, avoiding langbot-<v>-fnos-fnos.fpk when the tag itself already carries -fnos. * ci(fnos): use release tag version for auto build, manifest for manual Auto build (release/tag) reads version from tag like other release workflows; build.sh strips the v prefix when injecting into manifest. Manual dispatch falls back to the version maintained in manifest. * feat(fnos): add post-install deployment notice to install wizard Last wizard step now informs users that first startup takes about 5-10 minutes for dependency setup before the web UI is ready. * docs(fnos): add packaging directory README * refactor(fnos): rename app from ai.langbot to langbot Rename appname, desktop entry, data share, build artifacts, and all references from ai.langbot to langbot across packaging files. --------- Co-authored-by: dadachann <185672915+dadachann@users.noreply.github.com>
79 lines
2.6 KiB
YAML
79 lines
2.6 KiB
YAML
name: Build fnOS FPK
|
||
|
||
on:
|
||
workflow_dispatch:
|
||
## 发布release的时候会自动构建
|
||
release:
|
||
types: [published]
|
||
|
||
permissions:
|
||
contents: write
|
||
|
||
jobs:
|
||
build-fnos-fpk:
|
||
runs-on: ubuntu-latest
|
||
steps:
|
||
- name: Checkout
|
||
uses: actions/checkout@v2
|
||
with:
|
||
persist-credentials: false
|
||
|
||
- name: Check version
|
||
id: check_version
|
||
run: |
|
||
echo $GITHUB_REF
|
||
# 如果是tag,则去掉refs/tags/前缀(与其他 release workflow 一致,版本号取 tag 名)
|
||
if [[ $GITHUB_REF == refs/tags/* ]]; then
|
||
echo "It's a tag"
|
||
echo "version=$(echo $GITHUB_REF | awk -F '/' '{print $3}')" >> $GITHUB_OUTPUT
|
||
else
|
||
# 手动触发(workflow_dispatch):读不到 tag,使用 manifest 内维护的版本
|
||
echo "It's not a tag"
|
||
echo "version=$(grep '^version=' packaging/fnos/manifest | cut -d= -f2)" >> $GITHUB_OUTPUT
|
||
fi
|
||
|
||
- name: Setup Node
|
||
uses: actions/setup-node@v2
|
||
with:
|
||
node-version: '22'
|
||
|
||
- name: Setup Python
|
||
uses: actions/setup-python@v5
|
||
with:
|
||
python-version: '3.12'
|
||
|
||
- name: Install build tools
|
||
run: |
|
||
pip install pillow
|
||
# fnpack:飞牛官方打包 CLI(静态二进制)
|
||
curl -fsSL -o /usr/local/bin/fnpack \
|
||
https://static2.fnnas.com/fnpack/fnpack-1.2.3-linux-amd64
|
||
chmod +x /usr/local/bin/fnpack
|
||
|
||
- name: Build FPK
|
||
env:
|
||
FPK_VERSION: ${{ steps.check_version.outputs.version }}
|
||
run: |
|
||
bash packaging/fnos/build.sh
|
||
test -f packaging/fnos/langbot.fpk
|
||
|
||
- name: Upload Artifact
|
||
uses: actions/upload-artifact@v4
|
||
with:
|
||
name: langbot-${{ steps.check_version.outputs.version }}-fnos
|
||
path: packaging/fnos/langbot.fpk
|
||
|
||
- name: Upload To Release
|
||
# 仅 release 触发时执行;手动/workflow_dispatch 触发时没有 release,
|
||
# 且 github.event.release.tag_name 为空(否则 gh release upload 缺参数报错)
|
||
if: github.event_name == 'release'
|
||
env:
|
||
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||
run: |
|
||
# tag 可能已带 -fnos 后缀(如 v4.10.9-fnos),产物名统一为
|
||
# langbot-<基础版本>-fnos.fpk,避免出现 -fnos-fnos
|
||
VER="${{ steps.check_version.outputs.version }}"
|
||
BASE="${VER#v}"; BASE="${BASE%-fnos}"
|
||
cp packaging/fnos/langbot.fpk "langbot-${BASE}-fnos.fpk"
|
||
gh release upload ${{ github.event.release.tag_name }} "langbot-${BASE}-fnos.fpk"
|