name: Create Release with PDF on: push: tags: - "v*.*.*" # Trigger on version tags like v1.0.0 - "release-*" # Trigger on release tags like release-2024-10 jobs: build-and-release: runs-on: ubuntu-latest permissions: contents: write # Required for creating releases steps: - name: Checkout repository uses: actions/checkout@v4 - name: Extract version from tag id: version run: | echo "VERSION=${GITHUB_REF#refs/tags/}" >> $GITHUB_OUTPUT echo "DATE=$(date +'%Y-%m-%d')" >> $GITHUB_OUTPUT - name: Build document with Docker run: make docker-build - name: Verify PDF creation run: | if [ ! -f Output/Main.pdf ]; then echo "Error: PDF was not created" exit 1 fi echo "PDF successfully created" echo "Size: $(du -h Output/Main.pdf)" - name: Rename PDF with version run: | cp Output/Main.pdf "Report_${{ steps.version.outputs.VERSION }}.pdf" - name: Generate release notes id: release_notes run: | cat << EOF > release_notes.md ## Report Document Release **Version:** ${{ steps.version.outputs.VERSION }} **Date:** ${{ steps.version.outputs.DATE }} ### 📄 Document Information - **Template:** HSRTReport LaTeX Template - **Institution:** University of Applied Sciences Reutlingen - **Build System:** Docker-based compilation ### 📦 Included Files - \`Report_${{ steps.version.outputs.VERSION }}.pdf\` - The compiled document ### 🔧 Build Information - Built with XeLaTeX - Bibliography processed with Biber - Glossaries and acronyms included ### 📝 Recent Changes Please see the commit history for detailed changes. --- *This release was automatically generated by GitHub Actions* EOF - name: Create GitHub Release uses: softprops/action-gh-release@v1 with: files: | Report_${{ steps.version.outputs.VERSION }}.pdf Output/Main.pdf name: Release ${{ steps.version.outputs.VERSION }} body_path: release_notes.md draft: false prerelease: false generate_release_notes: true # Append auto-generated notes env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - name: Upload PDF as artifact (backup) uses: actions/upload-artifact@v5 with: name: Report-${{ steps.version.outputs.VERSION }} path: | Report_${{ steps.version.outputs.VERSION }}.pdf Output/Main.pdf retention-days: 90 if-no-files-found: error