XFE Git
XFE Studio Git
Git 首页 全局搜索
XFE 主站 文档 NuGet

XFEExtension.NetCore.ServerInteractive

[DLL] Server interaction extension, including user identity verification and querying in conjunction with AutoConfig

公开
关注 0 Fork 0 Star 0
返回提交历史

XFEstudio/XFEExtension.NetCore.ServerInteractive

Add GitHub Release publishing to package workflow

a21ef31
XFE工作室室长 <mail@xfegzs.com>
提交于

代码差异

2 个文件 +41 -5
Modified .github/PUBLISHING.md +18 -4
@@ -13,19 +13,33 @@ Add this repository secret before publishing to NuGet.org:
13 13
14 14 No extra secret is required for GitHub Packages. The workflow uses the built-in `GITHUB_TOKEN` and requests `packages: write`.
15 15
16 The same built-in `GITHUB_TOKEN` is also used to create the GitHub Release and upload package assets.
17
16 18 ## Recommended release flow
17 19
18 20 1. Update the project and verify CI is green.
19 21 2. Push a version tag such as `v3.0.9`.
20 3. GitHub Actions will build, pack, upload the generated `.nupkg` as an artifact, then publish it to:
21 - NuGet.org
22 - GitHub Packages at `https://nuget.pkg.github.com/XFEstudio/index.json`
22 3. GitHub Actions will automatically do all of the following:
23 - build and pack the project
24 - upload the generated `.nupkg` as a workflow artifact
25 - publish the package to NuGet.org
26 - publish the package to GitHub Packages at `https://nuget.pkg.github.com/XFEstudio/index.json`
27 - create a GitHub Release for that tag
28 - attach the generated `.nupkg` files to the GitHub Release
29
30 ## Tag-triggered release behavior
31
32 When you push a new tag like `v3.0.9`, that single action is the release trigger for the entire pipeline. You do not need to manually start the workflow afterward.
33
34 The release workflow is tied to `push.tags: v*`, so each new version tag automatically runs the full publishing flow.
23 35
24 36 ## Manual publish
25 37
26 If you need to republish with a specific version from the GitHub Actions UI:
38 If you need to republish packages from the GitHub Actions UI:
27 39
28 40 1. Open `Publish Packages`.
29 41 2. Click `Run workflow`.
30 42 3. Fill in the `version` input.
31 43 4. Optionally set `skip_nuget_org` to `true` when you only want GitHub Packages.
44
45 Manual runs publish packages, but GitHub Release creation is only performed for real tag pushes so the release stays aligned with the repository tag history.
Modified .github/workflows/publish-packages.yml +23 -1
@@ -17,7 +17,7 @@ on:
17 17 type: boolean
18 18
19 19 permissions:
20 contents: read
20 contents: write
21 21 packages: write
22 22
23 23 env:
@@ -82,6 +82,23 @@ jobs:
82 82 if: ${{ github.event_name != 'workflow_dispatch' || !inputs.skip_nuget_org }}
83 83 run: dotnet nuget push ${{ env.PACKAGE_OUTPUT_DIR }}/*.nupkg --source "https://api.nuget.org/v3/index.json" --api-key "${{ secrets.NUGET_API_KEY }}" --skip-duplicate
84 84
85 - name: Create GitHub Release
86 if: ${{ github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v') }}
87 uses: softprops/action-gh-release@v2
88 with:
89 tag_name: ${{ github.ref_name }}
90 name: XFEExtension.NetCore.ServerInteractive ${{ github.ref_name }}
91 generate_release_notes: true
92 append_body: true
93 body: |
94 ## Package feeds
95
96 - NuGet.org
97 - GitHub Packages: `https://nuget.pkg.github.com/${{ github.repository_owner }}/index.json`
98 files: ${{ env.PACKAGE_OUTPUT_DIR }}/*.nupkg
99 fail_on_unmatched_files: true
100 prerelease: ${{ contains(env.PACKAGE_VERSION, '-') }}
101
85 102 - name: Publish summary
86 103 shell: bash
87 104 run: |
@@ -95,4 +112,9 @@ jobs:
95 112 else
96 113 echo "- NuGet.org: published"
97 114 fi
115 if [[ "${{ github.event_name }}" == "push" && "${GITHUB_REF_NAME}" == v* ]]; then
116 echo "- GitHub Release: created"
117 else
118 echo "- GitHub Release: skipped"
119 fi
98 120 } >> "$GITHUB_STEP_SUMMARY"