Skip to content

Commit

Permalink
Create release.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
iprak authored Aug 25, 2024
1 parent 3ab3006 commit 2f6de17
Showing 1 changed file with 46 additions and 0 deletions.
46 changes: 46 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
name: Release
on:
workflow_dispatch:

jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- name: Gets semantic release info
id: semantic_release_info
uses: jossef/action-semantic-release-info@v2.1.0
env:
GITHUB_TOKEN: ${{ github.token }}

- name: Update Version and Commit
if: ${{steps.semantic_release_info.outputs.version != ''}}
run: |
echo "Version: ${{steps.semantic_release_info.outputs.version}}"
sed -i "s/\"version\": \".*\"/\"version\": \"${{steps.semantic_release_info.outputs.version}}\"/g" custom_components/sensi/manifest.json
git config --local user.email "action@github.com"
git config --local user.name "GitHub Action"
git add -A
git commit -m "docs(): bumping release ${{ steps.semantic_release_info.outputs.git_tag }}"
git tag ${{ steps.semantic_release_info.outputs.git_tag }}
- name: Push changes
if: ${{steps.semantic_release_info.outputs.version != ''}}
uses: ad-m/github-push-action@v0.8.0
with:
github_token: ${{ github.token }}
tags: true

- name: Create GitHub Release
if: ${{steps.semantic_release_info.outputs.version != ''}}
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ github.token }}
with:
tag_name: ${{ steps.semantic_release_info.outputs.git_tag }}
release_name: ${{ steps.semantic_release_info.outputs.git_tag }}
body: ${{ steps.semantic_release_info.outputs.notes }}
draft: false
prerelease: false

0 comments on commit 2f6de17

Please sign in to comment.