Skip to content

Commit

Permalink
bug fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
Dodoooh committed Dec 14, 2024
1 parent 6ca6214 commit f94a462
Show file tree
Hide file tree
Showing 3 changed files with 92 additions and 1 deletion.
82 changes: 82 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
name: Release Workflow

on:
push:
branches:
- main
- dev

jobs:
release:
runs-on: ubuntu-latest

steps:
# Checkout des Codes
- name: Checkout code
uses: actions/checkout@v3

# Git konfigurieren
- name: Configure Git
run: |
git config --global user.email "ci@github-actions.com"
git config --global user.name "GitHub Actions CI"
# Versionsnummer und Release Notes aus changelog.md extrahieren
- name: Extract Version and Release Notes
id: changelog
run: |
# Datei prüfen
if [ ! -f changelog.md ]; then
echo "ERROR: changelog.md not found!" >&2
exit 1
fi
# Branch prüfen
if [[ "${{ github.ref }}" == "refs/heads/main" ]]; then
# Reguläres Release (erstes "## Release")
VERSION=$(grep -m 1 '^## Release ' changelog.md | awk '{print $3}')
NOTES=$(awk '/^## Release / {if (NR > 1) exit; next} {print}' changelog.md)
elif [[ "${{ github.ref }}" == "refs/heads/dev" ]]; then
# Beta-Release (erstes "## Beta Release")
VERSION=$(grep -m 1 '^## Beta Release ' changelog.md | awk '{print $4}')
NOTES=$(awk '/^## Beta Release / {if (NR > 1) exit; next} {print}' changelog.md)
else
echo "ERROR: Unsupported branch ${{ github.ref }}" >&2
exit 1
fi
if [ -z "$VERSION" ]; then
echo "ERROR: Could not extract version from changelog.md" >&2
exit 1
fi
echo "VERSION=$VERSION" >> $GITHUB_ENV
echo "NOTES<<EOF" >> $GITHUB_ENV
echo "$NOTES" >> $GITHUB_ENV
echo "EOF" >> $GITHUB_ENV
# Überprüfen, ob der Tag existiert
- name: Check if Tag Already Exists
run: |
if git rev-parse "refs/tags/${{ env.VERSION }}" >/dev/null 2>&1; then
echo "Tag ${{ env.VERSION }} already exists. Skipping release."
exit 0
fi
# Neuen Git-Tag erstellen und pushen
- name: Create and Push Tag
run: |
git tag -a ${{ env.VERSION }} -m "Release ${{ env.VERSION }}"
git push origin ${{ env.VERSION }}
# GitHub Release erstellen
- name: Create GitHub Release
uses: actions/create-release@v1
with:
tag_name: ${{ env.VERSION }}
release_name: "Release ${{ env.VERSION }}"
body: ${{ env.NOTES }}
draft: false
prerelease: ${{ github.ref == 'refs/heads/dev' }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
9 changes: 9 additions & 0 deletions changelog.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
## Beta Release 1.1.0
What’s New:
• Modern, responsive UI with collapsible settings for better usability.
• Dynamic result section with a copy-to-clipboard button for JSON output.
• Automatic <br> conversion for line breaks in text input.
• Improved error handling and streamlined functionality.

## Release 1.0.1
Automated release of version 1.0.1.
2 changes: 1 addition & 1 deletion templates/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ <h2>Text drucken</h2>
<!-- Ergebnisbereich -->
<section class="card hidden" id="result-section">
<div class="result-header">
<h2>Ergebnis</h2>
<h2>JSON Output:</h2>
<button id="copy-to-clipboard" class="icon-button" aria-label="Copy JSON">📋</button>
</div>
<div id="result" class="json-result"></div>
Expand Down

0 comments on commit f94a462

Please sign in to comment.