mirror of
https://github.com/lildude/ha-addon-teslamate.git
synced 2026-10-13 21:19:16 -04:00
Update, refactor and restructure repo (#1)
* Remove unused files * Update dev env * Update config * Update docker config * Add translations * Update run script * Auto-gen enc key if not set * Replace workflows * Replace dependabot with renovate * Remove armhf * Lint * Remove armhf * Whoops * Remove stray comma * Add image * Reorder options * Split and improve docs * Add back image line * Update cw * Typo * Use correct org * Move bootstrap to run * Update scripts * Update config * Add note about database * Label in dockerfile * tmp force devcontainer version * Start implementing db creation if not exists * Create DB if doesn't exist * Update words * Remove unused file
This commit is contained in:
@@ -0,0 +1,80 @@
|
||||
on:
|
||||
workflow_dispatch:
|
||||
inputs:
|
||||
semverIncrement:
|
||||
description: Increment major/minor/patch using values of m/i/p
|
||||
required: true
|
||||
default: i
|
||||
|
||||
name: Releaser
|
||||
|
||||
jobs:
|
||||
release:
|
||||
name: Create Release
|
||||
runs-on: ubuntu-latest
|
||||
outputs:
|
||||
version: ${{ steps.semver.outputs.semver }}
|
||||
permissions:
|
||||
contents: write
|
||||
packages: write
|
||||
steps:
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@v4
|
||||
with:
|
||||
path: teslamate
|
||||
token: ${{ secrets.GITHUB_TOKEN }}
|
||||
- name: Get latest release
|
||||
run: |
|
||||
echo "latest_release=$(curl --header "Authorization: Bearer ${{ secrets.GITHUB_TOKEN }}" --silent https://api.github.com/repos/$GITHUB_REPOSITORY/releases/latest | jq -r .tag_name | sed s/v// )" >> $GITHUB_ENV
|
||||
- name: Increment semver
|
||||
id: semver
|
||||
uses: matt-FFFFFF/simple-semver@v0.1.1
|
||||
with:
|
||||
semver-input: ${{ env.latest_release }}
|
||||
increment: ${{ github.event.inputs.semverIncrement }}
|
||||
- name: Create tag
|
||||
run: |
|
||||
git config --global user.email "actions.no-reply@github.com"
|
||||
git config --global user.name "GitHub Actions"
|
||||
git tag -a v${{ steps.semver.outputs.semver }} -m 'Release automation'
|
||||
git push --tags
|
||||
working-directory: ${{ github.workspace }}/teslamate
|
||||
- name: Create release
|
||||
uses: softprops/action-gh-release@v2.0.4
|
||||
with:
|
||||
tag_name: v${{ steps.semver.outputs.semver }}
|
||||
generate_release_notes: true
|
||||
draft: false
|
||||
prerelease: false
|
||||
token: ${{ secrets.GITHUB_TOKEN }}
|
||||
- name: Checkout addon repo
|
||||
uses: actions/checkout@v4.1.4
|
||||
with:
|
||||
path: repo
|
||||
repository: lildude/ha-addons
|
||||
token: ${{ secrets.HA_ADDONS_PAT }}
|
||||
|
||||
- name: Update addon repo
|
||||
run: |
|
||||
cp -vf ${{ github.workspace }}/teslamate/*.png ${{ github.workspace }}/repo/teslamate
|
||||
cp -vf ${{ github.workspace }}/teslamate/*.md ${{ github.workspace }}/repo/teslamate
|
||||
jq '.version="${{ steps.semver.outputs.semver }}"' < ${{ github.workspace }}/teslamate/config.json > ${{ github.workspace }}/repo/teslamate/config.json
|
||||
echo "$(curl --silent --header "Authorization: Bearer ${{ secrets.GITHUB_TOKEN }}" https://api.github.com/repos/$GITHUB_REPOSITORY/releases/latest | jq -r .body)" > ${{ github.workspace }}/repo/teslamate/CHANGELOG.md
|
||||
- name: Add changes to addon repo
|
||||
run: |
|
||||
if [ "$(git status -s)" ]; then
|
||||
git add .
|
||||
git commit -m 'Update ha-addon-teslamate to v${{ steps.semver.outputs.semver }}'
|
||||
git push
|
||||
fi
|
||||
working-directory: ${{ github.workspace }}/repo/teslamate
|
||||
|
||||
build:
|
||||
name: Build addon
|
||||
needs: release
|
||||
permissions:
|
||||
contents: read
|
||||
packages: write
|
||||
uses: ./.github/workflows/publisher.yaml
|
||||
with:
|
||||
version: ${{ needs.release.outputs.version }}
|
||||
Reference in New Issue
Block a user