-
Notifications
You must be signed in to change notification settings - Fork 1
42 lines (42 loc) · 1.5 KB
/
Copy pathrelease.yml
File metadata and controls
42 lines (42 loc) · 1.5 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
name: release-abi
on:
push:
tags: ['v*']
# 手动重跑(tag 已存在但 release 缺失时用;tag 删+重建同 sha 不会重新触发)
workflow_dispatch:
inputs:
tag:
description: 要发布的 tag(须已存在,如 v0.1.5)
required: true
permissions:
contents: write
jobs:
publish:
runs-on: ubuntu-latest
env:
GH_TOKEN: ${{ github.token }}
RELEASE_TAG: ${{ inputs.tag || github.ref_name }}
steps:
- uses: actions/checkout@v4
with: { ref: "${{ inputs.tag || github.ref }}" }
- name: 下载 ABI 依赖
env: { GH_TOKEN: "${{ secrets.GITHUB_TOKEN }}" }
run: ./ci/deps.sh
- name: 构建
run: make build
- name: 打包 ABI 产物
run: |
set -euo pipefail
v="${RELEASE_TAG:-${GITHUB_REF_NAME}}"
d="slotsboxmalloc-abi-$v-linux-x86_64"
# 本库是 header-only(#define SLOTSBOXMALLOC_IMPLEMENTATION 单头文件):
# 只发头,不发 .so —— 消费者把实现体编进自己的 TU。
mkdir -p "$d/include"
cp -R include/. "$d/include/"
# 本仓无可执行产物(纯库),故不带 bin/
printf '{"abi":"%s"}\n' "$v" > "$d/abi-manifest.json"
tar czf "$d.tar.gz" "$d"
tar tzf "$d.tar.gz"
sha256sum "$d.tar.gz" > SHA256SUMS
- name: 发布 release
run: gh release create "${RELEASE_TAG:-${GITHUB_REF_NAME}}" slotsboxmalloc-abi-*.tar.gz SHA256SUMS --generate-notes