Skip to content

Commit

Permalink
#19 package yaml version bumps
Browse files Browse the repository at this point in the history
  • Loading branch information
Ian-Webster committed Dec 7, 2023
1 parent 5b92bf7 commit 4bf7626
Show file tree
Hide file tree
Showing 5 changed files with 89 additions and 7 deletions.
9 changes: 7 additions & 2 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
name: Build actions
name: Branch - build branch actions

on: push
on:
push:
branches:
- '*'
- '!main'
- '!trunk'

jobs:

Expand Down
File renamed without changes.
72 changes: 72 additions & 0 deletions .github/workflows/package.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
name: Trunk - build and package actions

on:
push:
branches:
- main
- trunk

jobs:

build_and_pack_DataAccess:

runs-on: ubuntu-latest

steps:
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0

# Install the .NET Core workload
- name: Install .NET Core
uses: actions/setup-dotnet@v3
with:
dotnet-version: 8.0.x

# Set up local NuGet repo
- name: Setup GitHub NuGet
run: dotnet nuget add source --username USERNAME --password ${{ secrets.GITHUB_TOKEN }} --store-password-in-clear-text --name github "https://nuget.pkg.github.com/Ian-Webster/index.json"

- name: Check for Changes in Repository Project
run: |
if [[ $(git diff --name-only ${{ github.event.before }} ${{ github.sha }} 'DataAccess.Repository/') ]]; then
echo "Changes detected in DataAccess.Repository project. Restoring packages and running build..."
dotnet restore 'DataAccess.Repository'
dotnet build --configuration Release 'DataAccess.Repository'
dotnet test 'DataAccess.Repository.Tests'
dotnet nuget push "DataAccess.Repository/bin/Release/*.nupkg" --api-key ${{ secrets.GITHUB_TOKEN }} --source "github" --skip-duplicate
else
echo "No changes in DataAccess.Repository project. Skipping build and packing"
fi
build_and_pack_HotChococlateExtension:

runs-on: ubuntu-latest

steps:
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0

# Install the .NET Core workload
- name: Install .NET Core
uses: actions/setup-dotnet@v3
with:
dotnet-version: 8.0.x

# Set up local NuGet repo
- name: Setup GitHub NuGet
run: dotnet nuget add source --username USERNAME --password ${{ secrets.GITHUB_TOKEN }} --store-password-in-clear-text --name github "https://nuget.pkg.github.com/Ian-Webster/index.json"

- name: Check for Changes in HotChocolate Project
run: |
if [[ $(git diff --name-only ${{ github.event.before }} ${{ github.sha }} 'Extensions/DataAccess.Repository.HotChocolate/') ]]; then
echo "Changes detected in Extensions/DataAccess.Repository.HotChocolate project. Restoring packages and running build..."
dotnet restore 'Extensions/DataAccess.Repository.HotChocolate'
dotnet build --configuration Release 'Extensions/DataAccess.Repository.HotChocolate'
dotnet nuget push "DataAccess.Repository/bin/Release/*.nupkg" --api-key ${{ secrets.GITHUB_TOKEN }} --source "github" --skip-duplicate
else
echo "No changes in Extensions/DataAccess.Repository.HotChocolate project. Skipping build and packing"
fi
13 changes: 9 additions & 4 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
name: Test DataAccess.Repository action
name: Branch - test DataAccess.Repository action

on: push
on:
push:
branches:
- '*'
- '!main'
- '!trunk'

jobs:

Expand All @@ -27,10 +32,10 @@ jobs:
- name: Check for Changes in Repository Project
run: |
if [[ $(git diff --name-only ${{ github.event.before }} ${{ github.sha }} 'DataAccess.Repository/' 'DataAccess.Repository.Tests/') ]]; then
echo "Changes detected in DataAccess.Repository project. Restoring packages, running build and testing..."
echo "Changes detected. Restoring packages, running build and testing..."
dotnet restore 'DataAccess.Repository'
dotnet build --configuration Release 'DataAccess.Repository'
dotnet test 'DataAccess.Repository.Tests'
else
echo "No changes in DataAccess.Repository project. Skipping build."
echo "No changes. Skipping build and tests"
fi
2 changes: 1 addition & 1 deletion DataAccess.Repository/DataAccess.Repository.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
<Description>A simple base repository to be used in other projects requiring data access</Description>
<PackageProjectUrl>https://github.com/Ian-Webster/DataAccess</PackageProjectUrl>
<RepositoryUrl>https://github.com/Ian-Webster/DataAccess</RepositoryUrl>
<VersionPrefix>2.0.4</VersionPrefix>
<VersionPrefix>2.0.5</VersionPrefix>
<VersionSuffix></VersionSuffix>
</PropertyGroup>

Expand Down

0 comments on commit 4bf7626

Please sign in to comment.