Compare commits
9 Commits
2025032516
...
2025.03.26
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
e8b0116ace | ||
|
|
50a6164576 | ||
|
|
dd5625ded9 | ||
|
|
4014b2fd4a | ||
|
|
e8d8c56224 | ||
|
|
a6617bf35a | ||
|
|
0ed7a7ad01 | ||
|
|
44111b4ee4 | ||
|
|
4600a52a1c |
@@ -1,35 +1,55 @@
|
||||
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: 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.tag}}
|
||||
- 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: 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: |
|
||||
${{ github.event.head_commit.message }}
|
||||
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}}
|
||||
|
||||
Reference in New Issue
Block a user