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-jcasbin-jdbc-adapter.git


The following commit(s) were added to refs/heads/master by this push:
     new 7d71287  feat: replace semantic-release with tag-triggered manual 
release
7d71287 is described below

commit 7d712873d819fd3f11087384c093544c5e0c153b
Author: Yang Luo <[email protected]>
AuthorDate: Wed Aug 5 02:05:00 2026 +0800

    feat: replace semantic-release with tag-triggered manual release
---
 .github/workflows/maven-ci.yml |  21 ------
 .github/workflows/release.yml  | 155 +++++++++++++++++++++++++++++++++++++++++
 maven-settings.xml             |  22 ------
 3 files changed, 155 insertions(+), 43 deletions(-)

diff --git a/.github/workflows/maven-ci.yml b/.github/workflows/maven-ci.yml
index bdd6b19..e1b1d9f 100644
--- a/.github/workflows/maven-ci.yml
+++ b/.github/workflows/maven-ci.yml
@@ -54,11 +54,6 @@ jobs:
         uses: actions/setup-java@v1
         with:
           java-version: 1.8
-          server-id: ossrh
-          server-username: OSSRH_JIRA_USERNAME
-          server-password: OSSRH_JIRA_PASSWORD
-          gpg-private-key: ${{ secrets.GPG_PRIVATE_KEY }}
-          gpg-passphrase: GPG_PASSPHRASE
 
       - name: Build with Maven
         run: mvn clean test cobertura:cobertura
@@ -67,19 +62,3 @@ jobs:
         uses: codecov/codecov-action@v1
         with:
           token: ${{ secrets.CODECOV_TOKEN }}
