Add release workflow for GoExport Mod with changelog generation #1
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Create Release | |
| on: | |
| push: | |
| tags: | |
| - "v*" | |
| release: | |
| types: [created] | |
| permissions: | |
| contents: write | |
| jobs: | |
| build-and-release: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 # Fetch all history for changelog generation | |
| - name: Create release package | |
| run: | | |
| mkdir -p release-temp | |
| cp -r resources release-temp/ | |
| cp readme.txt release-temp/ | |
| cd release-temp | |
| zip -r ../GoExport-Mod.zip . | |
| cd .. | |
| - name: Get tag name | |
| id: tag_name | |
| run: echo "TAG=${GITHUB_REF#refs/tags/}" >> $GITHUB_OUTPUT | |
| - name: Generate changelog | |
| id: changelog | |
| uses: mikepenz/release-changelog-builder-action@v4 | |
| with: | |
| configuration: | | |
| { | |
| "categories": [ | |
| { | |
| "title": "## 🚀 Features", | |
| "labels": ["feature", "enhancement"] | |
| }, | |
| { | |
| "title": "## 🐛 Fixes", | |
| "labels": ["fix", "bug"] | |
| }, | |
| { | |
| "title": "## 🧪 Changes", | |
| "labels": [] | |
| } | |
| ], | |
| "template": "#{{CHANGELOG}}\n\n**Full Changelog**: #{{RELEASE_DIFF}}", | |
| "pr_template": "- #{{TITLE}} by @#{{AUTHOR}} in ##{{NUMBER}}", | |
| "empty_template": "- No changes", | |
| "label_extractor": [ | |
| { | |
| "pattern": "^(feat|feature)", | |
| "target": "feature" | |
| }, | |
| { | |
| "pattern": "^(fix|bugfix)", | |
| "target": "fix" | |
| } | |
| ] | |
| } | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Create Release | |
| uses: softprops/action-gh-release@v1 | |
| if: startsWith(github.ref, 'refs/tags/') | |
| with: | |
| files: GoExport-Mod.zip | |
| body: ${{ steps.changelog.outputs.changelog }} | |
| draft: false | |
| prerelease: false | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |