2020-07-28 23:20:29 +02:00
|
|
|
name: Publish Release
|
|
|
|
|
|
|
|
on:
|
|
|
|
workflow_dispatch:
|
|
|
|
inputs:
|
|
|
|
version:
|
|
|
|
description: The version to release
|
|
|
|
required: true
|
|
|
|
|
|
|
|
jobs:
|
|
|
|
create-release:
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@v2
|
|
|
|
- uses: actions/setup-python@v2
|
|
|
|
with:
|
|
|
|
python-version: '3.x'
|
|
|
|
- run: pip install -r script/requirements.txt
|
|
|
|
- run: script/bump-version.py ${{ github.event.inputs.version }}
|
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
|
|
|
|
git config user.email contact@esphome.io
|
2020-07-28 23:20:29 +02:00
|
|
|
git add .
|
|
|
|
git commit -m "Bump version to v${{ 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}"
|
2020-07-28 23:20:29 +02:00
|
|
|
- if: ${{ contains(github.event.inputs.version, 'b') }}
|
|
|
|
name: Create Beta Release
|
|
|
|
uses: actions/create-release@v1
|
|
|
|
env:
|
|
|
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
|
|
with:
|
|
|
|
tag_name: v${{ github.event.inputs.version }}
|
|
|
|
release_name: ${{ github.event.inputs.version }}
|
|
|
|
body: 'See https://beta.esphome.io/changelog/index.html'
|
|
|
|
prerelease: true
|
2020-09-14 03:39:16 +02:00
|
|
|
commitish: ${{ steps.commit_version.outputs.commit_sha }}
|
2020-07-28 23:20:29 +02:00
|
|
|
- if: ${{ !contains(github.event.inputs.version, 'b') }}
|
|
|
|
name: Create Stable Release
|
|
|
|
uses: actions/create-release@v1
|
|
|
|
env:
|
|
|
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
|
|
with:
|
|
|
|
tag_name: v${{ github.event.inputs.version }}
|
|
|
|
release_name: ${{ github.event.inputs.version }}
|
|
|
|
body: 'See https://esphome.io/changelog/index.html'
|
|
|
|
prerelease: false
|
2020-09-14 03:39:16 +02:00
|
|
|
commitish: ${{ steps.commit_version.outputs.commit_sha }}
|
2020-07-28 23:20:29 +02:00
|
|
|
|
|
|
|
|
|
|
|
deploy-community-addons:
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
needs: [create-release]
|
|
|
|
steps:
|
2021-02-24 20:29:09 +01:00
|
|
|
- name: Publish beta release to community-addons repository
|
2020-07-28 23:20:29 +02:00
|
|
|
run: |
|
2020-07-29 20:51:00 +02:00
|
|
|
docker run --rm hassioaddons/repository-updater:latest \
|
2020-07-28 23:20:29 +02:00
|
|
|
--repository hassio-addons/repository-beta \
|
|
|
|
--addon esphome \
|
|
|
|
--token "${TOKEN}"
|
|
|
|
env:
|
|
|
|
TOKEN: ${{ secrets.COMMUNITY_ADDONS_TOKEN }}
|
|
|
|
- if: ${{ !contains(github.event.inputs.version, 'b') }}
|
|
|
|
name: Publish stable release to community-addons repository
|
|
|
|
run: |
|
2020-07-29 20:51:00 +02:00
|
|
|
docker run --rm hassioaddons/repository-updater:latest \
|
2020-07-28 23:20:29 +02:00
|
|
|
--repository hassio-addons/repository \
|
|
|
|
--addon esphome \
|
|
|
|
--token "${TOKEN}"
|
|
|
|
env:
|
|
|
|
TOKEN: ${{ secrets.COMMUNITY_ADDONS_TOKEN }}
|