mirror of
https://github.com/lildude/ha-addon-teslamate.git
synced 2026-10-13 13:10:30 -04:00
52 lines
1.4 KiB
YAML
52 lines
1.4 KiB
YAML
name: "Publish"
|
|
|
|
on:
|
|
release:
|
|
types: [published]
|
|
workflow_dispatch:
|
|
workflow_call:
|
|
inputs:
|
|
version:
|
|
required: false
|
|
type: string
|
|
|
|
jobs:
|
|
publish:
|
|
name: Publish
|
|
runs-on: ubuntu-latest
|
|
permissions:
|
|
contents: read
|
|
packages: write
|
|
strategy:
|
|
matrix:
|
|
arch: ["amd64", "aarch64"]
|
|
|
|
steps:
|
|
- name: Checkout the repository
|
|
uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
|
|
|
|
- name: Get version
|
|
run: |
|
|
version=${{ inputs.version }}
|
|
if [ -n "$version" ]; then
|
|
echo "latest_release=$version" >> $GITHUB_ENV
|
|
else
|
|
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
|
|
fi
|
|
|
|
- name: Login to GitHub Container Registry
|
|
uses: docker/login-action@650006c6eb7dba73a995cc03b0b2d7f5ca915bee # v4.2.0
|
|
with:
|
|
registry: ghcr.io
|
|
username: ${{ github.repository_owner }}
|
|
password: ${{ secrets.GITHUB_TOKEN }}
|
|
|
|
- name: Build and publish
|
|
uses: home-assistant/builder@62a1597b84b3461abad9816d9cd92862a2b542c3 # 2026.03.2
|
|
with:
|
|
args: |
|
|
--${{ matrix.arch }} \
|
|
--version ${{ env.latest_release }} \
|
|
--target /data/ \
|
|
--addon
|