10 Commits

Author SHA1 Message Date
Keith Solomon
ad2034a833 fix: Correct changelog extraction in release workflow #release
Some checks failed
Add release / Create release (push) Has been cancelled
2025-03-26 09:28:15 -05:00
Keith Solomon
6cb02fdf54 feature: Extract latest changelog entry for release notes and update .gitignore #release
Some checks failed
Add release / Create release (push) Has been cancelled
2025-03-26 09:26:38 -05:00
Keith Solomon
e8b0116ace feature: Update release workflow to use GitHub Actions and generate tagged releases #release
Some checks failed
Add release / Create release (push) Has been cancelled
2025-03-26 08:58:50 -05:00
Keith Solomon
50a6164576 testing action v8 #release 2025-03-25 12:10:37 -05:00
Keith Solomon
dd5625ded9 testing action v7 #release 2025-03-25 12:08:43 -05:00
Keith Solomon
4014b2fd4a testing action v6 #release 2025-03-25 12:03:33 -05:00
Keith Solomon
e8d8c56224 testing action v5 #release 2025-03-25 11:59:48 -05:00
Keith Solomon
a6617bf35a testing action v4 #release 2025-03-25 11:57:00 -05:00
Keith Solomon
0ed7a7ad01 testing action v3 #release 2025-03-25 11:53:50 -05:00
Keith Solomon
44111b4ee4 testing action v2 #release
Some checks failed
Add release / Create release (push) Has been cancelled
2025-03-25 11:43:16 -05:00
3 changed files with 47 additions and 17 deletions

View File

@@ -1,35 +1,64 @@
name: Add release
run-name: Add release with Gitea Actions
run-name: Add tagged release with Github Actions
on: [push]
# on: [workflow_dispatch]
jobs:
CreateRelease:
name: Create release
runs-on: ubuntu-latest
if: ${{ !contains(gitea.event.head_commit.message, '#skipGA') && contains(gitea.event.head_commit.message, '#release') }}
if: ${{ contains(github.event.head_commit.message, '#release') && !contains(github.event.head_commit.message, '#skipGA') }}
steps:
- name: Check out repository code
uses: actions/checkout@v4
with:
fetch-depth: 0
fetch-tags: true
- name: Generate trunkver
id: trunkver
uses: https://github.com/crftd-tech/trunkver@main
- name: Get current date
id: get-date
run: |
echo "date=$(date +'%Y.%m.%d')" >> "$GITHUB_OUTPUT"
- name: Generate release tag
id: release-tag
run: |
DATE="${{ steps.get-date.outputs.date }}"
TAG_PREFIX="$DATE"
# Find existing tags for the date
EXISTING=$(git tag | grep "^$TAG_PREFIX-" || true)
if [ -z "$EXISTING" ]; then
SERIAL=1
else
SERIAL=$(echo "$EXISTING" | sed "s/^$TAG_PREFIX-//" | sort -nr | head -n1)
SERIAL=$((SERIAL + 1))
fi
NEW_TAG="$TAG_PREFIX-$SERIAL"
echo "tag=$NEW_TAG" >> "$GITHUB_OUTPUT"
- name: Show new tag
run: |
echo "Tag to be created: ${{ steps.release-tag.outputs.tag }}"
- name: Extract latest changelog entry
id: extract-changelog
run: |
# Extract changelog for latest version section
changelog=$(awk '/^## /{i++} i==1{print}' CHANGELOG.md)
echo "changelog<<EOF" >> "$GITHUB_OUTPUT"
echo "$changelog" >> "$GITHUB_OUTPUT"
echo "EOF" >> "$GITHUB_OUTPUT"
- name: Get tag
uses: https://github.com/little-core-labs/get-git-tag@v3.0.1
id: tagName
- name: Use tag
run: echo ${{ steps.tagName.outputs }}
- name: Create release
id: create_release
uses: https://github.com/comnoco/create-release-action@v2
uses: softprops/action-gh-release@v1
with:
tag_name: ${{ steps.release-tag.outputs.tag }}
name: Release ${{ steps.release-tag.outputs.tag }}
body: ${{ steps.extract-changelog.outputs.changelog }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ steps.trunkver.outputs.trunkver }}
release_name: Release ${{ steps.trunkver.outputs.trunkver }}
body: |
${{ gitea.event.head_commit.message}}

1
.gitignore vendored Normal file
View File

@@ -0,0 +1 @@
.DS_Store

View File