-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
13c62cb
commit be62f3a
Showing
9 changed files
with
57 additions
and
16 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,6 +8,7 @@ on: | |
permissions: | ||
contents: write | ||
packages: write | ||
id-token: write | ||
|
||
jobs: | ||
goreleaser: | ||
|
@@ -19,17 +20,28 @@ jobs: | |
fetch-depth: 0 | ||
- name: Set up Go | ||
uses: actions/setup-go@v4 | ||
- name: Login to GitHub Container Registry | ||
uses: docker/login-action@v3 | ||
with: | ||
registry: ghcr.io | ||
username: ${{ github.actor }} | ||
password: ${{ secrets.GITHUB_TOKEN }} | ||
- name: Run GoReleaser | ||
uses: goreleaser/goreleaser-action@v5 | ||
with: | ||
distribution: goreleaser | ||
version: latest | ||
args: release --clean | ||
env: | ||
GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}" | ||
GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}" | ||
- name: copy binary to local ha folder | ||
run: | | ||
mkdir home-assistant/addons/sbam/bin/ | ||
cp -v dist/sbam_linux_amd64_v1/bin/sbam home-assistant/addons/sbam/bin/ | ||
- 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: | | ||
--amd64 \ | ||
--target /data/home-assistant/addons/sbam |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,7 +8,7 @@ | |
*.so | ||
*.dylib | ||
bin/ | ||
|
||
home-assistant/addons/sbam/bin/ | ||
# Test binary, built with `go test -c` | ||
*.test | ||
|
||
|
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
This file was deleted.
Oops, something went wrong.
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
build_from: | ||
amd64: "homeassistant/amd64-base-debian:buster" | ||
squash: false, | ||
args: {} |
Empty file.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
#!/bin/bash | ||
|
||
BUILDCONTAINER_DATA_PATH="/data" | ||
PATHTOBUILD="$BUILDCONTAINER_DATA_PATH" | ||
ARCH=amd64 | ||
|
||
|
||
PROJECTDIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )/sbam | ||
ROOTDIR=$PROJECTDIR/../../../ | ||
cd $PRROOTDIROJECTDIR/../../../ | ||
make build | ||
cd - | ||
|
||
|
||
rm -rf $PROJECTDIR/bin | ||
mkdir -p $PROJECTDIR/bin | ||
cp $ROOTDIR/bin/sbam $PROJECTDIR/bin/ | ||
|
||
echo "project directory is $PROJECTDIR" | ||
echo "build container data path is $BUILDCONTAINER_DATA_PATH" | ||
echo "build container target build path is $PATHTOBUILD" | ||
CMD="docker run --rm -ti --name hassio-builder --privileged -v $PROJECTDIR:$BUILDCONTAINER_DATA_PATH -v /var/run/docker.sock:/var/run/docker.sock:ro homeassistant/amd64-builder --target $PATHTOBUILD --$ARCH --test --docker-hub local" | ||
echo "$CMD" | ||
$CMD |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
name: "sbam Smart Battery Manager", | ||
url: "https://github.com/atbore-phx/sbam", | ||
maintainer": "atbore-phx" |