✔️ ci: change prefix of release name #19
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: | |
| branches: | |
| - main | |
| jobs: | |
| build: | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: write | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 | |
| - name: Get version from fxmanifest.lua | |
| id: get_version | |
| shell: bash | |
| run: | | |
| version=$(grep "git_version" fxmanifest.lua | awk -F"'" '{print $2}') | |
| echo "Found version: $version" | |
| if [ ! -z "$version" ]; then | |
| echo "version=$version" >> "$GITHUB_OUTPUT" | |
| else | |
| echo "Error: Version not found" | |
| exit 1 | |
| fi | |
| - name: Generate Changelog | |
| id: changelog | |
| run: | | |
| PREVIOUS_TAG=$(git describe --tags --abbrev=0 2>/dev/null || echo "") | |
| if [ -z "$PREVIOUS_TAG" ]; then | |
| LOG=$(git log --pretty=format:"- %s (%h)") | |
| else | |
| LOG=$(git log $PREVIOUS_TAG..HEAD --pretty=format:"- %s (%h)") | |
| fi | |
| echo "logs<<EOF" >> $GITHUB_OUTPUT | |
| echo "$LOG" >> $GITHUB_OUTPUT | |
| echo "EOF" >> $GITHUB_OUTPUT | |
| - name: Create ZIP archive | |
| run: | | |
| zip -r es_extended-dogeaterx.zip . -x ".git/*" ".github/*" "*.md" "LICENSE" | |
| - name: Create Release | |
| uses: ncipollo/release-action@v1 | |
| with: | |
| artifacts: "es_extended-dogeaterx.zip" | |
| token: ${{ secrets.GITHUB_TOKEN }} | |
| tag: v${{ steps.get_version.outputs.version }} | |
| name: "${{ steps.get_version.outputs.version }}" | |
| body: | | |
| ## 📝 What's changes in this version | |
| ${{ steps.changelog.outputs.logs }} | |
| draft: false | |
| prerelease: false |