From 036245c93108cf22c63dd5468b7f2caf33deb6c8 Mon Sep 17 00:00:00 2001 From: dushixiang Date: Thu, 4 Nov 2021 21:27:14 +0800 Subject: [PATCH] add go releaser --- .github/workflows/docker-next-terminal.yml | 2 +- .github/workflows/goreleaser.yml | 29 +++++++++++++++++++++ .goreleaser.yml | 30 ++++++++++++++++++++++ build.sh | 7 ----- go.mod | 2 +- 5 files changed, 61 insertions(+), 9 deletions(-) create mode 100644 .github/workflows/goreleaser.yml create mode 100644 .goreleaser.yml delete mode 100644 build.sh diff --git a/.github/workflows/docker-next-terminal.yml b/.github/workflows/docker-next-terminal.yml index fbdc9ad..11cb735 100644 --- a/.github/workflows/docker-next-terminal.yml +++ b/.github/workflows/docker-next-terminal.yml @@ -19,7 +19,7 @@ jobs: - name: node Setup uses: actions/setup-node@v2 with: - node-version: '14' + node-version: '16' - name: npm install run: | cd web diff --git a/.github/workflows/goreleaser.yml b/.github/workflows/goreleaser.yml new file mode 100644 index 0000000..1b5d348 --- /dev/null +++ b/.github/workflows/goreleaser.yml @@ -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 }} \ No newline at end of file diff --git a/.goreleaser.yml b/.goreleaser.yml new file mode 100644 index 0000000..e3ac94b --- /dev/null +++ b/.goreleaser.yml @@ -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/* \ No newline at end of file diff --git a/build.sh b/build.sh deleted file mode 100644 index 31606c5..0000000 --- a/build.sh +++ /dev/null @@ -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 \ No newline at end of file diff --git a/go.mod b/go.mod index 2f796e5..6d443f8 100644 --- a/go.mod +++ b/go.mod @@ -1,6 +1,6 @@ module next-terminal -go 1.16 +go 1.17 require ( github.com/gliderlabs/ssh v0.3.3