Merge pull request #320 from array2d/chore/issue-319-release-selfcont… #27
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: release-abi | |
| on: | |
| push: | |
| tags: ['v*'] | |
| permissions: | |
| contents: write | |
| jobs: | |
| publish: | |
| runs-on: ubuntu-latest | |
| env: | |
| GH_TOKEN: ${{ github.token }} | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: 下载 ABI 依赖 | |
| env: { GH_TOKEN: "${{ secrets.GITHUB_TOKEN }}" } | |
| run: ./ci/deps.sh | |
| - name: 构建 runtime + layout | |
| run: | | |
| make runtime | |
| cargo build --release --manifest-path layout/Cargo.toml | |
| - name: 打包 ABI 产物 | |
| run: | | |
| set -euo pipefail | |
| v="${GITHUB_REF_NAME}" | |
| d="kvlang-abi-$v-linux-x86_64" | |
| mkdir -p "$d/include" "$d/lib/kvspace" | |
| cp runtime/include/*.h "$d/include/" | |
| cp bin/libkvlang_runtime.so "$d/lib/" | |
| cp layout/target/release/libkvlanglayout.so "$d/lib/" | |
| # 自带全部 ABI 依赖(deps.json 所列)→ 解包即 /usr/lib + /usr/lib/kvspace 布局 | |
| cp /usr/lib/libkvspace.so* /usr/lib/libblockmalloc.so* /usr/lib/libslotsboxmalloc.so* "$d/lib/" | |
| cp /usr/lib/kvspace/libkvspace-c.so* /usr/lib/kvspace/libkvspace_durable.so* "$d/lib/kvspace/" | |
| 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 "${GITHUB_REF_NAME}" kvlang-abi-*.tar.gz SHA256SUMS --generate-notes |