chore: add release note workflow #175
Workflow file for this run
This file contains 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
# https://github.com/sveltejs/kit/blob/32afba695088b946aefe96da75b36de9b0667fbe/.github/workflows/release.yml | |
name: 'Release' | |
on: | |
push: | |
branches: ['ximo_dev'] | |
jobs: | |
# 新增的 release-notes Job | |
release-notes: | |
name: Generate Release Notes | |
runs-on: ubuntu-latest | |
permissions: | |
contents: write | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v3 | |
- name: Set up git | |
run: | | |
git fetch --prune --unshallow | |
git fetch --tags | |
- name: Get latest tag | |
id: get_tag | |
run: echo "TAG=$(git describe --tags --abbrev=0)" >> $GITHUB_ENV | |
- name: Install dependencies | |
run: npm install | |
- name: Generate GitHub Release | |
uses: actions/create-release@v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
tag_name: ${{ env.TAG }} # 使用最近的 tag 作为 tag 名 | |
release_name: Release ${{ env.TAG }} # 使用最近的 tag 作为 release 名 | |
body: | | |
## Changes | |
$(npx changeset status --snapshot) # 使用 changeset 文案生成 Release Notes | |
draft: false # 直接发布而非草稿 |