Browse Source

add go.mod and github workflow

kerryzhang 3 years ago
parent
commit
5c010ab99d
4 changed files with 64 additions and 3 deletions
  1. 54 0
      .github/go.yml
  2. 0 0
      .github/workflows
  3. 8 3
      README.md
  4. 2 0
      go.mod

+ 54 - 0
.github/go.yml

@@ -0,0 +1,54 @@
+name: Build Jrebel Server
+
+on:
+  push:
+    branches:
+      - master
+    tags:
+      - '*'
+
+jobs:
+  build-job:
+    runs-on: ubuntu-latest
+    steps:
+    - uses: actions/checkout@v2
+    - name: Set up Go
+      uses: actions/setup-go@v2
+      with:
+        go-version: 1.16
+    - name: Config Linux amd64
+      run: CGO_ENABLED=0 GOOS=linux GOARCH=amd64
+    - name: Build Linux amd64
+      run: go build -o build-bin/jrebel-license-active-server-linux_amd64 ./
+      
+    - name: Config MacOS amd64
+      run: CGO_ENABLED=0 GOOS=darwin GOARCH=amd64
+    - name: Build MacOS amd64
+      run: go build -o build-bin/jrebel-license-active-server-darwin_amd64.app ./
+          
+    - name: Config Windows amd64
+      run: CGO_ENABLED=0 GOOS=windows GOARCH=amd64
+    - name: Build Windows amd64
+      run: go build -o build-bin/jrebel-license-active-server-windows_amd64.exe ./  
+      
+    - name: Upload Bin
+      uses: actions/upload-artifact@v2
+      if: startsWith(github.ref, 'refs/tags/')
+      with:
+        name: exec file
+        path: |
+          build-bin/jrebel-license-active-server-linux_amd64
+          build-bin/jrebel-license-active-server-darwin_amd64.app
+          build-bin/jrebel-license-active-server-windows_amd64.exe
+      env:
+        GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}            
+    - name: Release
+      uses: softprops/action-gh-release@v1
+      if: startsWith(github.ref, 'refs/tags/')
+      with:
+        files: |
+          build-bin/jrebel-license-active-server-linux_amd64
+          build-bin/jrebel-license-active-server-darwin_amd64
+          build-bin/jrebel-license-active-server-windows_amd64.exe
+      env:
+        GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

+ 0 - 0
.github/workflows


+ 8 - 3
README.md

@@ -3,6 +3,12 @@
 
 >Java开发者刚刚学GO,练手....
 
+
+
+## 直接下载(Win,Linux,Mac)
+
+- [https://github.com/yu-xiaoyao/jrebel-license-active-server/releases](https://github.com/yu-xiaoyao/jrebel-license-active-server/releases)
+
 ## Win编译
 ```shell
 SET CGO_ENABLED=0
@@ -17,17 +23,16 @@ go build ./
 - GOARCH:
     - amd64 : 64位
     - 386:  : 32位
-    
 ## Mac编译
 ```shell
 CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build ./
-```    
+```
 
 ## docker
 ```shell
 docker run --rm --env GOPROXY=https://goproxy.cn -v "$PWD":/root -w /root/src/project/main golang:latest go build ./ -v 
 ```
-    
+
 ## 运行
 默认端口: 12345
 ```shell

+ 2 - 0
go.mod

@@ -0,0 +1,2 @@
+module yu-xiaoyao/jrebel-license-active-server
+go 1.15