Skip to content

Update CI #330

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Dec 3, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -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}}"
Expand Down Expand Up @@ -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
36 changes: 0 additions & 36 deletions .github/workflows/build-linux.yml

This file was deleted.

Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -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}}"
Expand All @@ -33,3 +31,4 @@ jobs:
for project in $(find ./tests -name "*.csproj"); do
dotnet test --configuration Release $project
done

5 changes: 2 additions & 3 deletions AspectCore-Framework.sln
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -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
Expand Down
Loading