release(project): bump to v0.1.11 #2
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: | |
branches: | |
- master | |
permissions: | |
contents: write | |
jobs: | |
release: | |
if: contains(github.event.head_commit.message, 'release(project)') | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
- name: Read version from file | |
id: get_version | |
run: | | |
VERSION=$(cat .project-version | tr -d '[:space:]') | |
echo "version=$VERSION" >> $GITHUB_OUTPUT | |
- name: Check if tag exists | |
id: check_tag | |
run: | | |
if git ls-remote --tags origin | grep -q "refs/tags/v${{ steps.get_version.outputs.version }}"; then | |
echo "exists=true" >> $GITHUB_OUTPUT | |
else | |
echo "exists=false" >> $GITHUB_OUTPUT | |
fi | |
- name: Create Git tag | |
if: steps.check_tag.outputs.exists == 'false' | |
run: | | |
git config user.name "github-actions[bot]" | |
git config user.email "github-actions[bot]@users.noreply.github.com" | |
git tag -a "v${{ steps.get_version.outputs.version }}" -m "v${{ steps.get_version.outputs.version }}" | |
git push origin "v${{ steps.get_version.outputs.version }}" | |
- name: Create GitHub Release | |
if: steps.check_tag.outputs.exists == 'false' | |
uses: softprops/action-gh-release@v2 | |
with: | |
tag_name: v${{ steps.get_version.outputs.version }} | |
name: v${{ steps.get_version.outputs.version }} | |
generate_release_notes: true | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |