Bump actions/checkout from 4.0.0 to 4.1.0 #231
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Build plugin | |
on: | |
pull_request: | |
branches: ["master"] | |
release: | |
types: ["published"] | |
push: | |
branches: ["master"] | |
paths: | |
- Dockerfile | |
- build.yaml | |
- 'rootfs/**' | |
- '**.go' | |
- go.mod | |
env: | |
BUILD_NAME: observer | |
BUILD_TYPE: plugin | |
jobs: | |
init: | |
name: Initialize build | |
runs-on: ubuntu-latest | |
outputs: | |
architectures: ${{ steps.info.outputs.architectures }} | |
version: ${{ steps.version.outputs.version }} | |
channel: ${{ steps.version.outputs.channel }} | |
publish: ${{ steps.version.outputs.publish }} | |
steps: | |
- name: Checkout the repository | |
uses: actions/[email protected] | |
with: | |
fetch-depth: 0 | |
- name: Get information | |
id: info | |
uses: home-assistant/actions/helpers/info@master | |
- name: Get version | |
id: version | |
uses: home-assistant/actions/helpers/version@master | |
with: | |
type: ${{ env.BUILD_TYPE }} | |
build: | |
name: Build ${{ matrix.arch }} plugin | |
needs: init | |
runs-on: ubuntu-latest | |
permissions: | |
contents: read | |
packages: write | |
id-token: write | |
strategy: | |
matrix: | |
arch: ${{ fromJson(needs.init.outputs.architectures) }} | |
steps: | |
- name: Checkout the repository | |
uses: actions/[email protected] | |
- name: Login to GitHub Container Registry | |
if: needs.init.outputs.publish == 'true' | |
uses: docker/[email protected] | |
with: | |
registry: ghcr.io | |
username: ${{ secrets.GIT_USER }} | |
password: ${{ secrets.GIT_TOKEN }} | |
- name: Set build arguments | |
if: needs.init.outputs.publish == 'false' | |
run: echo "BUILD_ARGS=--test" >> $GITHUB_ENV | |
- name: Build plugin | |
uses: home-assistant/[email protected] | |
with: | |
args: | | |
$BUILD_ARGS \ | |
--${{ matrix.arch }} \ | |
--cosign \ | |
--target /data \ | |
--generic ${{ needs.init.outputs.version }} | |
env: | |
CAS_API_KEY: ${{ secrets.CAS_TOKEN }} | |
version: | |
name: Update version | |
needs: ["init", "build"] | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout the repository | |
if: needs.init.outputs.publish == 'true' | |
uses: actions/[email protected] | |
- name: Initialize git | |
if: needs.init.outputs.publish == 'true' | |
uses: home-assistant/actions/helpers/git-init@master | |
with: | |
name: ${{ secrets.GIT_NAME }} | |
email: ${{ secrets.GIT_EMAIL }} | |
token: ${{ secrets.GIT_TOKEN }} | |
- name: Update version file | |
if: needs.init.outputs.publish == 'true' | |
uses: home-assistant/actions/helpers/version-push@master | |
with: | |
key: ${{ env.BUILD_NAME }} | |
version: ${{ needs.init.outputs.version }} | |
channel: ${{ needs.init.outputs.channel }} |