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.git
The following commit(s) were added to refs/heads/master by this push:
new abd02d1 ci: release from manual git tags instead of semantic-release
abd02d1 is described below
commit abd02d17ab0b7234510574088766658eecc63fb2
Author: Yang Luo <[email protected]>
AuthorDate: Sat Aug 15 22:35:59 2026 +0800
ci: release from manual git tags instead of semantic-release
---
.github/workflows/build.yml | 20 -------
.github/workflows/release.yml | 126 +++++++++++++++++++++++-------------------
.releaserc.json | 24 --------
3 files changed, 69 insertions(+), 101 deletions(-)
diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml
index 2d9a563..a273b1b 100644
--- a/.github/workflows/build.yml
+++ b/.github/workflows/build.yml
@@ -80,26 +80,6 @@ jobs:
name: "drop-ci-test-results"
path: './test-results'
- dry-run-semantic-release:
- runs-on: ubuntu-latest
- needs: build
- if: github.repository_owner == 'apache' && github.event_name == 'push'
-
- steps:
- - name: Checkout
- uses: actions/checkout@v4
-
- - name: Setup Node.js
- uses: actions/setup-node@v4
- with:
- node-version: 20
-
- - name: Dry run semantic-release
- run: |
- export PATH=$PATH:$(yarn global bin)
- yarn global add [email protected]
- semantic-release --dry-run
-
release-build-version:
runs-on: windows-latest
needs: build
diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml
index 5b3f0dd..9d4b030 100644
--- a/.github/workflows/release.yml
+++ b/.github/workflows/release.yml
@@ -1,22 +1,19 @@
name: Release
+# Releases are driven by manually pushed git tags (no automatic versioning):
+# v1.4.0-rc1 -> GitHub pre-release only (the artifact used for the Apache
vote)
+# v1.4.0 -> GitHub release + push packages to the package registries
on:
push:
- branches:
- - master
- - main
- - 1.x
- workflow_dispatch:
+ tags:
+ - 'v*'
env:
SHA: ${{ GITHUB.SHA }}
REF: ${{ GITHUB.REF }}
RUN_ID: ${{ GITHUB.RUN_ID }}
RUN_NUMBER: ${{ GITHUB.RUN_NUMBER }}
- BUILD_RUN_NUMBER: build.${{ GITHUB.RUN_NUMBER }}
GITHUB_TOKEN: ${{ SECRETS.GITHUB_TOKEN }}
- NUGET_API_TOKEN: ${{ SECRETS.NUGET_API_KEY }}
- COVERALLS_REPO_TOKEN: ${{ SECRETS.COVERALLS_REPO_TOKEN }}
jobs:
build:
@@ -50,29 +47,7 @@ jobs:
run: dotnet build -c Release --no-restore
- name: Test solution
- run: dotnet test -c Release --no-build --no-restore --verbosity normal
--results-directory test-results --collect:"XPlat Code Coverage" `
- --
DataCollectionRunSettings.DataCollectors.DataCollector.Configuration.Format=json,cobertura,lcov,teamcity,opencover
-
- - name: Upload coverage
- run: |
- dotnet tool install coveralls.net --version 3.0.0 --tool-path tools;
- $CommitAuthor = git show -s --pretty=format:"%cn";
- echo "Coomit author is: $CommitAuthor";
- $CommitAuthorEmail = git show -s --pretty=format:"%ce";
- echo "Coomit author email is: $CommitAuthorEmail";
- $CommitMessage = git show -s --pretty=format:"%s";
- echo "Coomit message is: $CommitMessage";
- cp test-results/**/*.opencover.xml test-results
- tools/csmacnz.Coveralls --opencover -i
test-results/coverage.opencover.xml --repoToken $env:COVERALLS_REPO_TOKEN `
- --commitId $env:SHA --commitBranch $env:REF --commitAuthor
"$CommitAuthor" `
- --commitEmail "$CommitAuthorEmail" --commitMessage "$CommitMessage" `
- --jobId $env:RUN_NUMBER --serviceName github-actions
--useRelativePaths;
-
- if($LastExitCode -ne 0)
- {
- Write-Warning -Message "Can not upload coverage, last exit code is
${LastExitCode}."
- $LastExitCode = 0;
- }
+ run: dotnet test -c Release --no-build --no-restore --verbosity normal
--results-directory test-results
- name: Upload test results artefacts
uses: actions/upload-artifact@v4
@@ -80,32 +55,83 @@ jobs:
name: "drop-ci-test-results"
path: './test-results'
- run-semantic-release:
+ github-release:
runs-on: ubuntu-latest
needs: build
- if: github.repository_owner == 'apache' && github.event_name == 'push'
+ if: github.repository_owner == 'apache'
+
+ permissions:
+ contents: write
+
+ outputs:
+ version: ${{ steps.version.outputs.version }}
+ prerelease: ${{ steps.version.outputs.prerelease }}
steps:
- name: Checkout
uses: actions/checkout@v4
+ with:
+ fetch-depth: 0
- - name: Setup Node.js
- uses: actions/setup-node@v4
+ - name: Resolve version from tag
+ id: version
+ run: |
+ TAG="${GITHUB_REF_NAME}"
+ VERSION="${TAG#v}"
+ if [[ "$VERSION" =~ ^(.+)-[Rr][Cc][0-9]+$ ]]; then
+ PRERELEASE=true
+ BASE_VERSION="${BASH_REMATCH[1]}"
+ else
+ PRERELEASE=false
+ BASE_VERSION="$VERSION"
+ fi
+ echo "tag=$TAG" >> "$GITHUB_OUTPUT"
+ echo "version=$VERSION" >> "$GITHUB_OUTPUT"
+ echo "base_version=$BASE_VERSION" >> "$GITHUB_OUTPUT"
+ echo "prerelease=$PRERELEASE" >> "$GITHUB_OUTPUT"
+ echo "Tag: $TAG, version: $VERSION, base version: $BASE_VERSION,
prerelease: $PRERELEASE"
+
+ # The source package must carry the name the final release will have, so
the
+ # artifact voted on as a release candidate is bit-identical to the
released one.
+ # The release manager downloads it, signs it locally and uses it for the
vote.
+ - name: Create Apache source release package
+ id: source
+ run: |
+ BASE_VERSION="${{ steps.version.outputs.base_version }}"
+ NAME="apache-casbin-net-${BASE_VERSION}-incubating-src"
+ mkdir -p dist
+ git archive --format=tar.gz --prefix="${NAME}/" -o
"dist/${NAME}.tar.gz" "${GITHUB_REF_NAME}"
+ (cd dist && sha512sum "${NAME}.tar.gz" > "${NAME}.tar.gz.sha512")
+ echo "name=$NAME" >> "$GITHUB_OUTPUT"
+ ls -l dist
+
+ - name: Upload source release artefacts
+ uses: actions/upload-artifact@v4
with:
- node-version: 20
+ name: "drop-ci-source-release"
+ path: './dist'
- - name: Run semantic-release
+ - name: Create GitHub release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
- export PATH=$PATH:$(yarn global bin)
- yarn global add [email protected]
- semantic-release
+ if [[ "${{ steps.version.outputs.prerelease }}" == "true" ]]; then
+ PRERELEASE_FLAG="--prerelease"
+ else
+ PRERELEASE_FLAG=""
+ fi
+ gh release create "${GITHUB_REF_NAME}" \
+ --title "${GITHUB_REF_NAME}" \
+ --generate-notes \
+ $PRERELEASE_FLAG \
+ "dist/${{ steps.source.outputs.name }}.tar.gz" \
+ "dist/${{ steps.source.outputs.name }}.tar.gz.sha512"
push-packages:
runs-on: windows-latest
- needs: run-semantic-release
- if: github.repository_owner == 'apache' && github.event_name == 'push'
+ needs: github-release
+ # Release candidates are only voted on, they are never published to the
registries.
+ if: github.repository_owner == 'apache' &&
needs.github-release.outputs.prerelease == 'false'
steps:
- name: Checkout
@@ -113,12 +139,6 @@ jobs:
with:
fetch-depth: 0
- - name: Git fetch tags
- run: git fetch --tags
-
- - name: Check tags
- run: git tag -l -n
-
- name: Setup .NET SDK
uses: actions/setup-dotnet@v4
with:
@@ -142,18 +162,10 @@ jobs:
- name: Pack packages
run: |
- $LastTag = git describe --tags (git rev-list --tags --max-count=1);
- echo "Last tag is: $LastTag";
- $Version = ($LastTag).TrimStart('v');
+ $Version = "${{ needs.github-release.outputs.version }}";
echo "Publishing version: $Version";
dotnet pack -c Release -o packages /p:PackageVersion=$Version
/p:Version=$Version;
- if($LastExitCode -ne 0)
- {
- Write-Warning -Message "Pack packages warming, last exit code
is ${LastExitCode}."
- $LastExitCode = 0;
- }
-
- name: Upload packages artefacts
uses: actions/upload-artifact@v4
with:
diff --git a/.releaserc.json b/.releaserc.json
deleted file mode 100644
index c581290..0000000
--- a/.releaserc.json
+++ /dev/null
@@ -1,24 +0,0 @@
-{
- "debug": true,
- "branches": [
- "+([0-9])?(.{+([0-9]),x}).x",
- "master",
- {
- "name": "alpha",
- "prerelease": true
- },
- {
- "name": "preview",
- "prerelease": true
- },
- {
- "name": "rc",
- "prerelease": true
- }
- ],
- "plugins": [
- "@semantic-release/commit-analyzer",
- "@semantic-release/release-notes-generator",
- "@semantic-release/github"
- ]
-}
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]