Skip to content

Merge branch 'master' of github.com:balazsgrill/wscgo #110

Merge branch 'master' of github.com:balazsgrill/wscgo

Merge branch 'master' of github.com:balazsgrill/wscgo #110

Workflow file for this run

name: Main
on: [push]
jobs:
build:
name: Build
runs-on: ubuntu-latest
steps:
- name: Get current time
uses: srfrnk/[email protected]
id: current-time
with:
format: YYYYMMDDHHss
- name: Set up Go 1.18
uses: actions/setup-go@v1
with:
go-version: 1.18
id: go
- name: Install tools
run: |
sudo apt update
sudo apt-get install -y build-essential devscripts debhelper gettext-base
- name: Check out code into the Go module directory
uses: actions/checkout@v2
- id: dotenv
uses: falti/[email protected]
- name: Test
run: |
go test -v ./devices
go test -v ./protocol
go test -v ./config
- name: Package
env:
VERSION: "${{ steps.dotenv.outputs.version }}-${{ steps.current-time.outputs.formattedTime }}"
GOOS: "linux"
GOARCH: "arm"
GOARM: "5"
run: |
echo "Version: $VERSION"
envsubst < debian/changelog.tpl > debian/changelog
dpkg-buildpackage --target-arch armhf --host-arch armhf -b
cp ../wscgo_${{ steps.dotenv.outputs.version }}-${{ steps.current-time.outputs.formattedTime }}_armhf.deb ./
- uses: actions/upload-artifact@v1
with:
name: binary
path: "wscgo"
- uses: actions/upload-artifact@v1
with:
name: debian-package
path: "wscgo_${{ steps.dotenv.outputs.version }}-${{ steps.current-time.outputs.formattedTime }}_armhf.deb"
- name: Publish CI package
id: push
if: github.ref == 'refs/heads/master'
uses: cloudsmith-io/action@master
with:
api-key: ${{ secrets.CLOUDSMITH_API_KEY }}
command: 'push'
format: 'deb'
owner: 'home2mqtt'
repo: 'home2mqtt'
distro: 'unstable'
release: 'main'
republish: 'true'
file: "wscgo_${{ steps.dotenv.outputs.version }}-${{ steps.current-time.outputs.formattedTime }}_armhf.deb"