add test #434
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Go | |
on: [push, pull_request] | |
jobs: | |
build: | |
name: Build | |
runs-on: ubuntu-latest | |
steps: | |
- name: Check out code into the Go module directory | |
uses: actions/checkout@v3 | |
- name: Setup Go | |
uses: actions/setup-go@v3 | |
with: | |
go-version: 1.20.1 | |
cache: true | |
- uses: actions/setup-node@v3 | |
with: | |
node-version: 16 | |
- name: Get dependencies, run test and static check | |
run: | | |
# LATESTTAG=$(git describe --tags --abbrev=0) | |
# sed -i "s/v[0-9]\+\.[0-9]\+\.[0-9]\+/$LATESTTAG/" ./constant/version.go | |
go version | |
cp $(go env GOROOT)/misc/wasm/wasm_exec.js ./web/gui/wasm_exec.js | |
npm install --prefix web/gui build | |
NODE_ENV=production npm run --prefix web/gui build | |
GOOS=js GOARCH=wasm go get -u ./... | |
GOOS=js GOARCH=wasm go build -o ./web/gui/dist/main.wasm ./wasm | |
- name: Build | |
if: startsWith(github.ref, 'refs/tags/') | |
env: | |
NAME: lite | |
BINDIR: bin | |
run: make -j releases | |
- name: Upload Release | |
uses: softprops/action-gh-release@v1 | |
if: startsWith(github.ref, 'refs/tags/') | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
files: bin/* | |
draft: true |