From fd455a71519502bb22bd6963de91d942453150c7 Mon Sep 17 00:00:00 2001 From: yxrxy <1532529704@qq.com> Date: Tue, 22 Jul 2025 16:47:25 +0800 Subject: [PATCH 1/2] docs: update CI configuration documentation --- .github/workflows/ci.yml | 26 +++++++++++++++++++++++++- 1 file changed, 25 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 81e0d40..8271e65 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -11,6 +11,8 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 + with: + fetch-depth: 0 - name: Set up Go uses: actions/setup-go@v4 @@ -18,4 +20,26 @@ jobs: go-version: '1.21' - name: Test - run: go test -v ./... \ No newline at end of file + run: go test -v ./... + + release: + needs: test + runs-on: ubuntu-latest + if: github.ref == 'refs/heads/master' + steps: + - uses: actions/checkout@v4 + with: + fetch-depth: 0 + + - name: Setup Node.js + uses: actions/setup-node@v4 + with: + node-version: '18' + + - name: Install semantic-release + run: npm install -g semantic-release @semantic-release/github + + - name: Release + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + run: npx semantic-release \ No newline at end of file From a09e57eccb47772627521e207000ce089cda8c25 Mon Sep 17 00:00:00 2001 From: yxrxy <1532529704@qq.com> Date: Tue, 22 Jul 2025 16:52:36 +0800 Subject: [PATCH 2/2] ci: fix release job to only run on master push --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 8271e65..aa92193 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -25,7 +25,7 @@ jobs: release: needs: test runs-on: ubuntu-latest - if: github.ref == 'refs/heads/master' + if: github.event_name == 'push' && github.ref == 'refs/heads/master' steps: - uses: actions/checkout@v4 with: