Skip to content

c

c #2

on:
push:
tags:
- "*"
jobs:
release:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Install Cocogitto CLI
run: |
curl -sL https://github.com/cocogitto/cocogitto/releases/latest/download/cog-$(uname -s)-$(uname -m).tar.gz \
| tar xz -C /usr/local/bin cog
- name: Generate changelog
run: |
VERSION=${GITHUB_REF#refs/tags/}
echo "Generating changelog for $VERSION"
cog changelog --at "$VERSION" -t full_hash > NEW_CHANGELOG.md
- name: Prepend to CHANGELOG.md
run: |
cat NEW_CHANGELOG.md CHANGELOG.md > TEMP_CHANGELOG.md
mv TEMP_CHANGELOG.md CHANGELOG.md
- name: Commit updated CHANGELOG.md
run: |
git config user.name "Cog Bot"
git config user.email "mycoolproject@org.org"
git add CHANGELOG.md
git commit -m "docs: update changelog for ${{ github.ref_name }}"
git push origin HEAD:main
- name: Upload GitHub Release
uses: softprops/action-gh-release@v1
with:
body_path: NEW_CHANGELOG.md
tag_name: ${{ github.ref_name }}