Skip to content

Update release.yml

Update release.yml #2

Workflow file for this run

name: Release
on:
push:
tags:
- 'v*'
jobs:
release:
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- uses: actions/checkout@v4
- name: Update version.txt and recreate tag
run: |
TAG=${GITHUB_REF#refs/tags/}
VERSION=${TAG#v}
echo $VERSION > version.txt
git config user.name "github-actions[bot]"
git config user.email "github-actions[bot]@users.noreply.github.com"
git add version.txt
git diff --staged --quiet || git commit -m "chore: bump version to $VERSION"
git tag -d $TAG
git push origin --delete $TAG
# Recrée le tag sur le nouveau commit
git tag $TAG
# Push le commit et le nouveau tag
git push origin HEAD:main
git push origin $TAG
- name: Create Release
uses: softprops/action-gh-release@v1
with:
generate_release_notes: true
prerelease: true