2020-07-28 23:20:29 +02:00
|
|
|
name: Publish Release
|
|
|
|
|
|
|
|
on:
|
|
|
|
workflow_dispatch:
|
|
|
|
inputs:
|
|
|
|
version:
|
|
|
|
description: The version to release
|
|
|
|
required: true
|
2023-01-25 23:54:39 +01:00
|
|
|
content:
|
|
|
|
description: The content of the release-notes
|
|
|
|
required: true
|
2020-07-28 23:20:29 +02:00
|
|
|
|
|
|
|
jobs:
|
|
|
|
create-release:
|
|
|
|
runs-on: ubuntu-latest
|
2021-12-21 04:35:39 +01:00
|
|
|
continue-on-error: true
|
2020-07-28 23:20:29 +02:00
|
|
|
steps:
|
2024-05-18 13:58:10 +02:00
|
|
|
- uses: actions/checkout@v4.1.6
|
2024-05-07 10:50:40 +02:00
|
|
|
- uses: actions/setup-python@v5.1.0
|
2024-04-17 05:32:13 +02:00
|
|
|
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 }}
|
2023-01-25 23:54:39 +01:00
|
|
|
|
2024-04-17 05:32:13 +02:00
|
|
|
${{ 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 }}
|
2023-01-25 23:54:39 +01:00
|
|
|
|
2024-04-17 05:32:13 +02:00
|
|
|
${{ 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 }}
|