Skip to content

Commit

Permalink
update versioning
Browse files Browse the repository at this point in the history
  • Loading branch information
pwelter34 committed Jul 29, 2023
1 parent 3072fa9 commit 9051cca
Show file tree
Hide file tree
Showing 2 changed files with 40 additions and 15 deletions.
4 changes: 2 additions & 2 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# EditorConfig is awesome: https://EditorConfig.org
# EditorConfig: https://EditorConfig.org

root = true

Expand All @@ -11,7 +11,7 @@ insert_final_newline = true
trim_trailing_whitespace = true

# XML Configuration Files
[*.{xml,config,props,targets,nuspec,resx,ruleset,vsixmanifest,vsct}]
[*.{xml,config,props,targets,nuspec,resx,ruleset,vsixmanifest,vsct,refactorlog,runsettings}]
indent_size = 2

# JSON Files
Expand Down
51 changes: 38 additions & 13 deletions .github/workflows/dotnet.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
name: Build Project

env:
BUILD_PATH: '${{github.workspace}}/packages'
BUILD_VERSION: '2.5.${{github.run_number}}'
BUILD_INFORMATION: 2.5.${{github.run_number}}+Branch.${{github.ref_name}}.Sha.${{github.sha}}'
DOTNET_NOLOGO: true
DOTNET_SKIP_FIRST_TIME_EXPERIENCE: true
BUILD_PATH: '${{github.workspace}}/artifacts'

on:
push:
Expand All @@ -25,22 +25,30 @@ jobs:
steps:
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0

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

- name: Restore dependencies
- name: Calculate Version
run: |
dotnet tool update -g minver-cli
echo "BUILD_VERSION=$(minver -v e -t v)" >> $GITHUB_ENV
- name: Restore Dependencies
run: dotnet restore

- name: Build Project
run: 'dotnet build --no-restore --configuration Release -p:Version="${{env.BUILD_VERSION}}" -p:InformationalVersion="${{env.BUILD_INFORMATION}}"'
- name: Build Solution
run: 'dotnet build --no-restore --configuration Release -p:Version="${{env.BUILD_VERSION}}" -p:InformationalVersion="${{env.BUILD_VERSION}}+${{github.sha}}"'

- name: Run Test
run: dotnet test --no-build --configuration Release --verbosity normal

- name: Create Packages
if: success() && github.event_name != 'pull_request'
run: 'nuget pack Injectio.nuspec -Version "${{env.BUILD_VERSION}}" -OutputDirectory "${{env.BUILD_PATH}}" -p Configuration=Release'

- name: Upload Packages
Expand All @@ -50,19 +58,36 @@ jobs:
name: packages
path: '${{env.BUILD_PATH}}'

- name: Publish Packages
if: success() && github.event_name != 'pull_request'
deploy:
runs-on: ubuntu-latest
needs: build
if: success() && github.event_name != 'pull_request' && (github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/tags/v'))

steps:
- name: Download Artifact
uses: actions/download-artifact@v3
with:
name: packages

- name: Publish Packages GitHub
run: |
for package in $(find -name "*.nupkg"); do
echo "${0##*/}": Pushing $package...
dotnet nuget push $package --source https://nuget.pkg.github.com/loresoft/index.json --api-key ${{ secrets.GITHUB_TOKEN }} --skip-duplicate
done
- name: Publish Packages feedz
run: |
dotnet nuget add source --username pwelter34 --password ${{ secrets.GITHUB_TOKEN }} --store-password-in-clear-text --name github "https://nuget.pkg.github.com/loresoft/index.json"
for package in $(find -name "*.nupkg"); do
echo "${0##*/}": Pushing $package...
dotnet nuget push $package --source "github" --api-key ${{ secrets.GITHUB_TOKEN }} --skip-duplicate
dotnet nuget push $package --source https://f.feedz.io/loresoft/open/nuget/index.json --api-key ${{ secrets.FEEDDZ_KEY }} --skip-duplicate
done
- name: Publish Release Packages
if: success() && startsWith(github.ref, 'refs/tags/v')
- name: Publish Packages Nuget
if: startsWith(github.ref, 'refs/tags/v')
run: |
for package in $(find -name "*.nupkg"); do
echo "${0##*/}": Pushing $package...
dotnet nuget push $package --source https://api.nuget.org/v3/index.json --api-key ${{ secrets.NUGET_KEY }} --skip-duplicate
done

0 comments on commit 9051cca

Please sign in to comment.