release: v2.0.1 #2
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: Release | |
| on: | |
| push: | |
| tags: | |
| - "v*.*.*" | |
| permissions: | |
| contents: write | |
| jobs: | |
| release: | |
| name: Create Release | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v6 | |
| with: | |
| fetch-depth: 0 | |
| - name: Get version from tag | |
| id: version | |
| run: echo "version=${GITHUB_REF#refs/tags/v}" >> $GITHUB_OUTPUT | |
| - name: Verify manifest version matches tag | |
| run: | | |
| MANIFEST_VERSION=$(grep -oP '"version":\s*"\K[^"]+' custom_components/nerdqaxe/manifest.json) | |
| TAG_VERSION=${{ steps.version.outputs.version }} | |
| if [ "$MANIFEST_VERSION" != "$TAG_VERSION" ]; then | |
| echo "Error: manifest.json version ($MANIFEST_VERSION) does not match tag version ($TAG_VERSION)" | |
| exit 1 | |
| fi | |
| - name: Generate changelog | |
| id: changelog | |
| uses: mikepenz/release-changelog-builder-action@v6 | |
| with: | |
| configuration: | | |
| { | |
| "categories": [ | |
| { | |
| "title": "## Features", | |
| "labels": ["feature", "enhancement"] | |
| }, | |
| { | |
| "title": "## Bug Fixes", | |
| "labels": ["fix", "bug"] | |
| }, | |
| { | |
| "title": "## Maintenance", | |
| "labels": ["chore", "dependencies"] | |
| } | |
| ], | |
| "template": "#{{CHANGELOG}}\n\n**Full Changelog**: #{{RELEASE_DIFF}}" | |
| } | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Create release | |
| uses: softprops/action-gh-release@v2 | |
| with: | |
| name: v${{ steps.version.outputs.version }} | |
| body: ${{ steps.changelog.outputs.changelog }} | |
| draft: false | |
| prerelease: ${{ contains(github.ref, 'beta') || contains(github.ref, 'alpha') }} | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |