adding workflow
This commit is contained in:
@@ -0,0 +1,45 @@
|
||||
name: Create Release
|
||||
|
||||
on:
|
||||
workflow_dispatch:
|
||||
inputs:
|
||||
version:
|
||||
description: 'Release version (e.g., 1.1.5)'
|
||||
required: true
|
||||
type: string
|
||||
|
||||
permissions:
|
||||
contents: write
|
||||
|
||||
jobs:
|
||||
release:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout code
|
||||
uses: actions/checkout@v4
|
||||
with:
|
||||
token: ${{ secrets.GITHUB_TOKEN }}
|
||||
|
||||
- name: Update manifest.json
|
||||
run: |
|
||||
sed -i 's/"version": ".*"/"version": "${{ github.event.inputs.version }}"/' custom_components/boiler_aux_heater_3phase/manifest.json
|
||||
|
||||
- name: Commit manifest change
|
||||
run: |
|
||||
git config user.name "gitea-actions[bot]"
|
||||
git config user.email "gitea-actions[bot]@noreply"
|
||||
git add custom_components/boiler_aux_heater_3phase/manifest.json
|
||||
git commit -m "Bump version to ${{ github.event.inputs.version }}"
|
||||
git push
|
||||
|
||||
- name: Create tag
|
||||
run: |
|
||||
git tag v${{ github.event.inputs.version }}
|
||||
git push origin v${{ github.event.inputs.version }}
|
||||
|
||||
- name: Create Gitea Release
|
||||
run: |
|
||||
curl -s -X POST "${GITEA_SERVER_URL}/api/v1/repos/${GITHUB_REPOSITORY}/releases" \
|
||||
-H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" \
|
||||
-H "Content-Type: application/json" \
|
||||
-d "{\"tag_name\":\"v${{ github.event.inputs.version }}\",\"name\":\"v${{ github.event.inputs.version }}\",\"draft\":true,\"prerelease\":false}"
|
||||
Reference in New Issue
Block a user