-
Notifications
You must be signed in to change notification settings - Fork 0
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
ac46778
commit 6c1eb16
Showing
5 changed files
with
63 additions
and
1 deletion.
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 |
---|---|---|
@@ -0,0 +1,37 @@ | ||
on: | ||
workflow_dispatch: | ||
push: | ||
release: | ||
types: [released] | ||
|
||
env: | ||
VERSION: ${{ github.event_name == 'release' && github.ref_name || format('0.0.0-{0}.{1}', github.ref_name, github.run_number) }} | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- uses: actions/setup-go@v4 | ||
with: | ||
go-version: '~1.20.6' | ||
- name: deps | ||
run: go mod download | ||
- name: build | ||
run: | | ||
GOARCH=arm64 make module.tar.gz && mv module.tar.gz module-arm64.tar.gz | ||
GOARCH=amd64 make module.tar.gz && mv module.tar.gz module-amd64.tar.gz | ||
- uses: viamrobotics/upload-module@main | ||
if: github.event_name == 'release' | ||
with: | ||
module-path: module-arm64.tar.gz | ||
platform: linux/arm64 | ||
version: ${{ env.VERSION }} | ||
cli-config-secret: ${{ secrets.cli_config }} | ||
- uses: viamrobotics/upload-module@main | ||
if: github.event_name == 'release' | ||
with: | ||
module-path: module-amd64.tar.gz | ||
platform: linux/amd64 | ||
version: ${{ env.VERSION }} | ||
cli-config-secret: ${{ secrets.cli_config }} |
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 |
---|---|---|
|
@@ -13,3 +13,6 @@ | |
|
||
# Dependency directories (remove the comment below to include it) | ||
# vendor/ | ||
|
||
wifi | ||
module.tar.gz |
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,9 @@ | ||
wifi: *.go */*.go | ||
# the executable | ||
go build -o $@ -ldflags "-s -w" -tags osusergo,netgo | ||
file $@ | ||
|
||
module.tar.gz: wifi | ||
# the bundled module | ||
rm -f $@ | ||
tar czf $@ $^ |
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,13 @@ | ||
{ | ||
"name": "viam:golang-wifi-example", | ||
"visibility": "private", | ||
"url": "https://github.com/viam-labs/wifi-sensor", | ||
"description": "Example module for golang", | ||
"models": [ | ||
{ | ||
"api": "rdk:component:sensor", | ||
"model": "viam:sensor:linux-wifi" | ||
} | ||
], | ||
"entrypoint": "wifi" | ||
} |