mirror of https://github.com/statping/statping
xgo build attempt
parent
e634c51636
commit
0d0993dbf6
|
@ -0,0 +1,72 @@
|
||||||
|
name: XGO Build Attempt
|
||||||
|
on: [push]
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
|
||||||
|
compile:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v2
|
||||||
|
- uses: actions/setup-go@v2
|
||||||
|
with:
|
||||||
|
go-version: '1.14.2'
|
||||||
|
- uses: actions/setup-node@v1
|
||||||
|
with:
|
||||||
|
node-version: '12.18.2'
|
||||||
|
|
||||||
|
- name: Add GOBIN to PATH
|
||||||
|
run: |
|
||||||
|
echo "::add-path::$(go env GOPATH)/bin"
|
||||||
|
echo ::set-env name=VERSION::$(cat version.txt)
|
||||||
|
shell: bash
|
||||||
|
|
||||||
|
- name: Install Global Dependencies
|
||||||
|
run: npm install -g yarn sass cross-env
|
||||||
|
|
||||||
|
- name: Download Frontend Dependencies
|
||||||
|
if: steps.nodecache.outputs.cache-hit != 'true'
|
||||||
|
working-directory: ./frontend
|
||||||
|
run: yarn
|
||||||
|
|
||||||
|
- name: Download Go mods
|
||||||
|
if: steps.golangcache.outputs.cache-hit != 'true'
|
||||||
|
run: |
|
||||||
|
go mod download
|
||||||
|
go mod verify
|
||||||
|
make test-deps
|
||||||
|
|
||||||
|
- name: Build Frontend Statping
|
||||||
|
run: make clean compile
|
||||||
|
|
||||||
|
- name: Upload Compiled Frontend (rice-box.go)
|
||||||
|
uses: actions/upload-artifact@v1
|
||||||
|
with:
|
||||||
|
name: static-rice-box
|
||||||
|
path: ./source
|
||||||
|
|
||||||
|
xgo-build:
|
||||||
|
needs: compile
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v2
|
||||||
|
|
||||||
|
- name: Download Compiled Frontend (rice-box.go)
|
||||||
|
uses: actions/download-artifact@v1
|
||||||
|
with:
|
||||||
|
name: static-rice-box
|
||||||
|
path: ./source
|
||||||
|
|
||||||
|
- name: Build with xgo
|
||||||
|
uses: crazy-max/ghaction-xgo@v1
|
||||||
|
with:
|
||||||
|
xgo_version: latest
|
||||||
|
go_version: 1.15.x
|
||||||
|
dest: build
|
||||||
|
prefix: statping
|
||||||
|
targets: linux/amd64,linux/386,linux/arm-7,linux/arm-6,linux/arm64,windows/386,windows/amd64,windows/arm64,darwin/386,darwin/amd64
|
||||||
|
v: true
|
||||||
|
x: false
|
||||||
|
pkg: cmd
|
||||||
|
buildmode: default
|
||||||
|
ldflags: -s -w -X main.VERSION=${VERSION} -X main.COMMIT=${COMMIT} -linkmode external -extldflags -static
|
||||||
|
|
Loading…
Reference in New Issue