diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml new file mode 100644 index 0000000..ebb5908 --- /dev/null +++ b/.github/workflows/release.yaml @@ -0,0 +1,28 @@ +name: goreleaser +on: + push: + branches: [main] + tags: + - 'v*' +jobs: + goreleaser: + runs-on: ubuntu-latest + if: success() && startsWith(github.ref, 'refs/tags/') + steps: + - uses: actions/checkout@v3 + with: + fetch-depth: 0 + - uses: actions/setup-go@v3 + with: + go-version: '>=1.19.3' + cache: true + - run: make dependencies + - run: make build-frontend + - uses: goreleaser/goreleaser-action@v2 + with: + distribution: goreleaser + version: latest + args: release --rm-dist + env: + GITHUB_TOKEN: ${{ secrets.GH_TOKEN }} + \ No newline at end of file diff --git a/.github/workflows/test-macos.yml b/.github/workflows/test-macos.yml index 86a2ec3..3cc6e59 100644 --- a/.github/workflows/test-macos.yml +++ b/.github/workflows/test-macos.yml @@ -1,8 +1,8 @@ on: push: - branches: [ main, develop ] + branches: [ main, develop] pull_request: - branches: [ main ] + branches: [ main] name: Test-MacOs jobs: test: @@ -11,11 +11,16 @@ jobs: - name: Install Go uses: actions/setup-go@v2 with: - go-version: 1.16 + go-version: '>=1.16' - name: Checkout code uses: actions/checkout@v2 - name: Setup config script # using locals for mac-OS because github CI mac platforms don't have docker - run: make prep-ci-local + run: | + make prep-ci-local + make dependencies + make build-frontend - name: Test - run: go test -v ./... + run: | + go mod tidy + go test -v ./... diff --git a/.github/workflows/test-ssh.yml b/.github/workflows/test-ssh.yml index eb354fa..2590a37 100644 --- a/.github/workflows/test-ssh.yml +++ b/.github/workflows/test-ssh.yml @@ -1,8 +1,8 @@ on: push: - branches: [ main, develop ] + branches: [ main, develop] pull_request: - branches: [ main ] + branches: [ main] name: Test-Linux jobs: test: @@ -11,11 +11,16 @@ jobs: - name: Install Go uses: actions/setup-go@v2 with: - go-version: 1.16 + go-version: '>=1.16' - name: Checkout code uses: actions/checkout@v2 - name: Setup SSH server and config # run docker ssh container for ssh tests - run: make prep-ci-ssh + run: | + make prep-ci-ssh + make dependencies + make build-frontend - name: Test - run: go test -v ./... + run: | + go mod tidy + go test -v ./... diff --git a/.github/workflows/test-windows.yml b/.github/workflows/test-windows.yml index 5001d66..ec17739 100644 --- a/.github/workflows/test-windows.yml +++ b/.github/workflows/test-windows.yml @@ -1,8 +1,8 @@ on: push: - branches: [ main, develop ] + branches: [ main, develop] pull_request: - branches: [ main ] + branches: [ main] name: Test-Windows jobs: test: @@ -11,7 +11,7 @@ jobs: - name: Install Go uses: actions/setup-go@v2 with: - go-version: 1.16 + go-version: '>=1.16' - name: Checkout code uses: actions/checkout@v2 - name: Choco Install make @@ -20,6 +20,11 @@ jobs: args: install make - name: Setup config script # using locals for Windows because github CI Windows platforms don't have docker - run: make prep-ci-local-windows + run: | + make prep-ci-local-windows + make dependencies + make build-frontend - name: Test - run: go test -v ./... + run: | + go mod tidy + go test -v ./... diff --git a/.goreleaser.yaml b/.goreleaser.yaml new file mode 100644 index 0000000..1d0255c --- /dev/null +++ b/.goreleaser.yaml @@ -0,0 +1,39 @@ +before: + hooks: + - go mod tidy + - go generate ./... +builds: + - env: + - CGO_ENABLED=0 + goos: + - linux + - windows + - darwin +archives: + - replacements: + darwin: Darwin + linux: Linux + windows: Windows + 386: i386 + amd64: x86_64 +checksum: + name_template: 'checksums.txt' +#snapshot: +# name_template: "{{ incpatch .Version }}-next" +changelog: + sort: asc + filters: + exclude: + - '^docs:' + - '^test:' + - '^intergration:' + - '^assets:' +nfpms: +- maintainer: Bisohns Corp. + description: YAML based tool for monitoring metrics across multiple hosts + homepage: https://github.com/bisohns/saido + license: Apache License 2.0 + formats: + - deb + - rpm + - apk diff --git a/Makefile b/Makefile index 7599f7b..1f0c1eb 100644 --- a/Makefile +++ b/Makefile @@ -40,6 +40,7 @@ endif dependencies: ifeq ($(bin),main.exe) @make prep-ci-local-windows + yarn add react-scripts@latest else @make prep-ci-local endif @@ -48,7 +49,7 @@ endif .PHONY: build-frontend build-frontend: - cd web && yarn build && cd .. + cd web && export BUILD_PATH=../cmd/build && CI=false yarn build && cd .. .PHONY: serve-backend serve-backend: diff --git a/web/package.json b/web/package.json index 57da766..f9ebc0c 100644 --- a/web/package.json +++ b/web/package.json @@ -28,7 +28,7 @@ }, "scripts": { "start": "react-scripts start", - "build": "BUILD_PATH='../cmd/build' react-scripts build", + "build": "react-scripts build", "test": "react-scripts test", "eject": "react-scripts eject" }, @@ -50,4 +50,4 @@ "last 1 safari version" ] } -} +} \ No newline at end of file