-
Notifications
You must be signed in to change notification settings - Fork 24
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Showing
1 changed file
with
12 additions
and
14 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 |
---|---|---|
|
@@ -6,23 +6,18 @@ on: | |
# branches: [ master ] | ||
|
||
jobs: | ||
versioning: | ||
get_version: | ||
runs-on: ubuntu-latest | ||
outputs: | ||
version: ${{ steps.set_version.outputs.new_version }} | ||
version: ${{ steps.get_version.outputs.version }} | ||
steps: | ||
- uses: actions/[email protected] | ||
- name: Bump version and push tag | ||
id: set_version | ||
uses: mathieudutour/[email protected] | ||
with: | ||
github_token: ${{ secrets.GITHUB_TOKEN }} | ||
default_bump: patch # Automatically bump patch version | ||
release_branches: release.*,hotfix.*,master | ||
pre_release_branches: feature.* | ||
- name: Get latest tag | ||
id: get_version | ||
run: echo "version=$(git describe --tags $(git rev-list --tags --max-count=1))" >> $GITHUB_ENV | ||
|
||
build: | ||
needs: versioning | ||
needs: get_version | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/[email protected] | ||
|
@@ -37,12 +32,13 @@ jobs: | |
- name: Test | ||
run: dotnet test --no-build -c Release --verbosity normal | ||
- name: Pack | ||
run: dotnet pack --no-build -c Release -o nupkg /p:PackageVersion=${{ needs.versioning.outputs.version }} | ||
run: dotnet pack --no-build -c Release -o nupkg /p:PackageVersion=${{ needs.get_version.outputs.version }} | ||
- name: Upload NuGet packages as artifacts | ||
uses: actions/[email protected] | ||
with: | ||
name: nuget-packages | ||
path: nupkg/*.nupkg | ||
|
||
publish: | ||
needs: build | ||
runs-on: ubuntu-latest | ||
|
@@ -52,5 +48,7 @@ jobs: | |
with: | ||
name: nuget-packages | ||
path: nupkg | ||
- name: Push to NuGet | ||
run: dotnet nuget push "**/*.nupkg" -k ${{secrets.NUGET_API_KEY}} -s https://api.nuget.org/v3/index.json --skip-duplicate | ||
- name: Push to NuGet.org | ||
# run: dotnet nuget push "**/*.nupkg" -k ${{ secrets.NUGET_API_KEY }} -s https://api.nuget.org/v3/index.json --skip-duplicate | ||
- name: Push to GitHub Packages | ||
# run: dotnet nuget push "**/*.nupkg" -k ${{ secrets.GITHUB_TOKEN }} -s https://nuget.pkg.github.com/${{ github.repository_owner }}/index.json --skip-duplicate |