Skip to content

Merge branch 'main' of github.com:joshuar/go-hass-agent #564

Merge branch 'main' of github.com:joshuar/go-hass-agent

Merge branch 'main' of github.com:joshuar/go-hass-agent #564

name: Update/Build release
on:
push:
branches: [ main ]
permissions:
contents: write
pull-requests: write
jobs:
release_please:
runs-on: ubuntu-latest
steps:
- name: Run release please
uses: google-github-actions/release-please-action@v4
id: release_please
with:
release-type: go
token: ${{ secrets.GITHUB_TOKEN }}
- name: Checkout source
uses: actions/checkout@v4
if: ${{ steps.release_please.outputs.release_created }}
with:
fetch-depth: 0
- name: Enable multi-arch
if: ${{ steps.release_please.outputs.release_created }}
id: enable_multiarch
run: |
sudo dpkg --add-architecture armhf
sudo dpkg --add-architecture arm64
sudo sed -i 's|^deb\s|deb [arch=amd64] |g' /etc/apt/sources.list
sudo cat << EOF >> /etc/apt/sources.list
deb [arch=armhf,arm64] http://ports.ubuntu.com/ubuntu-ports/ jammy main
#deb-src http://ports.ubuntu.com/ubuntu-ports/ jammy main
deb [arch=armhf,arm64] http://ports.ubuntu.com/ubuntu-ports/ jammy-updates main
#deb-src http://ports.ubuntu.com/ubuntu-ports/ jammy-updates main
deb [arch=armhf,arm64] http://ports.ubuntu.com/ubuntu-ports/ jammy-security main
#deb-src http://ports.ubuntu.com/ubuntu-ports/ jammy-security main
EOF
- name: Install/Cache build dependencies
if: ${{ steps.release_please.outputs.release_created }}
id: cache_pkg_deps
uses: awalsh128/cache-apt-pkgs-action@latest
with:
packages: >
desktop-file-utils gcc gcc-arm-none-eabi gcc-arm-linux-gnueabihf gcc-aarch64-linux-gnu
libgl-dev:amd64 libx11-dev:amd64 libxrandr-dev:amd64 libxxf86vm-dev:amd64 libxi-dev:amd64 libxcursor-dev:amd64 libxinerama-dev:amd64 libxkbcommon-dev:amd64
libgl-dev:armhf libx11-dev:armhf libxrandr-dev:armhf libxxf86vm-dev:armhf libxi-dev:armhf libxcursor-dev:armhf libxinerama-dev:armhf libxkbcommon-dev:armhf
libgl-dev:arm64 libx11-dev:arm64 libxrandr-dev:arm64 libxxf86vm-dev:arm64 libxi-dev:arm64 libxcursor-dev:arm64 libxinerama-dev:arm64 libxkbcommon-dev:arm64
- name: Setup Go
if: ${{ steps.release_please.outputs.release_created }}
id: setup_go
uses: actions/setup-go@v5
with:
go-version: '^1.22'
- name: Install Go dependencies
if: ${{ steps.release_please.outputs.release_created }}
id: install_go_deps
run: |
go install golang.org/x/tools/cmd/stringer@latest
go install github.com/fyne-io/fyne-cross@latest
go install golang.org/x/text/cmd/gotext@latest
go install github.com/matryer/moq@latest
- name: install cosign
if: ${{ steps.release_please.outputs.release_created }}
id: install_cosign
uses: sigstore/[email protected]
with:
cosign-release: 'v2.2.2'
- name: Run Go Releaser
uses: goreleaser/goreleaser-action@v5
if: ${{ steps.release_please.outputs.release_created }}
id: run_goreleaser
with:
distribution: goreleaser
version: latest
args: release --clean
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
COSIGN_PWD: ${{ secrets.COSIGN_PWD }}