-
Notifications
You must be signed in to change notification settings - Fork 4
110 lines (97 loc) · 2.47 KB
/
release.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
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 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 }}"