Skip to content

Commit a7d1dea

Browse files
authored
feat:update ci (#330)
1 parent 3eb9e2a commit a7d1dea

File tree

4 files changed

+53
-69
lines changed

4 files changed

+53
-69
lines changed

.github/workflows/build-windows.yml renamed to .github/workflows/build-ci.yml

Lines changed: 43 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,25 @@
1-
name: Build Windows
2-
on: [push, pull_request]
3-
env:
4-
DOTNET_CLI_TELEMETRY_OPTOUT: 1
1+
name: Build
2+
on:
3+
push:
4+
branches:
5+
- master
6+
paths:
7+
- '!**/*.md'
8+
workflow_dispatch:
9+
inputs:
10+
publish-github-package:
11+
type: boolean
12+
description: 'Github Package push'
13+
default: true
14+
required: false
15+
publish-myget-package:
16+
type: boolean
17+
description: 'MyGet Package push'
18+
default: true
19+
required: false
20+
521
jobs:
6-
build:
22+
build-test-pack:
723
runs-on: windows-latest
824
steps:
925
- name: Checkout
@@ -13,9 +29,7 @@ jobs:
1329
- name: Setup .NET Core
1430
uses: actions/setup-dotnet@v4
1531
with:
16-
dotnet-version: |
17-
6.x
18-
8.x
32+
dotnet-version: 9.x
1933

2034
- name: Build Reason
2135
run: "echo ref: ${{github.ref}} event: ${{github.event_name}}"
@@ -59,32 +73,40 @@ jobs:
5973
done
6074
6175
- name: Package
76+
if: ${{ inputs.publish-github-package || inputs.publish-myget-package}}
6277
shell: bash
63-
if: github.event_name != 'pull_request'
6478
run: |
6579
for project in $(find ./src -name "*.csproj"); do
6680
dotnet pack --configuration Release --no-build $project -p:PackageVersion=${{ env.FULL_VERSION }} -p:SymbolPackageFormat=snupkg --include-source --output ./artifacts/packages
6781
done
6882
6983
- name: Install GitHub Package Tool
70-
if: github.event_name != 'pull_request'
84+
if: ${{ inputs.publish-github-package}}
7185
run: dotnet tool install gpr -g
7286

7387
- name: Publish CI Packages
88+
if: ${{ inputs.publish-github-package || inputs.publish-myget-package}}
7489
shell: bash
75-
if: github.event_name != 'pull_request'
7690
run: |
7791
for package in $(find ./artifacts/packages/ -name "*.nupkg" -o -name "*.snupkg"); do
7892
echo "$package": Pushing $package...
7993
80-
# GitHub
81-
echo "Pushing to GitHub Package Registry..."
82-
gpr push "$package" -k ${{ secrets.GITHUB_TOKEN }} || echo "Skipping: Package push failed or already exists."
83-
84-
# myget
85-
echo "Pushing to MyGet..."
86-
dotnet nuget push "$package" \
87-
--source "https://www.myget.org/F/aspectcore/api/v2/package" \
88-
--api-key ${{ secrets.MYGET_API_TOKEN }} \
89-
--skip-duplicate || echo "Skipping: Package push failed or already exists."
94+
if [ "${{ inputs.publish-github-package }}" = "true" ]; then
95+
# GitHub
96+
echo "Pushing to GitHub Package Registry..."
97+
gpr push "$package" -k ${{ secrets.GITHUB_TOKEN }} || echo "Skipping: Package push failed or already exists."
98+
else
99+
echo "Skipping: Pushing to GitHub Package Registry is disabled."
100+
fi
101+
102+
# MyGet
103+
if [ "${{ inputs.publish-myget-package }}" = "true" ]; then
104+
echo "Pushing to MyGet..."
105+
dotnet nuget push "$package" \
106+
--source "https://www.myget.org/F/aspectcore/api/v2/package" \
107+
--api-key ${{ secrets.MYGET_API_TOKEN }} \
108+
--skip-duplicate || echo "Skipping: Package push failed or already exists."
109+
else
110+
echo "Skipping: Pushing to MyGet Package Registry is disabled."
111+
fi
90112
done

.github/workflows/build-linux.yml

Lines changed: 0 additions & 36 deletions
This file was deleted.

.github/workflows/build-osx.yml renamed to .github/workflows/build-pr-ci.yml

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1-
name: Build OSX
2-
#on: [push, pull_request]
3-
env:
4-
DOTNET_CLI_TELEMETRY_OPTOUT: 1
1+
name: Build for PR
2+
on:
3+
pull_request:
4+
55
jobs:
6-
build:
7-
runs-on: macOS-latest
6+
build-and-test:
7+
runs-on: windows-latest
88
steps:
99
- name: Checkout
1010
uses: actions/checkout@v4
@@ -13,9 +13,7 @@ jobs:
1313
- name: Setup .NET Core
1414
uses: actions/setup-dotnet@v4
1515
with:
16-
dotnet-version: |
17-
6.x
18-
8.x
16+
dotnet-version: 9.x
1917

2018
- name: Build Reason
2119
run: "echo ref: ${{github.ref}} event: ${{github.event_name}}"
@@ -33,3 +31,4 @@ jobs:
3331
for project in $(find ./tests -name "*.csproj"); do
3432
dotnet test --configuration Release $project
3533
done
34+

AspectCore-Framework.sln

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11

22
Microsoft Visual Studio Solution File, Format Version 12.00
3-
# Visual Studio Version 16
4-
VisualStudioVersion = 16.0.29519.181
3+
# Visual Studio Version 17
4+
VisualStudioVersion = 17.12.35514.174 d17.12
55
MinimumVisualStudioVersion = 10.0.40219.1
66
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "src", "src", "{73F38B6C-1A05-41C8-8029-D1F2F41D3279}"
77
EndProject
@@ -19,7 +19,6 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "items", "items", "{D9666E6E
1919
ProjectSection(SolutionItems) = preProject
2020
.gitattributes = .gitattributes
2121
.gitignore = .gitignore
22-
appveyor.yml = appveyor.yml
2322
build.cake = build.cake
2423
build.ps1 = build.ps1
2524
LICENSE = LICENSE

0 commit comments

Comments
 (0)