diff --git a/.gitea/workflows/release.yml b/.gitea/workflows/release.yml index 5762b37..323c119 100644 --- a/.gitea/workflows/release.yml +++ b/.gitea/workflows/release.yml @@ -25,7 +25,6 @@ jobs: echo "version=$(date +'%Y.%m.%d-%H%M')" >> $GITHUB_OUTPUT fi - # NEW STEP: Generate release notes from commits - name: Generate release notes id: release_notes run: | @@ -40,18 +39,11 @@ jobs: COMMITS=$(git log --pretty=format:"* %s (%h)" ${LATEST_TAG}..HEAD --no-merges) fi - # Escape newlines and special characters for GitHub Actions - COMMITS="${COMMITS//'%'/'%25'}" - COMMITS="${COMMITS//$'\n'/'%0A'}" - COMMITS="${COMMITS//$'\r'/'%0D'}" - - # Create release notes with header - NOTES="## What's New in ${{ steps.get_version.outputs.version }}%0A%0A" - NOTES+="$COMMITS" - - # Output to GitHub Actions + # Create release notes with header (without encoding newlines) echo "notes<> $GITHUB_OUTPUT - echo "$NOTES" >> $GITHUB_OUTPUT + echo "## What's New in ${{ steps.get_version.outputs.version }}" >> $GITHUB_OUTPUT + echo "" >> $GITHUB_OUTPUT + echo "$COMMITS" >> $GITHUB_OUTPUT echo "EOF" >> $GITHUB_OUTPUT - name: Update plugin version @@ -63,13 +55,16 @@ jobs: - name: Create ZIP archive run: | - zip -r fourthwall-store-embed.zip . -x ".git/*" ".gitea/*" + mkdir -p /tmp/fourthwall-store-embed + rsync -av --exclude=".git" --exclude=".gitea" --exclude="build" . /tmp/fourthwall-store-embed/ + cd /tmp + zip -r $GITEA_WORK_DIR/fourthwall-store-embed.zip fourthwall-store-embed - name: Create Release uses: softprops/action-gh-release@v2 with: token: "${{ secrets.REPO_TOKEN }}" - title: Fourthwall-store-embed Release ${{ steps.get_version.outputs.version }} + title: "Fourthwall-store-embed Release ${{ steps.get_version.outputs.version }}" tag_name: ${{ steps.get_version.outputs.version }} body: "${{ steps.release_notes.outputs.notes }}" files: | diff --git a/.gitea/workflows/update-version.yml b/.gitea/workflows/update-version.yml index 95368e8..0d3abf4 100644 --- a/.gitea/workflows/update-version.yml +++ b/.gitea/workflows/update-version.yml @@ -35,8 +35,10 @@ jobs: - name: Create plugin zip run: | - mkdir -p build - zip -r build/fourthwall-store-embed.zip . -x ".git/*" ".gitea/*" "build/*" "*.git*" + mkdir -p /tmp/fourthwall-store-embed + rsync -av --exclude=".git" --exclude=".gitea" --exclude="build" . /tmp/fourthwall-store-embed/ + cd /tmp + zip -r $GITEA_WORK_DIR/fourthwall-store-embed.zip fourthwall-store-embed - name: Upload zip to release uses: actions/upload-release-asset@v1