Files
wrong-notebook/.github/workflows/release.yml
margrop 3a70f83bd9 ci: 升级 GitHub Actions 至 Node 24 运行时版本
checkout、setup-node、cache、upload/download-artifact、setup-java、
docker 系列与 action-gh-release 升级到最新大版本(仍按提交 SHA 固定);
发布不足两周的 docker/login-action 取 v4.6.0;
gradle/actions 停在 v5.0.2,避免 v6 缓存组件的商业许可条款。

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-02 20:01:11 +08:00

63 lines
2.0 KiB
YAML

name: Release
on:
push:
tags:
- 'v*'
permissions:
contents: write
jobs:
release:
runs-on: ubuntu-latest
# 只在 GitHub 上运行;Gitea 读取 main 时会回退到本目录,需跳过
if: github.server_url == 'https://github.com'
name: GitHub Release
steps:
- name: Checkout repository
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
fetch-depth: 0 # 完整历史,用于生成 changelog
- name: Extract version from tag
id: version
run: |
TAG="${GITHUB_REF#refs/tags/}"
VERSION="${TAG#v}"
echo "tag=$TAG" >> "$GITHUB_OUTPUT"
echo "version=$VERSION" >> "$GITHUB_OUTPUT"
echo "Tag: $TAG, Version: $VERSION"
- name: Check if release version (no pre-release suffix)
id: is_release
run: |
if [[ "${{ steps.version.outputs.tag }}" == *-* ]]; then
echo "prerelease=true" >> "$GITHUB_OUTPUT"
else
echo "prerelease=false" >> "$GITHUB_OUTPUT"
fi
- name: Generate changelog
id: changelog
run: |
# 预览版与上一个任意版本比较,正式版与上一个正式版比较,见 scripts/release-notes.sh
{
echo "changelog<<EOF"
bash scripts/release-notes.sh "${{ steps.version.outputs.tag }}"
echo "EOF"
} >> "$GITHUB_OUTPUT"
- name: Create GitHub Release
uses: softprops/action-gh-release@efb35369e0ad2afab669f228072c1b0d510eae64 # v3.0.3
with:
tag_name: ${{ steps.version.outputs.tag }}
name: ${{ steps.version.outputs.tag }}
body: |
${{ steps.changelog.outputs.changelog }}
[Code signing policy](https://github.com/margrop/wrong-notebook/blob/main/doc/CODE_SIGNING.en.md) · [Privacy policy](https://github.com/margrop/wrong-notebook/blob/main/doc/PRIVACY.en.md)
prerelease: ${{ steps.is_release.outputs.prerelease == 'true' }}
generate_release_notes: false