Skip to content

Commit

Permalink
将自动发版修改为独立的Action
Browse files Browse the repository at this point in the history
  • Loading branch information
dushixiang committed May 3, 2023
1 parent 3920c0f commit c2b7671
Show file tree
Hide file tree
Showing 3 changed files with 45 additions and 19 deletions.
19 changes: 0 additions & 19 deletions .github/workflows/docker-next-terminal.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,25 +29,6 @@ jobs:
cd web
npm install --global yarn
yarn
- name: go Setup
uses: actions/setup-go@v2
with:
go-version: 1.20
- name: Build package Linux
run: |
sh build.sh
mv next-terminal next-terminal-bin
mkdir next-terminal
cp next-terminal-bin next-terminal/next-terminal
cp config.yml.example next-terminal/config.yml
cp LICENSE next-terminal/
tar zcvf next-terminal.tar.gz next-terminal/
- name: release
uses: softprops/action-gh-release@v1
with:
files: next-terminal.tar.gz
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Docker Login
uses: docker/login-action@v1.10.0
with:
Expand Down
44 changes: 44 additions & 0 deletions .github/workflows/release-next-terminal.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
name: next-terminal Release

on:
workflow_dispatch:
push:
tags:
- "v*"

jobs:
next-terminal_Release:
name: next-terminal release
runs-on: ubuntu-latest
steps:
- name: Get version
id: get_version
run: echo ::set-output name=VERSION::${GITHUB_REF/refs\/tags\//}
- name: node Setup
uses: actions/setup-node@v2
with:
node-version: '16'
- name: npm install
run: |
cd web
npm install --global yarn
yarn
- name: go Setup
uses: actions/setup-go@v2
with:
go-version: 1.20
- name: Build package Linux
run: |
sh build.sh
mv next-terminal next-terminal-bin
mkdir next-terminal
cp next-terminal-bin next-terminal/next-terminal
cp config.yml.example next-terminal/config.yml
cp LICENSE next-terminal/
tar zcvf next-terminal.tar.gz next-terminal/
- name: release
uses: softprops/action-gh-release@v1
with:
files: next-terminal.tar.gz
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
1 change: 1 addition & 0 deletions build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ echo "build web success"

echo "build api..."
cd ..
go mod tidy
go env;CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -ldflags '-s -w' -o next-terminal main.go
upx next-terminal

Expand Down

0 comments on commit c2b7671

Please sign in to comment.