Compare commits
16 Commits
$TRUNKVER
...
2025.03.26
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
ad2034a833 | ||
|
|
6cb02fdf54 | ||
|
|
e8b0116ace | ||
|
|
50a6164576 | ||
|
|
dd5625ded9 | ||
|
|
4014b2fd4a | ||
|
|
e8d8c56224 | ||
|
|
a6617bf35a | ||
|
|
0ed7a7ad01 | ||
|
|
44111b4ee4 | ||
|
|
4600a52a1c | ||
|
|
d74e575bd7 | ||
|
|
73c89016b3 | ||
|
|
70c7651ab8 | ||
|
|
d61110f4a5 | ||
|
|
caf3f83965 |
@@ -1,38 +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: Print trunkver
|
||||
env:
|
||||
TRUNKVER: ${{ steps.trunkver.outputs.trunkver }}
|
||||
- name: Get current date
|
||||
id: get-date
|
||||
run: |
|
||||
echo "$TRUNKVER"
|
||||
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: Create release
|
||||
id: create_release
|
||||
uses: https://github.com/comnoco/create-release-action@v2
|
||||
env:
|
||||
TRUNKVER: ${{ steps.trunkver.outputs.trunkver }}
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
uses: softprops/action-gh-release@v1
|
||||
with:
|
||||
tag_name: "$TRUNKVER"
|
||||
release_name: "Release $TRUNKVER"
|
||||
body: |
|
||||
${{ gitea.event.head_commit.message}}
|
||||
draft: false
|
||||
prerelease: false
|
||||
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 }}
|
||||
|
||||
1
.gitignore
vendored
Normal file
1
.gitignore
vendored
Normal file
@@ -0,0 +1 @@
|
||||
.DS_Store
|
||||
Reference in New Issue
Block a user