home-assistant-addon/.github/workflows/bump-version.yml

60 lines
1.8 KiB
YAML
Raw Normal View History

name: Publish Release
on:
workflow_dispatch:
inputs:
version:
description: The version to release
required: true
content:
description: The content of the release-notes
required: true
jobs:
create-release:
runs-on: ubuntu-latest
2021-12-21 04:35:39 +01:00
continue-on-error: true
steps:
- uses: actions/checkout@v3.5.2
2022-07-06 22:08:00 +02:00
- uses: actions/setup-python@v4
with:
python-version: '3.x'
- run: pip install -r script/requirements.txt
- run: script/bump-version.py ${{ github.event.inputs.version }}
- name: Write Beta changelog
run: |
cat > esphome-beta/CHANGELOG.md << 'EOF'
## ${{ github.event.inputs.version }}
${{ github.event.inputs.content }}
EOF
- name: Write Stable changelog
if: ${{ !contains(github.event.inputs.version, 'b') }}
run: |
cat > esphome/CHANGELOG.md << 'EOF'
## ${{ github.event.inputs.version }}
${{ github.event.inputs.content }}
EOF
2020-09-14 03:39:16 +02:00
- name: Commit version bump
id: commit_version
run: |
2020-07-29 20:55:58 +02:00
git config user.name esphomebot
2021-05-03 01:49:37 +02:00
git config user.email esphome@nabucasa.com
git add .
2022-02-10 20:05:04 +01:00
git commit -m "Bump version to ${{ github.event.inputs.version }}"
git push
2020-09-14 03:39:16 +02:00
COMMIT=$(git rev-parse HEAD)
echo "::set-output name=commit_sha::${COMMIT}"
2023-01-26 00:01:29 +01:00
- name: Create a Release
2022-07-06 22:08:00 +02:00
uses: actions/create-release@v1.1.4
continue-on-error: true
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
2022-02-21 01:37:27 +01:00
tag_name: ${{ github.event.inputs.version }}
release_name: ${{ github.event.inputs.version }}
body: ${{ github.event.inputs.content }}
2023-01-26 00:01:29 +01:00
prerelease: ${{ contains(github.event.inputs.version, 'b') }}
2021-05-03 01:49:37 +02:00
commitish: ${{ steps.commit_version.outputs.commit_sha }}