Compare commits
12 Commits
2025032516
...
2025.03.26
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
22b6e37331 | ||
|
|
ad2034a833 | ||
|
|
6cb02fdf54 | ||
|
|
e8b0116ace | ||
|
|
50a6164576 | ||
|
|
dd5625ded9 | ||
|
|
4014b2fd4a | ||
|
|
e8d8c56224 | ||
|
|
a6617bf35a | ||
|
|
0ed7a7ad01 | ||
|
|
44111b4ee4 | ||
|
|
4600a52a1c |
@@ -1,35 +1,78 @@
|
||||
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: Extract latest changelog entry and version
|
||||
id: extract-changelog
|
||||
run: |
|
||||
version=$(awk '/^## /{ print $2; exit }' CHANGELOG.md)
|
||||
changelog=$(awk '/^## /{i++} i==1{print}' CHANGELOG.md)
|
||||
|
||||
echo "version=$version" >> "$GITHUB_OUTPUT"
|
||||
echo "changelog<<EOF" >> "$GITHUB_OUTPUT"
|
||||
echo "$changelog" >> "$GITHUB_OUTPUT"
|
||||
echo "EOF" >> "$GITHUB_OUTPUT"
|
||||
|
||||
- name: Create renamed zip file
|
||||
run: |
|
||||
REPO_NAME=$(basename -s .git `git config --get remote.origin.url`)
|
||||
VERSION=${{ steps.extract-changelog.outputs.version }}
|
||||
ZIP_NAME="${REPO_NAME}-${VERSION}.zip"
|
||||
|
||||
# Create a temporary clone without .git
|
||||
mkdir package
|
||||
git archive --format=zip HEAD -o "$ZIP_NAME"
|
||||
|
||||
echo "zip_name=$ZIP_NAME" >> "$GITHUB_ENV"
|
||||
|
||||
- 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 }}
|
||||
files: ${{ env.zip_name }}
|
||||
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
1
.gitignore
vendored
Normal file
@@ -0,0 +1 @@
|
||||
.DS_Store
|
||||
Reference in New Issue
Block a user