From 99835d6018c36e273319ecd8aaefb6c24945eb14 Mon Sep 17 00:00:00 2001 From: Jeff Idago Date: Sat, 4 Oct 2025 12:21:59 +0800 Subject: [PATCH 1/3] ci: add semantic release --- .github/workflows/semantic-release.yml | 44 ++++++++++++++++++++++++++ .releaserc.yml | 25 +++++++++++++++ 2 files changed, 69 insertions(+) create mode 100644 .github/workflows/semantic-release.yml create mode 100644 .releaserc.yml diff --git a/.github/workflows/semantic-release.yml b/.github/workflows/semantic-release.yml new file mode 100644 index 0000000..a956ab1 --- /dev/null +++ b/.github/workflows/semantic-release.yml @@ -0,0 +1,44 @@ +name: Semantic Releases + +on: + push: + branches: + - master + - '*.x' + +permissions: + contents: write + pull-requests: write + issues: write + packages: write + statuses: write + +jobs: + run: + runs-on: ubuntu-latest + steps: + - name: Checkout Code + uses: actions/checkout@v4 + with: + persist-credentials: false + + - name: Setup Configuration + run: | + if [ -n "$GH_TOKEN_SECRET" ]; then + echo "GH_TOKEN=$GH_TOKEN_SECRET" >> $GITHUB_ENV + else + echo "GH_TOKEN=$GITHUB_TOKEN" >> $GITHUB_ENV + fi + env: + GH_TOKEN_SECRET: ${{ secrets.GH_TOKEN }} + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + + - name: Setup Node + uses: actions/setup-node@v4 + with: + node-version: 'lts/*' + + - name: Semantic Release + uses: cycjimmy/semantic-release-action@v4 + env: + GH_TOKEN: ${{ secrets.GH_TOKEN }} diff --git a/.releaserc.yml b/.releaserc.yml new file mode 100644 index 0000000..a438d78 --- /dev/null +++ b/.releaserc.yml @@ -0,0 +1,25 @@ +{ + "branches": [ + "master", + "*.x" + ], + "plugins": [ + "@semantic-release/commit-analyzer", + "@semantic-release/release-notes-generator", + [ + "@semantic-release/changelog", + { + "changelogFile": "CHANGELOG.md" + } + ], + [ + "@semantic-release/git", + { + "assets": [ + "CHANGELOG.md" + ] + } + ], + "@semantic-release/github" + ] +} From f946116f0597760d58de232ee0bc520fec270e0d Mon Sep 17 00:00:00 2001 From: Jefferson Idago Date: Sat, 4 Oct 2025 12:51:30 +0800 Subject: [PATCH 2/3] ci: update to v5 commit sha --- .github/workflows/semantic-release.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/semantic-release.yml b/.github/workflows/semantic-release.yml index a956ab1..27ffe03 100644 --- a/.github/workflows/semantic-release.yml +++ b/.github/workflows/semantic-release.yml @@ -39,6 +39,6 @@ jobs: node-version: 'lts/*' - name: Semantic Release - uses: cycjimmy/semantic-release-action@v4 + uses: cycjimmy/semantic-release-action@9cc899c47e6841430bbaedb43de1560a568dfd16 env: GH_TOKEN: ${{ secrets.GH_TOKEN }} From 334fcbdba2d7992ef3d0a1d738f41472fe6535c4 Mon Sep 17 00:00:00 2001 From: Jeff Idago Date: Sat, 4 Oct 2025 15:24:15 +0800 Subject: [PATCH 3/3] ci(semver): update to workflow_dispatch event --- .github/workflows/semantic-release.yml | 5 +---- .releaserc.yml | 1 + 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/.github/workflows/semantic-release.yml b/.github/workflows/semantic-release.yml index 27ffe03..3581d7c 100644 --- a/.github/workflows/semantic-release.yml +++ b/.github/workflows/semantic-release.yml @@ -1,10 +1,7 @@ name: Semantic Releases on: - push: - branches: - - master - - '*.x' + workflow_dispatch: permissions: contents: write diff --git a/.releaserc.yml b/.releaserc.yml index a438d78..e96c554 100644 --- a/.releaserc.yml +++ b/.releaserc.yml @@ -1,5 +1,6 @@ { "branches": [ + "main", "master", "*.x" ],