Bump Version #8
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: Auto Release on Push | |
| on: | |
| push: | |
| branches: | |
| - main | |
| permissions: | |
| contents: write # Erlaubt das Erstellen von Tags & Releases | |
| jobs: | |
| release: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout Repository | |
| uses: actions/checkout@v4 | |
| - name: Extract Version from fxmanifest.lua | |
| id: version | |
| run: | | |
| VERSION=$(grep -oP "version\s*'\K[\d\.]+" it_bridge/fxmanifest.lua | tr -d '\r\n') | |
| echo "VERSION=v$VERSION" >> $GITHUB_ENV | |
| - name: Create ZIP Archive | |
| run: zip -r "[it_bridge_pack].zip" . -x "*.git*" | |
| - name: Get Previous Tag | |
| id: prev_tag | |
| continue-on-error: true | |
| run: echo "PREV_TAG=$(git describe --tags --abbrev=0 2>/dev/null || echo "")" >> $GITHUB_ENV | |
| - name: Generate Changelog | |
| id: changelog | |
| run: | | |
| if [ -n "${{ env.PREV_TAG }}" ]; then | |
| echo "## Änderungen seit ${{ env.PREV_TAG }}" > changelog.md | |
| git log --pretty=format:"- %s (%an)" ${{ env.PREV_TAG }}..HEAD >> changelog.md | |
| else | |
| echo "## Erstes Release" > changelog.md | |
| fi | |
| - name: Create Git Tag | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| run: | | |
| git config --global user.name "github-actions[bot]" | |
| git config --global user.email "github-actions[bot]@users.noreply.github.com" | |
| git tag ${{ env.VERSION }} | |
| git push origin ${{ env.VERSION }} | |
| - name: Create GitHub Release | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GH_PAT }} | |
| run: | | |
| gh release create "${{ env.VERSION }}" "[it_bridge_pack].zip" \ | |
| --repo ${{ github.repository }} \ | |
| --title "Release ${{ env.VERSION }}" \ | |
| --notes-file changelog.md |