This repository has been archived by the owner on Apr 6, 2024. It is now read-only.
chore(github): 💚update Auto Release #4
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
name: Auto Release | |
on: | |
push: | |
tags: | |
- 'release-v*' | |
jobs: | |
release: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v3 | |
with: | |
fetch-depth: 0 | |
- name: Setup Node.js | |
uses: actions/setup-node@v3 | |
with: | |
node-version: '20' | |
- name: Generate Changelog | |
id: changelog | |
run: | | |
npm install -g conventional-changelog-cli | |
conventional-changelog -p angular -i CHANGELOG.md -s -r 0 | |
cp CHANGELOG.md ./tmp_changelog | |
- name: Set Release Name | |
shell: bash | |
id: set_release_name | |
run: echo "tag=$(echo $GITHUB_REF | sed 's|refs/tags/||')" >> $GITHUB_OUTPUT | |
- name: Create Release | |
id: create_release | |
uses: softprops/action-gh-release@v1 | |
if: startsWith(github.ref, 'refs/tags/') | |
env: | |
# GITHUB_TOKEN | |
GITHUB_TOKEN: ${{ secrets.GB_TOKEN }} | |
with: | |
# tag_name: 使用 tag | |
tag_name: ${{ github.ref }} | |
# release_name: 使用 tag | |
name: ${{ steps.set_release_name.outputs.tag }} | |
# body: 使用 changelog | |
body_path: ./tmp_changelog | |
# 草稿 | |
draft: false | |
# 预发布 | |
prerelease: false | |
# 自动生成 release notes | |
generate_release_notes: true |