This is an automated email from the ASF dual-hosted git repository.

xjlgod pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/incubator-seata-ctl.git


The following commit(s) were added to refs/heads/main by this push:
     new a6f7149  optimize: optimize the workflow (#9)
a6f7149 is described below

commit a6f7149097f12aac8eb1591ec6433c3cdf248ffc
Author: jimin <sliev...@163.com>
AuthorDate: Sun May 25 22:50:58 2025 +0800

    optimize: optimize the workflow (#9)
    
    * optimize: optimize the workflow
    
    * optimize: optimize the workflow
    
    * optimize: optimize the workflow
    
    * optimize: optimize the workflow
---
 .github/workflows/build.yml   | 51 +++++++++++++++++++++++++++++--------------
 .github/workflows/go-lint.yml | 39 ++++++++++++++++++++++++---------
 2 files changed, 64 insertions(+), 26 deletions(-)

diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml
index f32c11c..05d21a2 100644
--- a/.github/workflows/build.yml
+++ b/.github/workflows/build.yml
@@ -24,26 +24,45 @@ on:
   push:
     branches: [ "main" ]
   pull_request:
-    branches:
-      - 'main'
+    branches: [ "main" ]
 
 jobs:
-
   build:
-    runs-on: ubuntu-latest
+    strategy:
+      matrix:
+        os: [ubuntu-latest, macos-latest]
+        include:
+          - os: ubuntu-latest
+            goos: linux
+            ext: ""
+          - os: macos-latest
+            goos: darwin
+            ext: ""
+    runs-on: ${{ matrix.os }}
+    timeout-minutes: 15
+
     steps:
-    - uses: actions/checkout@v3
+      - name: Checkout Code
+        uses: actions/checkout@v4
+
+      - name: Setup Go
+        uses: actions/setup-go@v5
+        with:
+          go-version: "1.21"
+          check-latest: true
 
-    - name: Set up Go
-      uses: actions/setup-go@v4
-      with:
-        go-version: '1.20'
+      - name: Configure Build
+        shell: bash
+        run: |
+          echo "GOOS=${{ matrix.goos }}" >> $GITHUB_ENV
+          echo "GOARCH=amd64" >> $GITHUB_ENV
+          echo "OUTPUT=seata-ctl-${{ matrix.goos }}-amd64${{ matrix.ext }}" >> 
$GITHUB_ENV
 
-    - name: Build
-      run: go build .
+      - name: Build
+        run: go build -v -o ${{ env.OUTPUT }} .
 
-    - name: Upload Artifacts
-      uses: actions/upload-artifact@v3
-      with:
-        name: seata-ctl-linux-amd64
-        path: ./seata-ctl
+      - name: Upload Artifacts
+        uses: actions/upload-artifact@v4
+        with:
+          name: ${{ env.OUTPUT }}
+          path: ${{ env.OUTPUT }}
\ No newline at end of file
diff --git a/.github/workflows/go-lint.yml b/.github/workflows/go-lint.yml
index 9366e63..f7fd091 100644
--- a/.github/workflows/go-lint.yml
+++ b/.github/workflows/go-lint.yml
@@ -24,17 +24,36 @@ on:
   push:
     branches: [ "main" ]
   pull_request:
-    branches:
-      - 'main'
+    branches: [ "main" ]
 
 jobs:
-
-  build:
-    runs-on: ubuntu-latest
+  lint:
+    name: Linter Check
+    runs-on: ubuntu-22.04
+    timeout-minutes: 10
     steps:
-    - uses: actions/checkout@v3
+      - name: Checkout Code
+        uses: actions/checkout@v4
+
+      - name: Setup Go
+        uses: actions/setup-go@v4
+        with:
+          go-version: '1.21'
+
+      - name: Install golangci-lint
+        run: |
+          curl -sSfL 
https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh 
-s -- -b $(go env GOPATH)/bin v1.55.0
+
+      - name: Cache golangci-lint
+        uses: actions/cache@v3
+        with:
+          path: ~/.cache/golangci-lint
+          key: ${{ runner.os }}-gci-${{ hashFiles('**/go.mod') }}
+          restore-keys: |
+            ${{ runner.os }}-gci-
+
+      - name: Run Linter
+        run: |
+          export PATH=$PATH:$(go env GOPATH)/bin
+          golangci-lint run --timeout 5m -v
 
-    - name: Lint check
-      run: |
-        curl -sSfL 
https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | 
sudo sh -s -- -b /usr/local/bin v1.51.2
-        golangci-lint run


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscr...@seata.apache.org
For additional commands, e-mail: notifications-h...@seata.apache.org

Reply via email to