xgo build attempt

pull/773/merge
hunterlong 2020-08-13 00:36:28 -07:00
parent e634c51636
commit 0d0993dbf6
1 changed files with 72 additions and 0 deletions

72
.github/workflows/development.yml vendored Normal file
View File

@ -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