XFE Git
XFE Studio Git
Git 首页 全局搜索
XFE 主站 文档 NuGet
公开
关注 0 Fork 0 Star 0
返回提交历史

XFEstudio/XFEExtension.NetCore.XFEConsole

优化部分CI工作流

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

代码差异

6 个文件 +49 -12
Modified .github/workflows/publish-packages.yml +13 -9
@@ -7,7 +7,7 @@ on:
7 7 workflow_dispatch:
8 8 inputs:
9 9 version:
10 description: Package version to publish, for example 3.0.9
10 description: Package version to publish, for example 1.0.0
11 11 required: true
12 12 type: string
13 13 skip_nuget_org:
@@ -60,10 +60,10 @@ jobs:
60 60 echo "PACKAGE_VERSION=$version" >> "$GITHUB_ENV"
61 61
62 62 - name: Restore
63 run: dotnet restore ${{ env.PROJECT_PATH }}
63 run: dotnet restore ${{ env.SOLUTION_PATH }}
64 64
65 65 - name: Build
66 run: dotnet build ${{ env.PROJECT_PATH }} --configuration Release --no-restore -p:GeneratePackageOnBuild=false -p:ContinuousIntegrationBuild=true -p:Version=${{ env.PACKAGE_VERSION }} -p:PackageVersion=${{ env.PACKAGE_VERSION }}
66 run: dotnet build ${{ env.SOLUTION_PATH }} --configuration Release --no-restore -p:GeneratePackageOnBuild=false -p:ContinuousIntegrationBuild=true -p:Version=${{ env.PACKAGE_VERSION }} -p:PackageVersion=${{ env.PACKAGE_VERSION }}
67 67
68 68 - name: Pack
69 69 run: dotnet pack ${{ env.PROJECT_PATH }} --configuration Release --no-build --no-restore --output ${{ env.PACKAGE_OUTPUT_DIR }} -p:GeneratePackageOnBuild=false -p:ContinuousIntegrationBuild=true -p:Version=${{ env.PACKAGE_VERSION }} -p:PackageVersion=${{ env.PACKAGE_VERSION }}
@@ -77,14 +77,19 @@ jobs:
77 77
78 78 - name: Publish to GitHub Packages
79 79 shell: pwsh
80 env:
81 GITHUB_PACKAGES_TOKEN: ${{ secrets.GH_PACKAGES_TOKEN }}
80 82 run: |
81 83 $packages = Get-ChildItem -Path "${{ env.PACKAGE_OUTPUT_DIR }}" -Filter *.nupkg -File
82 84 if (-not $packages) {
83 85 throw "No .nupkg files found in ${{ env.PACKAGE_OUTPUT_DIR }}"
84 86 }
85
87
86 88 foreach ($package in $packages) {
87 dotnet nuget push $package.FullName --source "https://nuget.pkg.github.com/${{ github.repository_owner }}/index.json" --api-key "${{ secrets.GITHUB_TOKEN }}" --skip-duplicate
89 dotnet nuget push $package.FullName `
90 --source "https://nuget.pkg.github.com/${{ github.repository_owner }}/index.json" `
91 --api-key "$env:GITHUB_PACKAGES_TOKEN" `
92 --skip-duplicate
88 93 }
89 94
90 95 - name: Publish to NuGet.org
@@ -101,18 +106,17 @@ jobs:
101 106 }
102 107
103 108 - name: Create GitHub Release
104 if: ${{ github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v') }}
105 109 uses: softprops/action-gh-release@v2
106 110 with:
107 tag_name: ${{ github.ref_name }}
108 name: XFEExtension.NetCore.XFEConsole ${{ github.ref_name }}
111 tag_name: ${{ env.PACKAGE_VERSION }}
112 name: V${{ env.PACKAGE_VERSION }}
109 113 generate_release_notes: true
110 114 append_body: true
111 115 body: |
112 116 ## Package feeds
113 117
114 118 - NuGet.org
115 - GitHub Packages: `https://nuget.pkg.github.com/${{ github.repository_owner }}/index.json`
119 - GitHub Packages
116 120 files: ${{ env.PACKAGE_OUTPUT_DIR }}/*.nupkg
117 121 fail_on_unmatched_files: true
118 122 prerelease: ${{ contains(env.PACKAGE_VERSION, '-') }}
Modified .github/workflows/validate.yml +2 -3
@@ -13,7 +13,6 @@ permissions:
13 13 env:
14 14 DOTNET_VERSION: 10.0.x
15 15 SOLUTION_PATH: XFEExtension.NetCore.XFEConsole.slnx
16 PROJECT_PATH: XFEExtension.NetCore.XFEConsole/XFEExtension.NetCore.XFEConsole.csproj
17 16
18 17 jobs:
19 18 build:
@@ -29,7 +28,7 @@ jobs:
29 28 dotnet-version: ${{ env.DOTNET_VERSION }}
30 29
31 30 - name: Restore
32 run: dotnet restore ${{ env.PROJECT_PATH }}
31 run: dotnet restore ${{ env.SOLUTION_PATH }}
33 32
34 33 - name: Build
35 run: dotnet build ${{ env.PROJECT_PATH }} --configuration Release --no-restore -p:GeneratePackageOnBuild=false -p:ContinuousIntegrationBuild=true
34 run: dotnet build ${{ env.SOLUTION_PATH }} --configuration Release --no-restore -p:GeneratePackageOnBuild=false -p:ContinuousIntegrationBuild=true
Added .idea/.idea.XFEExtension.NetCore.XFEConsole/.idea/.gitignore +15 -0
@@ -0,0 +1,15 @@
1 # 默认忽略的文件
2 /shelf/
3 /workspace.xml
4 # Rider 忽略的文件
5 /modules.xml
6 /.idea.XFEExtension.NetCore.XFEConsole.iml
7 /contentModel.xml
8 /projectSettingsUpdater.xml
9 # 基于编辑器的 HTTP 客户端请求
10 /httpRequests/
11 # 已忽略包含查询文件的默认文件夹
12 /queries/
13 # Datasource local storage ignored files
14 /dataSources/
15 /dataSources.local.xml
Added .idea/.idea.XFEExtension.NetCore.XFEConsole/.idea/encodings.xml +4 -0
@@ -0,0 +1,4 @@
1 <?xml version="1.0" encoding="UTF-8"?>
2 <project version="4">
3 <component name="Encoding" addBOMForNewFiles="with BOM under Windows, with no BOM otherwise" />
4 </project>
Added .idea/.idea.XFEExtension.NetCore.XFEConsole/.idea/indexLayout.xml +8 -0
@@ -0,0 +1,8 @@
1 <?xml version="1.0" encoding="UTF-8"?>
2 <project version="4">
3 <component name="UserContentModel">
4 <attachedFolders />
5 <explicitIncludes />
6 <explicitExcludes />
7 </component>
8 </project>
Added .idea/.idea.XFEExtension.NetCore.XFEConsole/.idea/vcs.xml +7 -0
@@ -0,0 +1,7 @@
1 <?xml version="1.0" encoding="UTF-8"?>
2 <project version="4">
3 <component name="VcsDirectoryMappings">
4 <mapping directory="" vcs="Git" />
5 <mapping directory="$PROJECT_DIR$" vcs="Git" />
6 </component>
7 </project>