-
-      - name: Set up Node.js
-        uses: actions/setup-node@v2
-        with:
-          node-version: 20
-
-      - name: Semantic Release
-        run: |
-          npm install -g @conveyal/maven-semantic-release semantic-release
-          semantic-release --prepare @conveyal/maven-semantic-release 
--publish @semantic-release/github,@conveyal/maven-semantic-release 
--verify-conditions @semantic-release/github,@conveyal/maven-semantic-release 
--verify-release @conveyal/maven-semantic-release
-        env:
-          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
-          GPG_KEY_NAME: ${{ secrets.GPG_KEY_NAME }}
-          GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }}
-          OSSRH_JIRA_USERNAME: ${{ secrets.OSSRH_JIRA_USERNAME }}
-          OSSRH_JIRA_PASSWORD: ${{ secrets.OSSRH_JIRA_PASSWORD }}
diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml
new file mode 100644
index 0000000..d2c64a8
--- /dev/null
+++ b/.github/workflows/release.yml
@@ -0,0 +1,155 @@
+name: release
+
+# Releases are triggered manually, by pushing a git tag. There is no automatic
+# release on merge/commit: as an Apache (incubating) project, every release 
must
+# pass a formal vote before it can be published.
+#
+#   v1.4.0-rc1  -> GitHub *pre-release* only (the candidate used for voting)
+#   v1.4.0      -> GitHub release + publish to Maven Central
+#
+# In both cases the release carries the source package that the release manager
+# downloads, signs locally (.asc / .sha512) and uploads to dist.apache.org for
+# the vote. This workflow deliberately does not touch anything on the Apache
+# side - no signing, no svn, no re-upload of signed artifacts.
+
+on:
+  push:
+    tags:
+      - 'v*'
+
+permissions:
+  contents: write
+
+jobs:
+  release:
+    runs-on: ubuntu-latest
+    steps:
+      - name: Checkout
+        uses: actions/checkout@v4
+
+      - name: Resolve version from tag
+        id: version
+        run: |
+          set -euo pipefail
+          TAG="${GITHUB_REF_NAME}"
+          if [[ ! "$TAG" =~ ^v[0-9]+\.[0-9]+\.[0-9]+(-rc[0-9]+)?$ ]]; then
+            echo "::error::Tag '$TAG' has an unexpected format. Use v<x.y.z> 
(e.g. v1.4.0) or v<x.y.z>-rc<n> (e.g. v1.4.0-rc1)."
+            exit 1
+          fi
+
+          BASE="${TAG#v}"           # 1.4.0  |  1.4.0-rc1
+          VERSION="${BASE%%-rc*}"   # 1.4.0
+          if [[ "$BASE" == *-rc* ]]; then
+            IS_RC=true
+            RC="${BASE##*-}"        # rc1
+          else
+            IS_RC=false
+            RC=""
+          fi
+
+          # The Maven coordinates keep the plain version - the "-incubating"
+          # suffix is only carried by the Apache source package, which is the
+          # artifact the incubator actually votes on.
+          #
+          # Apache source package naming: apache-<project>-<version>-src.tar.gz
+          # The RC number is not part of the file name, it only appears in the
+          # vote thread and in the dist.apache.org staging path.
+          SRC_NAME="apache-casbin-jdbc-adapter-${VERSION}-incubating-src"
+
+          {
+            echo "tag=$TAG"
+            echo "is_rc=$IS_RC"
+            echo "rc=$RC"
+            echo "version=$VERSION"
+            echo "src_name=$SRC_NAME"
+          } >> "$GITHUB_OUTPUT"
+
+          echo "Tag=$TAG version=$VERSION is_rc=$IS_RC ${RC:+rc=$RC}"
+
+      - name: Set up JDK 1.8
+        uses: actions/setup-java@v4
+        with:
+          distribution: temurin
+          java-version: '8'
+          server-id: ossrh
+          server-username: MAVEN_USERNAME
+          server-password: MAVEN_PASSWORD
+          gpg-private-key: ${{ secrets.GPG_PRIVATE_KEY }}
+          gpg-passphrase: MAVEN_GPG_PASSPHRASE
+
+      - name: Stamp the release version into the POM
+        run: mvn -B versions:set -DnewVersion=${{ 
steps.version.outputs.version }} -DgenerateBackupPoms=false
+
+      - name: Build the source package
+        env:
+          SRC_NAME: ${{ steps.version.outputs.src_name }}
+        run: |
+          set -euo pipefail
+          # The file list comes from git, so the package holds exactly the
+          # tracked sources of the tag - no build output, no VCS metadata.
+          # The contents are read from the working tree, so the POM already
+          # carries the release version and the package builds as-is.
+          git ls-files -z | tar --null -T - \
+            --transform "s,^,$SRC_NAME/," \
+            -czf "$SRC_NAME.tar.gz"
+          ls -l "$SRC_NAME.tar.gz"
+          tar -tzf "$SRC_NAME.tar.gz"
+
+      # Only a passed vote may be published, so release candidates never reach
+      # the package registry.
+      - name: Publish to Maven Central
+        if: steps.version.outputs.is_rc == 'false'
+        env:
+          MAVEN_USERNAME: ${{ secrets.OSSRH_JIRA_USERNAME }}
+          MAVEN_PASSWORD: ${{ secrets.OSSRH_JIRA_PASSWORD }}
+          MAVEN_GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }}
+        run: mvn -B clean deploy -DskipTests
+
+      - name: Write release notes
+        env:
+          TAG: ${{ steps.version.outputs.tag }}
+          IS_RC: ${{ steps.version.outputs.is_rc }}
+          RC: ${{ steps.version.outputs.rc }}
+          VERSION: ${{ steps.version.outputs.version }}
+          SRC_NAME: ${{ steps.version.outputs.src_name }}
+        run: |
+          set -euo pipefail
+          if [[ "$IS_RC" == "true" ]]; then
+            cat > release-notes.md <<EOF
+          Release candidate \`$RC\` for **$VERSION**.
+
+          This is *not* an official Apache release. It is the candidate put up 
for
+          the Apache Casbin (incubating) release vote, published here so the 
release
+          manager can download \`$SRC_NAME.tar.gz\`, sign it locally and stage 
it on
+          dist.apache.org. It is not published to Maven Central.
+          EOF
+          else
+            cat > release-notes.md <<EOF
+          Apache Casbin (incubating) JDBC Adapter **$VERSION**.
+
+          The source package \`$SRC_NAME.tar.gz\` is attached, and the 
convenience
+          binaries are published to Maven Central as 
\`org.casbin:jdbc-adapter:$VERSION\`.
+          EOF
+          fi
+          cat release-notes.md
+
+      - name: Publish GitHub pre-release (RC)
+        if: steps.version.outputs.is_rc == 'true'
+        env:
+          GH_TOKEN: ${{ github.token }}
+        run: |
+          gh release create "${{ steps.version.outputs.tag }}" \
+            "${{ steps.version.outputs.src_name }}.tar.gz" \
+            --title "${{ steps.version.outputs.tag }}" \
+            --notes-file release-notes.md \
+            --prerelease
+
+      - name: Publish GitHub release
+        if: steps.version.outputs.is_rc == 'false'
+        env:
+          GH_TOKEN: ${{ github.token }}
+        run: |
+          gh release create "${{ steps.version.outputs.tag }}" \
+            "${{ steps.version.outputs.src_name }}.tar.gz" \
+            --title "${{ steps.version.outputs.tag }}" \
+            --notes-file release-notes.md
diff --git a/maven-settings.xml b/maven-settings.xml
deleted file mode 100644
index 9600d94..0000000
--- a/maven-settings.xml
+++ /dev/null
@@ -1,22 +0,0 @@
-<settings>
-    <servers>
-        <server>
-            <id>ossrh</id>
-            <username>${OSSRH_JIRA_USERNAME}</username>
-            <password>${OSSRH_JIRA_PASSWORD}</password>
-        </server>
-    </servers>
-    <profiles>
-        <profile>
-            <id>ossrh</id>
-            <activation>
-                <activeByDefault>true</activeByDefault>
-            </activation>
-            <properties>
-                <gpg.executable>gpg</gpg.executable>
-                <gpg.keyname>${GPG_KEY_NAME}</gpg.keyname>
-                <gpg.passphrase>${GPG_PASSPHRASE}</gpg.passphrase>
-            </properties>
-        </profile>
-    </profiles>
-</settings>


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to