feat(release): adding multi arch #56
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: Release | |
on: | |
push: | |
tags: | |
- "*" | |
permissions: | |
contents: write | |
packages: write | |
id-token: write | |
jobs: | |
release-ha: | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
goarch: | |
- amd64_v1 | |
- 386 | |
- arm64 | |
- arm_7 | |
goos: | |
- linux | |
include: | |
- goarch: amd64_v1 | |
haarch: amd64 | |
- goarch: 386 | |
haarch: i386 | |
- goarch: arm64 | |
haarch: aarch64 | |
- goarch: arm_7 | |
haarch: armv7 | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- name: Set up Go | |
uses: actions/setup-go@v4 | |
- name: GoReleaser Install | |
uses: goreleaser/goreleaser-action@v5 | |
with: | |
install-only: true | |
- name: GoReleaser Build | |
run: | | |
mkdir -p home-assistant/addons/sbam/bin/${{matrix.haarch}} | |
goreleaser build --clean --single-target --id sbam --output home-assistant/addons/sbam/bin/${{matrix.haarch}} | |
env: | |
GOOS: ${{matrix.goos}} | |
GOARCH: ${{matrix.goarch}} | |
GOARM: 7 | |
CGO_ENABLED: 0 | |
- name: GoReleaser Publish | |
run: goreleaser publish | |
env: | |
GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}" | |
- name: Login to GitHub Container Registry | |
uses: docker/login-action@v3 | |
with: | |
registry: ghcr.io | |
username: ${{ github.actor }} | |
password: ${{ secrets.GITHUB_TOKEN }} | |
- name: Publish build - Home Assistant builder | |
uses: home-assistant/[email protected] | |
with: | |
args: | | |
--${{matrix.haarch}} \ | |
--target /data/home-assistant/addons/sbam/${{matrix.haarch}} \ | |
--addon | |
release-os: | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
goarch: | |
- amd64_v1 | |
- 386 | |
- arm64 | |
- arm_7 | |
goos: | |
- windows | |
- darwin | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- name: Set up Go | |
uses: actions/setup-go@v4 | |
- name: GoReleaser Build | |
run: goreleaser build --clean --single-target --id sbam | |
env: | |
GOOS: ${{matrix.goos}} | |
GOARCH: ${{matrix.goarch}} | |
GOARM: 7 | |
CGO_ENABLED: 0 | |
- name: GoReleaser Publish | |
run: goreleaser publish | |
env: | |
GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}" |