diff --git a/.github/workflows/build-windows.yml b/.github/workflows/build-ci.yml similarity index 60% rename from .github/workflows/build-windows.yml rename to .github/workflows/build-ci.yml index 7db0d843..e7658d69 100644 --- a/.github/workflows/build-windows.yml +++ b/.github/workflows/build-ci.yml @@ -1,9 +1,25 @@ -name: Build Windows -on: [push, pull_request] -env: - DOTNET_CLI_TELEMETRY_OPTOUT: 1 +name: Build +on: + push: + branches: + - master + paths: + - '!**/*.md' + workflow_dispatch: + inputs: + publish-github-package: + type: boolean + description: 'Github Package push' + default: true + required: false + publish-myget-package: + type: boolean + description: 'MyGet Package push' + default: true + required: false + jobs: - build: + build-test-pack: runs-on: windows-latest steps: - name: Checkout @@ -13,9 +29,7 @@ jobs: - name: Setup .NET Core uses: actions/setup-dotnet@v4 with: - dotnet-version: | - 6.x - 8.x + dotnet-version: 9.x - name: Build Reason run: "echo ref: ${{github.ref}} event: ${{github.event_name}}" @@ -59,32 +73,40 @@ jobs: done - name: Package + if: ${{ inputs.publish-github-package || inputs.publish-myget-package}} shell: bash - if: github.event_name != 'pull_request' run: | for project in $(find ./src -name "*.csproj"); do dotnet pack --configuration Release --no-build $project -p:PackageVersion=${{ env.FULL_VERSION }} -p:SymbolPackageFormat=snupkg --include-source --output ./artifacts/packages done - name: Install GitHub Package Tool - if: github.event_name != 'pull_request' + if: ${{ inputs.publish-github-package}} run: dotnet tool install gpr -g - name: Publish CI Packages + if: ${{ inputs.publish-github-package || inputs.publish-myget-package}} shell: bash - if: github.event_name != 'pull_request' run: | for package in $(find ./artifacts/packages/ -name "*.nupkg" -o -name "*.snupkg"); do echo "$package": Pushing $package... - # GitHub - echo "Pushing to GitHub Package Registry..." - gpr push "$package" -k ${{ secrets.GITHUB_TOKEN }} || echo "Skipping: Package push failed or already exists." - - # myget - echo "Pushing to MyGet..." - dotnet nuget push "$package" \ - --source "https://www.myget.org/F/aspectcore/api/v2/package" \ - --api-key ${{ secrets.MYGET_API_TOKEN }} \ - --skip-duplicate || echo "Skipping: Package push failed or already exists." + if [ "${{ inputs.publish-github-package }}" = "true" ]; then + # GitHub + echo "Pushing to GitHub Package Registry..." + gpr push "$package" -k ${{ secrets.GITHUB_TOKEN }} || echo "Skipping: Package push failed or already exists." + else + echo "Skipping: Pushing to GitHub Package Registry is disabled." + fi + + # MyGet + if [ "${{ inputs.publish-myget-package }}" = "true" ]; then + echo "Pushing to MyGet..." + dotnet nuget push "$package" \ + --source "https://www.myget.org/F/aspectcore/api/v2/package" \ + --api-key ${{ secrets.MYGET_API_TOKEN }} \ + --skip-duplicate || echo "Skipping: Package push failed or already exists." + else + echo "Skipping: Pushing to MyGet Package Registry is disabled." + fi done \ No newline at end of file diff --git a/.github/workflows/build-linux.yml b/.github/workflows/build-linux.yml deleted file mode 100644 index 76c6eb4d..00000000 --- a/.github/workflows/build-linux.yml +++ /dev/null @@ -1,36 +0,0 @@ -name: Build Linux -#on: [push, pull_request] -env: - DOTNET_CLI_TELEMETRY_OPTOUT: 1 -jobs: - build: - runs-on: ubuntu-latest - steps: - - name: Checkout - uses: actions/checkout@v4 - with: - fetch-depth: 0 - - name: Setup .NET Core - uses: actions/setup-dotnet@v4 - with: - dotnet-version: | - 6.x - 8.x - - - name: Build Reason - run: "echo ref: ${{github.ref}} event: ${{github.event_name}}" - - - name: Build - shell: bash - run: | - for project in $(find ./src -name "*.csproj"); do - dotnet build --configuration Release $project - done - - - name: Run Tests - shell: bash - run: | - for project in $(find ./tests -name "*.csproj"); do - dotnet test --configuration Release $project - done - \ No newline at end of file diff --git a/.github/workflows/build-osx.yml b/.github/workflows/build-pr-ci.yml similarity index 79% rename from .github/workflows/build-osx.yml rename to .github/workflows/build-pr-ci.yml index d879941d..aa11247a 100644 --- a/.github/workflows/build-osx.yml +++ b/.github/workflows/build-pr-ci.yml @@ -1,10 +1,10 @@ -name: Build OSX -#on: [push, pull_request] -env: - DOTNET_CLI_TELEMETRY_OPTOUT: 1 +name: Build for PR +on: + pull_request: + jobs: - build: - runs-on: macOS-latest + build-and-test: + runs-on: windows-latest steps: - name: Checkout uses: actions/checkout@v4 @@ -13,9 +13,7 @@ jobs: - name: Setup .NET Core uses: actions/setup-dotnet@v4 with: - dotnet-version: | - 6.x - 8.x + dotnet-version: 9.x - name: Build Reason run: "echo ref: ${{github.ref}} event: ${{github.event_name}}" @@ -33,3 +31,4 @@ jobs: for project in $(find ./tests -name "*.csproj"); do dotnet test --configuration Release $project done + \ No newline at end of file diff --git a/AspectCore-Framework.sln b/AspectCore-Framework.sln index a7bd9e9c..07362618 100644 --- a/AspectCore-Framework.sln +++ b/AspectCore-Framework.sln @@ -1,7 +1,7 @@  Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio Version 16 -VisualStudioVersion = 16.0.29519.181 +# Visual Studio Version 17 +VisualStudioVersion = 17.12.35514.174 d17.12 MinimumVisualStudioVersion = 10.0.40219.1 Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "src", "src", "{73F38B6C-1A05-41C8-8029-D1F2F41D3279}" EndProject @@ -19,7 +19,6 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "items", "items", "{D9666E6E ProjectSection(SolutionItems) = preProject .gitattributes = .gitattributes .gitignore = .gitignore - appveyor.yml = appveyor.yml build.cake = build.cake build.ps1 = build.ps1 LICENSE = LICENSE