Skip to content

Commit

Permalink
使用新的changelog生成工具
Browse files Browse the repository at this point in the history
  • Loading branch information
jorben committed Jul 3, 2024
1 parent 57f113a commit 75aba3b
Showing 1 changed file with 27 additions and 42 deletions.
69 changes: 27 additions & 42 deletions .github/workflows/changelog.yml
Original file line number Diff line number Diff line change
@@ -1,53 +1,38 @@
name: changeLog
name: Deploy

on:
push:
tags:
- '*'
- [0-9]+.[0-9]+.[0-9]+

jobs:
build:

deploy:
runs-on: ubuntu-latest

steps:
- uses: actions/setup-node@v2-beta
with:
node-version: '12'
- uses: actions/checkout@v3
with:
fetch-depth: 0

- name: Checkout Tool
- name: Checkout Code
uses: actions/checkout@v3
with:
repository: cookpete/auto-changelog
path: 'auto-changelog'
- name: Build Tool
run: |
cd auto-changelog
npm install
npm link

- name: Generate ChangeLog
run: |
auto-changelog
- name: Cat ChangeLog
run: cat CHANGELOG.md

- name: Commit files
env:
CI_USER: "脚本哥"
CI_EMAIL: "[email protected]"
run: |
git config --local user.email "$CI_EMAIL"
git config --local user.name "$CI_USER"
git add CHANGELOG.md && git commit -m 'Updated CHANGELOG.md' && echo "push=1" >> $GITHUB_ENV || echo "No changes to CHANGELOG.md"
- name: Push changes
if: env.push == 1
env:
CI_USER: "jorben"
CI_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
git push "https://$CI_USER:[email protected]/$GITHUB_REPOSITORY.git" HEAD:master
- name: Update CHANGELOG
id: changelog
uses: requarks/changelog-action@v1
with:
token: ${{ github.token }}
tag: ${{ github.ref_name }}

# - name: Create Release
# uses: ncipollo/[email protected]
# with:
# allowUpdates: true
# draft: false
# makeLatest: true
# name: ${{ github.ref_name }}
# body: ${{ steps.changelog.outputs.changes }}
# token: ${{ github.token }}

- name: Commit CHANGELOG.md
uses: stefanzweifel/git-auto-commit-action@v4
with:
branch: main
commit_message: 'docs: update CHANGELOG.md for ${{ github.ref_name }} [skip ci]'
file_pattern: CHANGELOG.md

0 comments on commit 75aba3b

Please sign in to comment.