-
Notifications
You must be signed in to change notification settings - Fork 1
97 lines (86 loc) · 3.15 KB
/
Copy pathrelease.yaml
File metadata and controls
97 lines (86 loc) · 3.15 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
name: Release
on:
push:
tags:
- 'v*'
workflow_dispatch:
inputs:
tag:
description: 'Tag to release (e.g. v0.2.0)'
required: true
type: string
permissions:
contents: write
jobs:
release:
name: Build & publish release tarball
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3
with:
ref: ${{ inputs.tag || github.ref }}
- name: Resolve version
id: ver
run: |
if [ -n "${{ inputs.tag }}" ]; then
VERSION="${{ inputs.tag }}"
else
VERSION="${GITHUB_REF#refs/tags/}"
fi
# Strip leading "v" for the tarball filename body, but keep tag form
# for release naming.
BODY="${VERSION#v}"
NAME="llama-cpp-server-explorer-${BODY}"
{
echo "version=${VERSION}"
echo "body=${BODY}"
echo "tarball_name=${NAME}.tar.gz"
echo "stage_dir=${RUNNER_TEMP}/${NAME}"
} >> "$GITHUB_OUTPUT"
- uses: pnpm/action-setup@0e279bb959325dab635dd2c09392533439d90093 # v6.0.8
- uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0
with:
node-version: '26'
cache: pnpm
- name: Install dependencies
run: pnpm install --frozen-lockfile
- name: Typecheck & build
run: |
pnpm typecheck
pnpm build
- name: Stage release contents
run: |
set -euo pipefail
STAGE="${{ steps.ver.outputs.stage_dir }}"
mkdir -p "${STAGE}"
# Curated tarball: source files needed to build/run, but not dev
# noise. Users still run `pnpm install && pnpm build` after extract
# (better-sqlite3 needs to compile its native binding for the host
# platform), so we ship sources rather than a pre-built dist.
rsync -a \
--exclude='.git' \
--exclude='.github' \
--exclude='.pre-commit-config.yaml' \
--exclude='.secrets.baseline' \
--exclude='node_modules' \
--exclude='dist' \
--exclude='data/*.db' \
--exclude='data/*.db-*' \
--exclude='images' \
./ "${STAGE}/"
- name: Create tarball + sha256
run: |
set -euo pipefail
cd "$(dirname "${{ steps.ver.outputs.stage_dir }}")"
tar -czf "${{ steps.ver.outputs.tarball_name }}" "$(basename "${{ steps.ver.outputs.stage_dir }}")"
shasum -a 256 "${{ steps.ver.outputs.tarball_name }}" > "${{ steps.ver.outputs.tarball_name }}.sha256"
ls -la "${{ steps.ver.outputs.tarball_name }}"*
- name: Publish GitHub Release
uses: softprops/action-gh-release@b4309332981a82ec1c5618f44dd2e27cc8bfbfda # v3.0.0
with:
tag_name: ${{ steps.ver.outputs.version }}
name: ${{ steps.ver.outputs.version }}
generate_release_notes: true
files: |
${{ runner.temp }}/${{ steps.ver.outputs.tarball_name }}
${{ runner.temp }}/${{ steps.ver.outputs.tarball_name }}.sha256