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:
|
2023-09-08 08:05:21 +02:00
|
|
|
- uses: actions/checkout@v4.0.0
|
2022-07-06 22:08:00 +02:00
|
|
|
- uses: actions/setup-python@v4
|
2020-07-28 23:20:29 +02:00
|
|
|
with:
|
|
|
|
python-version: '3.x'
|
|
|
|
- run: pip install -r script/requirements.txt
|
|
|
|
- run: script/bump-version.py ${{ github.event.inputs.version }}
|
2023-01-25 23:54:39 +01:00
|
|
|
- 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
|
2020-07-28 23:20:29 +02:00
|
|
|
git add .
|
2022-02-10 20:05:04 +01:00
|
|
|
git commit -m "Bump version to ${{ github.event.inputs.version }}"
|
2020-07-28 23:20:29 +02:00
|
|
|
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
|
2021-12-21 04:32:49 +01:00
|
|
|
continue-on-error: true
|
2020-07-28 23:20:29 +02:00
|
|
|
env:
|
|
|
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
|
|
with:
|
2022-02-21 01:37:27 +01:00
|
|
|
tag_name: ${{ github.event.inputs.version }}
|
2020-07-28 23:20:29 +02:00
|
|
|
release_name: ${{ github.event.inputs.version }}
|
2023-01-25 23:54:39 +01:00
|
|
|
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 }}
|