mirror of https://github.com/statping/statping
github action building
parent
c3de43f142
commit
7eb1deb5bf
|
@ -80,9 +80,6 @@ jobs:
|
||||||
with:
|
with:
|
||||||
node-version: '10.x'
|
node-version: '10.x'
|
||||||
- uses: actions/checkout@v2
|
- uses: actions/checkout@v2
|
||||||
with:
|
|
||||||
fetch-depth: 1
|
|
||||||
path: ./go/src/github.com/${{ github.repository }}
|
|
||||||
|
|
||||||
- name: Install Global Dependencies
|
- name: Install Global Dependencies
|
||||||
run: npm install -g yarn sass newman cross-env wait-on @sentry/cli
|
run: npm install -g yarn sass newman cross-env wait-on @sentry/cli
|
||||||
|
@ -95,16 +92,15 @@ jobs:
|
||||||
shell: bash
|
shell: bash
|
||||||
|
|
||||||
- name: Download Compiled Frontend (rice-box.go)
|
- name: Download Compiled Frontend (rice-box.go)
|
||||||
uses: actions/download-artifact@v1
|
uses: actions/download-artifact@v2
|
||||||
with:
|
with:
|
||||||
name: static-rice-box
|
name: static-rice-box
|
||||||
path: ./go/src/github.com/${{ github.repository }}/source
|
path: ./source
|
||||||
|
|
||||||
- name: Install Statping
|
- name: Install Statping
|
||||||
env:
|
env:
|
||||||
VERSION: ${{ env.VERSION }}
|
VERSION: ${{ env.VERSION }}
|
||||||
run: |
|
run: |
|
||||||
cd ./go/src/github.com/${{ github.repository }}
|
|
||||||
make build
|
make build
|
||||||
chmod +x statping
|
chmod +x statping
|
||||||
mv statping $(go env GOPATH)/bin/
|
mv statping $(go env GOPATH)/bin/
|
||||||
|
@ -152,10 +148,6 @@ jobs:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v2
|
- uses: actions/checkout@v2
|
||||||
with:
|
|
||||||
fetch-depth: 1
|
|
||||||
path: ./go/src/github.com/${{ github.repository }}
|
|
||||||
|
|
||||||
- uses: actions/setup-go@v2
|
- uses: actions/setup-go@v2
|
||||||
with:
|
with:
|
||||||
go-version: '1.14.2'
|
go-version: '1.14.2'
|
||||||
|
@ -168,16 +160,15 @@ jobs:
|
||||||
shell: bash
|
shell: bash
|
||||||
|
|
||||||
- name: Download Compiled Frontend (rice-box.go)
|
- name: Download Compiled Frontend (rice-box.go)
|
||||||
uses: actions/download-artifact@v1
|
uses: actions/download-artifact@v2
|
||||||
with:
|
with:
|
||||||
name: static-rice-box
|
name: static-rice-box
|
||||||
path: ./go/src/github.com/${{ github.repository }}/source
|
path: ./source
|
||||||
|
|
||||||
- name: Install Statping
|
- name: Install Statping
|
||||||
env:
|
env:
|
||||||
VERSION: ${{ env.VERSION }}
|
VERSION: ${{ env.VERSION }}
|
||||||
run: |
|
run: |
|
||||||
cd ./go/src/github.com/${{ github.repository }}
|
|
||||||
make build
|
make build
|
||||||
chmod +x statping
|
chmod +x statping
|
||||||
mv statping $(go env GOPATH)/bin/
|
mv statping $(go env GOPATH)/bin/
|
||||||
|
@ -204,40 +195,31 @@ jobs:
|
||||||
with:
|
with:
|
||||||
go-version: '1.14.2'
|
go-version: '1.14.2'
|
||||||
- uses: actions/checkout@v2
|
- uses: actions/checkout@v2
|
||||||
with:
|
|
||||||
fetch-depth: 1
|
|
||||||
path: ./go/src/github.com/${{ github.repository }}
|
|
||||||
|
|
||||||
- name: Setting ENV's
|
- name: Setting ENV's
|
||||||
run: |
|
run: |
|
||||||
echo "::set-env name=GOPATH::${{ github.workspace }}/go"
|
|
||||||
echo "::add-path::$(go env GOPATH)/bin"
|
echo "::add-path::$(go env GOPATH)/bin"
|
||||||
echo "::add-path::/opt/hostedtoolcache/node/10.20.1/x64/bin"
|
echo "::add-path::/opt/hostedtoolcache/node/10.20.1/x64/bin"
|
||||||
echo ::set-env name=VERSION::$(cat version.txt)
|
echo ::set-env name=VERSION::$(cat version.txt)
|
||||||
shell: bash
|
shell: bash
|
||||||
|
|
||||||
- name: Download Go mods
|
- name: Download Go mods
|
||||||
run: |
|
run: make test-deps
|
||||||
cd ./go/src/github.com/${{ github.repository }}
|
|
||||||
make test-deps
|
|
||||||
|
|
||||||
- name: Download Compiled Frontend (rice-box.go)
|
- name: Download Compiled Frontend (rice-box.go)
|
||||||
uses: actions/download-artifact@v1
|
uses: actions/download-artifact@v2
|
||||||
with:
|
with:
|
||||||
name: static-rice-box
|
name: static-rice-box
|
||||||
path: ./go/src/github.com/${{ github.repository }}/source
|
path: ./source
|
||||||
|
|
||||||
- name: Build with xgo
|
- name: Build with xgo
|
||||||
run: |
|
run: make build-mac
|
||||||
pwd && ls
|
|
||||||
cd ./go/src/github.com/${{ github.repository }}
|
|
||||||
make build-mac
|
|
||||||
|
|
||||||
- name: Upload MacOSX Builds
|
- name: Upload MacOSX Builds
|
||||||
uses: actions/upload-artifact@v2
|
uses: actions/upload-artifact@v2
|
||||||
with:
|
with:
|
||||||
name: darwin-builds
|
name: darwin-builds
|
||||||
path: ./go/src/github.com/${{ github.repository }}/build
|
path: ./build
|
||||||
|
|
||||||
build-linux:
|
build-linux:
|
||||||
needs: compile
|
needs: compile
|
||||||
|
@ -246,41 +228,33 @@ jobs:
|
||||||
- uses: actions/setup-go@v2
|
- uses: actions/setup-go@v2
|
||||||
with:
|
with:
|
||||||
go-version: '1.14.2'
|
go-version: '1.14.2'
|
||||||
|
|
||||||
- uses: actions/checkout@v2
|
- uses: actions/checkout@v2
|
||||||
with:
|
|
||||||
fetch-depth: 1
|
|
||||||
path: go/src/github.com/${{ github.repository }}
|
|
||||||
|
|
||||||
- name: Setting ENV's
|
- name: Setting ENV's
|
||||||
run: |
|
run: |
|
||||||
echo "::set-env name=GOPATH::${{ github.workspace }}/go"
|
|
||||||
echo "::add-path::$(go env GOPATH)/bin"
|
echo "::add-path::$(go env GOPATH)/bin"
|
||||||
echo "::add-path::/opt/hostedtoolcache/node/10.20.1/x64/bin"
|
echo "::add-path::/opt/hostedtoolcache/node/10.20.1/x64/bin"
|
||||||
echo ::set-env name=VERSION::$(cat version.txt)
|
echo ::set-env name=VERSION::$(cat version.txt)
|
||||||
shell: bash
|
shell: bash
|
||||||
|
|
||||||
- name: Download Go mods
|
- name: Download Go mods
|
||||||
run: |
|
run: make test-deps
|
||||||
cd ./go/src/github.com/${{ github.repository }}
|
|
||||||
make test-deps
|
|
||||||
|
|
||||||
- name: Download Compiled Frontend (rice-box.go)
|
- name: Download Compiled Frontend (rice-box.go)
|
||||||
uses: actions/download-artifact@v1
|
uses: actions/download-artifact@v2
|
||||||
with:
|
with:
|
||||||
name: static-rice-box
|
name: static-rice-box
|
||||||
path: ./go/src/github.com/${{ github.repository }}/source
|
path: ./source
|
||||||
|
|
||||||
- name: Build with xgo
|
- name: Build with xgo
|
||||||
run: |
|
run: make build-linux
|
||||||
pwd && ls
|
|
||||||
cd ./go/src/github.com/${{ github.repository }}
|
|
||||||
make build-linux
|
|
||||||
|
|
||||||
- name: Upload Linux Builds
|
- name: Upload Linux Builds
|
||||||
uses: actions/upload-artifact@v2
|
uses: actions/upload-artifact@v2
|
||||||
with:
|
with:
|
||||||
name: linux-builds
|
name: linux-builds
|
||||||
path: ./go/src/github.com/${{ github.repository }}/build
|
path: ./build
|
||||||
|
|
||||||
build-windows:
|
build-windows:
|
||||||
needs: compile
|
needs: compile
|
||||||
|
@ -289,41 +263,33 @@ jobs:
|
||||||
- uses: actions/setup-go@v2
|
- uses: actions/setup-go@v2
|
||||||
with:
|
with:
|
||||||
go-version: '1.14.2'
|
go-version: '1.14.2'
|
||||||
|
|
||||||
- uses: actions/checkout@v2
|
- uses: actions/checkout@v2
|
||||||
with:
|
|
||||||
fetch-depth: 1
|
|
||||||
path: go/src/github.com/${{ github.repository }}
|
|
||||||
|
|
||||||
- name: Setting ENV's
|
- name: Setting ENV's
|
||||||
run: |
|
run: |
|
||||||
echo "::set-env name=GOPATH::${{ github.workspace }}/go"
|
|
||||||
echo "::add-path::$(go env GOPATH)/bin"
|
echo "::add-path::$(go env GOPATH)/bin"
|
||||||
echo "::add-path::/opt/hostedtoolcache/node/10.20.1/x64/bin"
|
echo "::add-path::/opt/hostedtoolcache/node/10.20.1/x64/bin"
|
||||||
echo ::set-env name=VERSION::$(cat version.txt)
|
echo ::set-env name=VERSION::$(cat version.txt)
|
||||||
shell: bash
|
shell: bash
|
||||||
|
|
||||||
- name: Download Go mods
|
- name: Download Go mods
|
||||||
run: |
|
run: make test-deps
|
||||||
cd ./go/src/github.com/${{ github.repository }}
|
|
||||||
make test-deps
|
|
||||||
|
|
||||||
- name: Download Compiled Frontend (rice-box.go)
|
- name: Download Compiled Frontend (rice-box.go)
|
||||||
uses: actions/download-artifact@v1
|
uses: actions/download-artifact@v2
|
||||||
with:
|
with:
|
||||||
name: static-rice-box
|
name: static-rice-box
|
||||||
path: ./go/src/github.com/${{ github.repository }}/source
|
path: ./source
|
||||||
|
|
||||||
- name: Build with xgo
|
- name: Build with xgo
|
||||||
run: |
|
run: make build-win
|
||||||
pwd && ls
|
|
||||||
cd ./go/src/github.com/${{ github.repository }}
|
|
||||||
make build-win
|
|
||||||
|
|
||||||
- name: Upload Windows Builds
|
- name: Upload Windows Builds
|
||||||
uses: actions/upload-artifact@v2
|
uses: actions/upload-artifact@v2
|
||||||
with:
|
with:
|
||||||
name: windows-builds
|
name: windows-builds
|
||||||
path: ./go/src/github.com/${{ github.repository }}/build
|
path: ./build
|
||||||
|
|
||||||
upload-release:
|
upload-release:
|
||||||
needs: [test, test-postman, build-linux, build-mac, build-windows]
|
needs: [test, test-postman, build-linux, build-mac, build-windows]
|
||||||
|
@ -424,14 +390,14 @@ jobs:
|
||||||
- name: Release Docker images
|
- name: Release Docker images
|
||||||
run: make docker-manifest
|
run: make docker-manifest
|
||||||
|
|
||||||
# - name: Base Docker Image
|
- name: Base Docker Image
|
||||||
# uses: elgohr/Publish-Docker-Github-Action@master
|
uses: elgohr/Publish-Docker-Github-Action@master
|
||||||
# with:
|
with:
|
||||||
# name: statping/statping
|
name: statping/statping
|
||||||
# username: ${{ secrets.DOCKER_USERNAME }}
|
username: ${{ secrets.DOCKER_USERNAME }}
|
||||||
# password: ${{ secrets.DOCKER_PASSWORD }}
|
password: ${{ secrets.DOCKER_PASSWORD }}
|
||||||
# dockerfile: Dockerfile.base
|
dockerfile: Dockerfile.base
|
||||||
# tags: "base"
|
tags: "base"
|
||||||
|
|
||||||
sentry-release:
|
sentry-release:
|
||||||
needs: upload-release
|
needs: upload-release
|
||||||
|
|
6
Makefile
6
Makefile
|
@ -179,13 +179,13 @@ compress:
|
||||||
done
|
done
|
||||||
|
|
||||||
build-linux:
|
build-linux:
|
||||||
xgo -go=$(GOVERSION) -dest=build -pkg=cmd -ldflags="-s -w -extldflags -static -X main.VERSION=${VERSION}" -targets="linux/amd64,linux/386,linux/arm-7,linux/arm-6,linux/arm64,linux/arm" -out=statping github.com/statping/statping
|
xgo -go=$(GOVERSION) -dest=build -pkg=cmd -ldflags="-s -w -extldflags -static -X main.VERSION=${VERSION}" -targets="linux/amd64,linux/386,linux/arm-7,linux/arm-6,linux/arm64,linux/arm" -out=statping .
|
||||||
|
|
||||||
build-mac:
|
build-mac:
|
||||||
xgo -go=$(GOVERSION) -dest=build -pkg=cmd -ldflags="-s -w -X main.VERSION=${VERSION}" -targets="darwin/amd64,darwin/386" -out=statping github.com/statping/statping
|
xgo -go=$(GOVERSION) -dest=build -pkg=cmd -ldflags="-s -w -X main.VERSION=${VERSION}" -targets="darwin/amd64,darwin/386" -out=statping .
|
||||||
|
|
||||||
build-win:
|
build-win:
|
||||||
xgo -go=$(GOVERSION) -dest=build -pkg=cmd -ldflags="-s -w -extldflags -static -X main.VERSION=${VERSION}" -targets="windows-6.0/amd64,windows-6.0/386" -out=statping github.com/statping/statping
|
xgo -go=$(GOVERSION) -dest=build -pkg=cmd -ldflags="-s -w -extldflags -static -X main.VERSION=${VERSION}" -targets="windows-6.0/amd64,windows-6.0/386" -out=statping .
|
||||||
|
|
||||||
# remove files for a clean compile/build
|
# remove files for a clean compile/build
|
||||||
clean:
|
clean:
|
||||||
|
|
Loading…
Reference in New Issue