-
-
Notifications
You must be signed in to change notification settings - Fork 97
54 lines (47 loc) · 1.61 KB
/
build.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
name: build
on:
push:
branches: ["master"]
release:
types: ["published"]
pull_request:
branches: ["master"]
env:
GOLANG_VERSION: "1.19"
jobs:
build:
name: Build ${{ matrix.variant.name }}
runs-on: ubuntu-latest
strategy:
matrix:
variant:
- {"name": "ha_i386", "args": "GOARCH=386"}
- {"name": "ha_amd64", "args": "GOARCH=amd64"}
- {"name": "ha_armhf", "args": "GOARM=6 GOARCH=arm"}
- {"name": "ha_armv7", "args": "GOARM=7 GOARCH=arm"}
- {"name": "ha_aarch64", "args": "GOARCH=arm64"}
steps:
- name: Checkout the repository
uses: actions/[email protected]
- name: Setup go ${{ env.GOLANG_VERSION }}
uses: actions/[email protected]
with:
go-version: ${{ env.GOLANG_VERSION }}
- name: Build ${{ matrix.variant.name }}
run: CGO_ENABLED=0 ${{ matrix.variant.args }} go build -ldflags="-s -w" -o "${{ matrix.variant.name }}"
- name: Upload release asset
if: github.event_name == 'release'
uses: actions/[email protected]
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ github.event.release.upload_url }}
asset_path: "${{ github.workspace }}/${{ matrix.variant.name }}"
asset_name: ${{ matrix.variant.name }}
asset_content_type: application/x-binary
- name: Signing asset
if: github.event_name == 'release'
uses: home-assistant/actions/helpers/codenotary@master
with:
source: "file://${{ github.workspace }}/${{ matrix.variant.name }}"
token: ${{ secrets.CAS_TOKEN }}