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/10/07 03:00:25 UTC
(casbin-Casbin.NET-dotnet-cli) 02/02: feat: release the CLI binaries only from a manually pushed tag
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-Casbin.NET-dotnet-cli.git
commit bdaa44f86bc58980d5c7f250a70690546eae6dee
Author: Yang Luo <hs...@gmail.com>
AuthorDate: Wed Oct 7 10:48:55 2026 +0800
feat: release the CLI binaries only from a manually pushed tag
---
.github/workflows/build.yml | 119 +++++++++++++++++++++++++++++---------------
.releaserc.json | 29 -----------
README.md | 1 -
3 files changed, 79 insertions(+), 70 deletions(-)
diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml
index f827c45..3bae991 100644
--- a/.github/workflows/build.yml
+++ b/.github/workflows/build.yml
@@ -87,43 +87,82 @@ jobs:
name: binaries-${{ matrix.platform }}
path: dist/casbin-dotnet-cli-${{ matrix.output_name }}
- release:
- needs: [test, build-binaries]
- if: github.event_name == 'push' && github.ref == 'refs/heads/master'
- runs-on: ubuntu-latest
- permissions:
- contents: write
- steps:
- - name: Checkout
- uses: actions/checkout@v4
- with:
- fetch-depth: 0
- persist-credentials: false
-
- - name: Setup Node.js
- uses: actions/setup-node@v4
- with:
- node-version: 20
-
- - name: Setup .NET
- uses: actions/setup-dotnet@v4
- with:
- dotnet-version: '8.0'
- dotnet-quality: 'ga'
-
- - name: Download all artifacts
- uses: actions/download-artifact@v4
- with:
- path: artifacts
-
- - name: Move binaries to dist
- run: |
- mkdir -p dist
- find artifacts -name "casbin-dotnet-cli-*" -type f -exec cp {} dist/ \;
- ls -la dist/
-
- - name: Release
- id: semantic
- env:
- GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- run: npx semantic-release@v19.0.2
\ No newline at end of file
+ # Releases are cut by hand: nothing here runs on a merge, only on a pushed tag.
+ #
+ # v1.4.0-rc1 -> GitHub pre-release (the candidate put up for the Apache vote)
+ # v1.4.0 -> GitHub release
+ #
+ # Either way the release carries an Apache-style source tarball plus the CLI
+ # binaries built above. The release manager downloads the tarball and signs /
+ # checksums it locally before starting the vote; nothing is signed here.
+ release:
+ needs: [test, build-binaries]
+ if: github.repository == 'apache/casbin-Casbin.NET-dotnet-cli' && startsWith(github.ref, 'refs/tags/v')
+ runs-on: ubuntu-latest
+ permissions:
+ contents: write
+ env:
+ # Base name of the source release artifact, per Apache naming conventions.
+ ARTIFACT_BASENAME: apache-casbin-dotnet-cli
+ steps:
+ - name: Checkout
+ uses: actions/checkout@v4
+
+ - name: Resolve version from tag
+ id: version
+ run: |
+ set -euo pipefail
+ VERSION="${GITHUB_REF_NAME#v}"
+ # v1.4.0-rc1 -> 1.4.0. The tarball the PPMC votes on is the exact tarball
+ # that ships, so the candidate counter is never part of its name.
+ BASE_VERSION="${VERSION%%-rc*}"
+ if [ "$VERSION" = "$BASE_VERSION" ]; then
+ PRERELEASE=false
+ else
+ PRERELEASE=true
+ fi
+ if ! echo "$VERSION" | grep -Eq '^[0-9]+\.[0-9]+\.[0-9]+(-rc[0-9]+)?$'; then
+ echo "::error::Tag $GITHUB_REF_NAME is not vX.Y.Z or vX.Y.Z-rcN."
+ exit 1
+ fi
+ {
+ echo "base_version=$BASE_VERSION"
+ echo "prerelease=$PRERELEASE"
+ } >> "$GITHUB_OUTPUT"
+ echo "Tag $GITHUB_REF_NAME -> version $BASE_VERSION (pre-release: $PRERELEASE)"
+
+ - name: Build source release tarball
+ id: package
+ run: |
+ set -euo pipefail
+ NAME="${ARTIFACT_BASENAME}-${{ steps.version.outputs.base_version }}-incubating-src"
+ ASSET="${RUNNER_TEMP}/${NAME}.tar.gz"
+ # git archive gives us exactly the tracked sources at this tag, unpacking
+ # into a single top-level directory named after the release.
+ git archive --format=tar.gz --prefix="$NAME/" -o "$ASSET" HEAD
+ echo "asset=$ASSET" >> "$GITHUB_OUTPUT"
+ ls -l "$ASSET"
+
+ - name: Download all artifacts
+ uses: actions/download-artifact@v4
+ with:
+ path: artifacts
+
+ - name: Move binaries to dist
+ run: |
+ mkdir -p dist
+ find artifacts -name "casbin-dotnet-cli-*" -type f -exec cp {} dist/ \;
+ ls -la dist/
+
+ - name: Publish GitHub release
+ env:
+ GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
+ TAG: ${{ github.ref_name }}
+ ASSET: ${{ steps.package.outputs.asset }}
+ run: |
+ set -euo pipefail
+ FLAGS=(--title "$TAG" --generate-notes)
+ if [ "${{ steps.version.outputs.prerelease }}" = "true" ]; then
+ FLAGS+=(--prerelease)
+ fi
+ gh release create "$TAG" "$ASSET" dist/casbin-dotnet-cli-* "${FLAGS[@]}"
diff --git a/.releaserc.json b/.releaserc.json
deleted file mode 100644
index 443d0a7..0000000
--- a/.releaserc.json
+++ /dev/null
@@ -1,29 +0,0 @@
-{
- "branches": [
- "master",
- "main",
- {
- "name": "dev",
- "prerelease": true
- },
- {
- "name": "beta",
- "prerelease": true
- },
- {
- "name": "+([0-9])?(.{+([0-9]),x}).x",
- "prerelease": false
- }
- ],
- "plugins": [
- "@semantic-release/commit-analyzer",
- "@semantic-release/release-notes-generator",
- ["@semantic-release/github", {
- "assets": [
- "dist/casbin-dotnet-cli-linux-*",
- "dist/casbin-dotnet-cli-darwin-*",
- "dist/casbin-dotnet-cli-windows-*"
- ]
- }]
- ]
-}
\ No newline at end of file
diff --git a/README.md b/README.md
index 3ffc52b..5ee2d08 100644
--- a/README.md
+++ b/README.md
@@ -42,7 +42,6 @@ casbin-dotnet-cli/
│ ├── abac_model.conf # ABAC model file
│ └── abac_policy.csv # ABAC policy file
├── build.ps1 # Local multi-platform build script
-├── .releaserc.json # Semantic release configuration
├── README.md # Project documentation
└── casbin-dotnet-cli.sln # Visual Studio solution file
```
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@casbin.apache.org
For additional commands, e-mail: commits-help@casbin.apache.org