-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
8580776
commit fa7ec67
Showing
2 changed files
with
83 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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}} | ||
|
||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters