You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@casbin.apache.org by hs...@apache.org on 2026/08/06 10:05:57 UTC

(casbin-redis-watcher) branch master updated: ci: release manually via git tag instead of semantic-release

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

hsluoyz pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/casbin-redis-watcher.git


The following commit(s) were added to refs/heads/master by this push:
     new 019bbfe  ci: release manually via git tag instead of semantic-release
019bbfe is described below

commit 019bbfe6dcae1e513bebeac05370419cc2e8a749
Author: Yang Luo <hs...@gmail.com>
AuthorDate: Thu Aug 6 18:05:50 2026 +0800

    ci: release manually via git tag instead of semantic-release
---
 .github/workflows/ci.yml      |  23 ----------
 .github/workflows/release.yml | 103 ++++++++++++++++++++++++++++++++++++++++++
 .releaserc.json               |  16 -------
 3 files changed, 103 insertions(+), 39 deletions(-)

diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml
index bfcb8be..bed8c79 100644
--- a/.github/workflows/ci.yml
+++ b/.github/workflows/ci.yml
@@ -41,26 +41,3 @@ jobs:
         env:
           COVERALLS_TOKEN: ${{ secrets.GITHUB_TOKEN }}
         run: goveralls -coverprofile=covprofile -service=github
-
-  semantic-release:
-    needs: [test]
-    if: github.repository == 'casbin/redis-watcher' && github.event_name == 'push'
-    runs-on: ubuntu-latest
-    permissions:
-      contents: write
-    steps:
-      - name: Checkout code
-        uses: actions/checkout@v3
-
-      - name: Install Node.js
-        uses: actions/setup-node@v3
-        with:
-          node-version: '18.x'
-
-      - name: Install semantic-release
-        run: npm install --save-dev semantic-release@21.0.0 @semantic-release/commit-analyzer @semantic-release/release-notes-generator @semantic-release/github
-
-      - name: Run semantic-release
-        run: npx semantic-release
-        env:
-          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml
new file mode 100644
index 0000000..884da33
--- /dev/null
+++ b/.github/workflows/release.yml
@@ -0,0 +1,103 @@
+name: Release
+
+# Releases are cut manually by pushing a tag, there is no automatic release.
+#
+#   v1.4.0-rc1  ->  GitHub pre-release (the artifact the Apache vote runs on)
+#   v1.4.0      ->  GitHub release + publish to the Go module proxy
+#
+# Both cases attach an Apache-style source package. The release manager
+# downloads it and signs/checksums it locally before starting the vote.
+
+on:
+  push:
+    tags:
+      - 'v*'
+
+jobs:
+  release:
+    if: github.repository == 'casbin/redis-watcher'
+    runs-on: ubuntu-latest
+    permissions:
+      contents: write
+
+    steps:
+      - name: Checkout code
+        uses: actions/checkout@v4
+
+      - name: Resolve version
+        id: version
+        run: |
+          set -euo pipefail
+          TAG="${GITHUB_REF_NAME}"
+          VERSION="${TAG#v}"
+
+          # The RC suffix marks a candidate, it is not part of the released
+          # version: the artifact voted on must be the artifact released, so
+          # the source package is always named after the final version.
+          BASE="$(printf '%s' "$VERSION" | sed -E 's/-[Rr][Cc].*$//')"
+
+          if [ "$BASE" = "$VERSION" ]; then
+            IS_RC=false
+          else
+            IS_RC=true
+          fi
+
+          {
+            echo "tag=$TAG"
+            echo "is_rc=$IS_RC"
+            echo "name=apache-casbin-redis-watcher-${BASE}-incubating-src"
+          } >> "$GITHUB_OUTPUT"
+
+      - name: Build source package
+        run: |
+          set -euo pipefail
+          NAME="${{ steps.version.outputs.name }}"
+          git archive --format=tar.gz --prefix="${NAME}/" -o "${NAME}.tar.gz" HEAD
+          tar -tzf "${NAME}.tar.gz"
+
+      - name: Create GitHub pre-release
+        if: steps.version.outputs.is_rc == 'true'
+        env:
+          GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
+        run: |
+          gh release create "${{ steps.version.outputs.tag }}" \
+            "${{ steps.version.outputs.name }}.tar.gz" \
+            --title "${{ steps.version.outputs.tag }}" \
+            --prerelease \
+            --generate-notes \
+            --notes "Release candidate for the Apache vote. Not a released version."
+
+      - name: Create GitHub release
+        if: steps.version.outputs.is_rc == 'false'
+        env:
+          GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
+        run: |
+          gh release create "${{ steps.version.outputs.tag }}" \
+            "${{ steps.version.outputs.name }}.tar.gz" \
+            --title "${{ steps.version.outputs.tag }}" \
+            --generate-notes
+
+      - name: Set up Go
+        if: steps.version.outputs.is_rc == 'false'
+        uses: actions/setup-go@v5
+        with:
+          go-version: '1.23'
+
+      - name: Publish to the Go module proxy
+        if: steps.version.outputs.is_rc == 'false'
+        env:
+          GOPROXY: proxy.golang.org
+          TAG: ${{ steps.version.outputs.tag }}
+        run: |
+          set -euo pipefail
+          MODULE="$(go list -m)"
+          # The proxy only sees the tag once it has fetched it, so give it a
+          # few tries before calling the publish a failure.
+          for i in 1 2 3 4 5; do
+            if go list -m "${MODULE}@${TAG}"; then
+              exit 0
+            fi
+            echo "proxy has not picked up ${MODULE}@${TAG} yet, retrying ($i/5)"
+            sleep 15
+          done
+          exit 1
diff --git a/.releaserc.json b/.releaserc.json
deleted file mode 100644
index 7921c59..0000000
--- a/.releaserc.json
+++ /dev/null
@@ -1,16 +0,0 @@
-{
-  "debug": true,
-  "branches": [
-    "+([0-9])?(.{+([0-9]),x}).x",
-    "master",
-    {
-      "name": "beta",
-      "prerelease": true
-    }
-  ],
-  "plugins": [
-    "@semantic-release/commit-analyzer",
-    "@semantic-release/release-notes-generator",
-    "@semantic-release/github"
-  ]
-}
\ No newline at end of file


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@casbin.apache.org
For additional commands, e-mail: commits-help@casbin.apache.org