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", "armv7", "aarch64"] steps: - name: Checkout the repository uses: actions/checkout@v5.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@v3.5.0 with: registry: ghcr.io username: ${{ github.repository_owner }} password: ${{ secrets.GITHUB_TOKEN }} - name: Build and publish uses: home-assistant/builder@2025.03.0 with: args: | --${{ matrix.arch }} \ --version ${{ env.latest_release }} \ --target /data/ \ --addon