Skip to content

Commit

Permalink
Automate Hassio releases (evcc-io#4461)
Browse files Browse the repository at this point in the history
  • Loading branch information
thecem authored Sep 16, 2022
1 parent ced77c4 commit bd89d09
Show file tree
Hide file tree
Showing 3 changed files with 43 additions and 54 deletions.
27 changes: 27 additions & 0 deletions .github/workflows/nightly.yml
Original file line number Diff line number Diff line change
Expand Up @@ -93,3 +93,30 @@ jobs:
env:
CLOUDSMITH_API_KEY: ${{ secrets.CLOUDSMITH_API_KEY }}
run: make apt-nightly

hassio:
name: Hassio Addon
needs:
- docker
runs-on: ubuntu-latest

steps:
- name: Checkout
uses: actions/checkout@master
with:
repository: evcc-io/hassio-addon
token: ${{ secrets.GH_TOKEN }}
path: ./hassio

- name: Update version
run: |
sed -i -e s#.*version.*#' "version": "nightly-'$(date +'%Y%m%d%H%M%S')'",'# ./hassio/evcc-nightly/config.json
- name: Push
run: |
cd ./hassio
git add .
git config user.name github-actions
git config user.email [email protected]
git commit -am "config.json updated from Project evcc release"
git push
26 changes: 16 additions & 10 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -102,17 +102,23 @@ jobs:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- name: Checkout
uses: actions/checkout@master
with:
repository: evcc-io/hassio-addon
token: ${{ secrets.GH_TOKEN }}
path: ./hassio

- name: Update version
run: |
sed -i -e s#0.0.0#$(echo ${{ env.GITHUB_REF }} | sed -e s#refs/tags/##)# packaging/hassio/config.json
export RELEASE_VERSION=$(echo ${{ github.ref }} | sed -e s#refs/tags/v##)
sed -i -e s#.*version.*#' "version": "'$RELEASE_VERSION'",'# ./hassio/evcc/config.json
- name: Copy config to hassio-addon
uses: andstor/copycat-action@v3
with:
personal_token: ${{ secrets.GH_TOKEN }}
src_path: packaging/hassio/config.json
dst_path: /evcc/config.json
dst_owner: evcc-io
dst_repo_name: hassio-addon
- name: Push
run: |
cd ./hassio
git add .
git config user.name github-actions
git config user.email [email protected]
git commit -am "Mirror evcc release"
git push
44 changes: 0 additions & 44 deletions packaging/hassio/config.json

This file was deleted.

0 comments on commit bd89d09

Please sign in to comment.