add go releaser

This commit is contained in:
dushixiang
2021-11-04 21:27:14 +08:00
parent ebf4349a06
commit 036245c931
5 changed files with 61 additions and 9 deletions

View File

@ -19,7 +19,7 @@ jobs:
- name: node Setup - name: node Setup
uses: actions/setup-node@v2 uses: actions/setup-node@v2
with: with:
node-version: '14' node-version: '16'
- name: npm install - name: npm install
run: | run: |
cd web cd web

29
.github/workflows/goreleaser.yml vendored Normal file
View File

@ -0,0 +1,29 @@
name: Release
on:
push:
tags:
- "v*"
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: node Setup
uses: actions/setup-node@v2
with:
node-version: '16'
- name: npm install
run: |
cd web
npm install
npm run build
- uses: actions/checkout@v2
- name: Run GoReleaser
uses: goreleaser/goreleaser-action@v2
with:
go-version: 1.17
version: latest
args: release --rm-dist
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

30
.goreleaser.yml Normal file
View File

@ -0,0 +1,30 @@
builds:
- env:
- CGO_ENABLED=1
goos:
- linux
- windows
- darwin
goarch:
- arm
- arm64
- 386
- amd64
- mips
- mipsle
checksum:
name_template: "checksums.txt"
release:
# Same as for github
# Note: it can only be one: either github, gitlab or gitea
github:
owner: dushixiang
name: next-terminal
# You can add extra pre-existing files to the release.
# The filename on the release will be the last part of the path (base). If
# another file with the same name exists, the latest one found will be used.
# Defaults to empty.
extra_files:
- glob: ./web/build/*

View File

@ -1,7 +0,0 @@
#cd web
#npm run build
#rm -rf ../bin/web/build
#mkdir -p ../bin/web/build
#cp -r build ../bin/web/
#cd ..
CGO_ENABLED=0 GOOS=linux GOARCH=arm go build -o bin/next-terminal main.go

2
go.mod
View File

@ -1,6 +1,6 @@
module next-terminal module next-terminal
go 1.16 go 1.17
require ( require (
github.com/gliderlabs/ssh v0.3.3 github.com/gliderlabs/ssh v0.3.3