浏览代码

:construction_worker: use GitHub Actions to build client

JustSong 3 年之前
父节点
当前提交
090bbcc61b
共有 1 个文件被更改,包括 30 次插入0 次删除
  1. 30 0
      .github/workflows/build-client.yml

+ 30 - 0
.github/workflows/build-client.yml

@@ -0,0 +1,30 @@
+name: Build Client
+
+on:
+  push:
+    tags:
+      - '*'
+jobs:
+  release:
+    runs-on: windows-latest
+    steps:
+      - name: Checkout
+        uses: actions/checkout@v3
+        with:
+          fetch-depth: 0
+      - name: Set up Go
+        uses: actions/setup-go@v3
+      - name: Build
+        run: |
+          cd client
+          go mod download
+          go build -ldflags "-s -w -extldflags '-static'" -o message-receiver.exe
+      - name: Release
+        uses: softprops/action-gh-release@v1
+        if: startsWith(github.ref, 'refs/tags/')
+        with:
+          files: |
+            client/message-receiver.exe
+            client/starter.vbs
+        env:
+          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}