mirror of
https://github.com/esphome/home-assistant-addon.git
synced 2024-11-27 12:46:08 +01:00
4956129c8a
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
62 lines
2.1 KiB
YAML
62 lines
2.1 KiB
YAML
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
|
|
continue-on-error: true
|
|
steps:
|
|
- uses: actions/checkout@v4.2.2
|
|
- uses: actions/setup-python@v5.3.0
|
|
with:
|
|
python-version: "3.11"
|
|
- run: pip install -r script/requirements.txt
|
|
- run: script/bump-version.py ${{ github.event.inputs.version }}
|
|
- name: Write Beta changelog
|
|
if: ${{ !contains(github.event.inputs.version, 'dev') }}
|
|
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') && !contains(github.event.inputs.version, 'dev') }}
|
|
run: |
|
|
cat > esphome/CHANGELOG.md << 'EOF'
|
|
## ${{ github.event.inputs.version }}
|
|
|
|
${{ github.event.inputs.content }}
|
|
EOF
|
|
- name: Commit version bump
|
|
id: commit_version
|
|
run: |
|
|
git config user.name esphomebot
|
|
git config user.email esphome@nabucasa.com
|
|
git add .
|
|
git commit -m "Bump version to ${{ github.event.inputs.version }}"
|
|
git push
|
|
COMMIT=$(git rev-parse HEAD)
|
|
echo "::set-output name=commit_sha::${COMMIT}"
|
|
- name: Create a Release
|
|
uses: actions/create-release@v1.1.4
|
|
continue-on-error: true
|
|
if: ${{ !contains(github.event.inputs.version, 'dev') }}
|
|
env:
|
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
with:
|
|
tag_name: ${{ github.event.inputs.version }}
|
|
release_name: ${{ github.event.inputs.version }}
|
|
body: ${{ github.event.inputs.content }}
|
|
prerelease: ${{ contains(github.event.inputs.version, 'b') }}
|
|
commitish: ${{ steps.commit_version.outputs.commit_sha }}
|