Skip to content

Commit

Permalink
seperate worflow per package
Browse files Browse the repository at this point in the history
  • Loading branch information
calebjenkins committed Jan 3, 2024
1 parent 8580776 commit fa7ec67
Show file tree
Hide file tree
Showing 2 changed files with 83 additions and 2 deletions.
83 changes: 83 additions & 0 deletions .github/workflows/dev-ci-tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
on:
push:
branches:
- 'develop'
paths-ignore:
- '**.md'
workflow_dispatch:

jobs:
build:
runs-on: ubuntu-latest
timeout-minutes: 15

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

- name: Setup .NET
uses: actions/setup-dotnet@v3
with:
dotnet-version: '7.0.x'

- name: Package Restore
run: dotnet restore

- name: Build
run: dotnet build --configuration Release

- name: Test
run: dotnet test --configuration Release --no-build --filter 'FullyQualifiedName!~BDD_Specs'

- name: Echo Branch Name
run: echo "Branch name is $GITHUB_REF_NAME "
#if: ${{ github.ref == 'refs/heads/main' }}

- name: Get version
id: get_version
uses: greenygh0st/net-proj-release-version@v1
with:
# Filepath of the *.csproj file, relative to root of repository
PROJ_FILE: src/KeyValueRepoTests/KeyValueRepoTests.csproj

# env:
# RELEASE_VERSION: ${{ steps.get_version.outputs.RELEASE_VERSION }}


- name: Show Release Version
run: echo "Release Version is ${{steps.get_version.outputs.RELEASE_VERSION}}"

- name: Set Release Version
run: echo "getting version"

env:
RELEASE_VERSION: steps.get_version.outputs.RELEASE_VERSION


- name: Print new build number
run: echo "Build number is $GITHUB_RUN_NUMBER "


- name: Detect if workflow is running on origin/Develop
id: detect_develop
run: git rev-parse HEAD | grep $(git rev-parse origin/develop)
continue-on-error: true

- name: Verify is based on origin/Develop to ensure PRs are correctly targeted
# List commits that are ahead of origin/Develop through HEAD and look for the tip of the current branch.
# If HEAD isn't ahead of origin/Develop, the git log bit will be empty and grep will fail
run: git log origin/Develop..HEAD | grep $(git rev-parse --short HEAD)
if: ${{ steps.detect_develop.outcome == 'failure' }}

- name: Pack
run: dotnet pack src/KeyValueRepoTests/KeyValueRepoTests.csproj --configuration Release -p:PackageVersion=${{steps.get_version.outputs.RELEASE_VERSION}}-ci-${GITHUB_RUN_NUMBER} --include-symbols --output .
if: ${{ steps.detect_develop.outcome == 'success' }}

- name: Push to Nuget
if: ${{ github.ref == 'refs/heads/develop' }}
run: dotnet nuget push Calebs.KeyValueRepoTests.${{steps.get_version.outputs.RELEASE_VERSION}}-ci-${GITHUB_RUN_NUMBER}.nupkg --source https://api.nuget.org/v3/index.json --api-key ${{secrets.NUGET_KEY}}



2 changes: 0 additions & 2 deletions src/KeyValueSqlLiteRepo/KeyValueSqlLiteRepo.csproj
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFrameworks>net6.0;</TargetFrameworks>
<ImplicitUsings>enable</ImplicitUsings>
Expand Down Expand Up @@ -27,7 +26,6 @@
<Title>KeyValueRepo - SQLite implementation</Title>
</PropertyGroup>


<ItemGroup>
<PackageReference Include="Calebs.Extensions" Version="1.5.0" />
<PackageReference Include="Calebs.KeyValueRepo" Version="0.2.0-ci-9" />
Expand Down

0 comments on commit fa7ec67

Please sign in to comment.