chore: actualizar versión a 1.0.8 en changelog, README y archivos de … #10
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*" # se dispara cuando haces push de un tag tipo v1.0.8 | |
| jobs: | |
| release: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 # necesitamos todo el historial para git log | |
| - name: Get previous tag | |
| id: previoustag | |
| run: | | |
| prev_tag=$(git describe --tags --abbrev=0 HEAD^ || echo "") | |
| echo "prev_tag=$prev_tag" >> $GITHUB_OUTPUT | |
| - name: Generate changelog from commits | |
| id: changelog | |
| run: | | |
| if [ -z "${{ steps.previoustag.outputs.prev_tag }}" ]; then | |
| log=$(git log --pretty=format:"* %s (%h)" ) | |
| else | |
| log=$(git log ${{ steps.previoustag.outputs.prev_tag }}..HEAD --pretty=format:"* %s (%h)") | |
| fi | |
| echo "log<<EOF" >> $GITHUB_OUTPUT | |
| echo "$log" >> $GITHUB_OUTPUT | |
| echo "EOF" >> $GITHUB_OUTPUT | |
| - name: Update CHANGELOG.md | |
| run: | | |
| echo "## $GITHUB_REF_NAME - $(date +'%Y-%m-%d')" >> tmp_changelog.md | |
| echo "" >> tmp_changelog.md | |
| echo "🟢 Esta versión ha sido publicada como release estable." >> tmp_changelog.md | |
| echo "" >> tmp_changelog.md | |
| echo "${{ steps.changelog.outputs.log }}" >> tmp_changelog.md | |
| echo "" >> tmp_changelog.md | |
| cat CHANGELOG.md >> tmp_changelog.md 2>/dev/null || true | |
| mv tmp_changelog.md CHANGELOG.md | |
| - name: Set up PHP | |
| uses: shivammathur/setup-php@v2 | |
| with: | |
| php-version: "8.4" | |
| extensions: phar | |
| - name: Build .phar | |
| run: | | |
| php -d phar.readonly=0 build-phar.php | |
| - name: Create GitHub Release | |
| uses: softprops/action-gh-release@v2 | |
| with: | |
| body: ${{ steps.changelog.outputs.log }} | |
| files: bootzen-*.phar | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GH_PAT }} |