Skip to content

Commit

Permalink
Merge pull request #8 from Crown0815/ci/Introduce-proper-github-releases
Browse files Browse the repository at this point in the history
Ci/introduce proper GitHub releases
  • Loading branch information
Crown0815 authored Dec 29, 2023
2 parents 7079505 + b8035e1 commit 4e918e9
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 15 deletions.
7 changes: 4 additions & 3 deletions .github/workflows/build-and-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,21 +10,22 @@ on:

jobs:
build-and-test:

name: build-and-test-${{matrix.os}}
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ ubuntu-latest, windows-latest, macOS-latest ]

steps:
- uses: actions/checkout@v3

- name: Setup .NET Core
uses: actions/setup-dotnet@v3
with:
global-json-file: global.json

- name: Install dependencies
- name: Restore
run: dotnet restore

- name: Build
Expand Down
35 changes: 23 additions & 12 deletions .github/workflows/publish_tool.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,33 +10,44 @@ jobs:
runs-on: ubuntu-latest

steps:

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

- name: Setup .NET Core
uses: actions/setup-dotnet@v3
with:
global-json-file: global.json

- name: Install GitVersion
uses: gittools/actions/gitversion/setup@v0.9.7
uses: gittools/actions/gitversion/setup@v0.10.2
with:
versionSpec: '5.x'

- name: Determine Version
id: version
uses: gittools/actions/gitversion/execute@v0.9.7
uses: gittools/actions/gitversion/execute@v0.10.2
with:
useConfigFile: true

- name: Setup .NET Core
uses: actions/setup-dotnet@v3
with:
global-json-file: global.json

- name: Package
run: dotnet pack --configuration Release --output nuget --nologo -p:Version=${{ steps.version.outputs.nuGetVersionV2 }}

- name: Tag Repository
uses: rickstaa/action-create-tag@v1
- name: Generate Release Notes
run: |-
dotnet tool install --global ConventionalChangelog --version 0.7.0
changelog "${{ github.workspace }}" >> "changelog.md"
- name: Create a Release
uses: comnoco/[email protected]
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag: "v${{ steps.version.outputs.semVer }}"
tag_name: "v${{ steps.version.outputs.semVer }}"
release_name: "${{ steps.version.outputs.semVer }}"
body_path: "changelog.md"
prerelease: ${{ steps.version.outputs.preReleaseLabel != '' }}

- name: Publish
run: dotnet nuget push "**/*.nupkg" --source nuget.org --api-key ${{ secrets.NUGET_API_KEY }}
# - name: Publish
# run: dotnet nuget push "**/*.nupkg" --source nuget.org --api-key ${{ secrets.NUGET_API_KEY }}

0 comments on commit 4e918e9

Please sign in to comment.